The recited claims are directed, in general, to communication bus protocols and, more specifically, to an address programming and communication protocol for a daisy chain system of devices connected by a single-wire communication bus.
Individual devices may be connected to each other in a daisy chain configuration such that each individual device is connected to exactly two neighboring devices in the daisy chain, except for the first and last devices, which are connected to only one neighboring device. In certain daisy chain configurations, one of the terminal devices in the chain is a host controller device and the remaining devices in the chain are slave devices. In such a configuration, the host controller dispatches commands that are used to control and/or configure certain aspects of the operation of the slave devices. A daisy chain configuration of devices may be used for a variety of applications, including distributed sensor applications, such as distributed temperature sensing. Designing appropriate communication and addressing protocol for daisy chain configurations may present significant challenges.
This disclosure describes a protocol by which slave devices in a daisy chain configuration can be uniquely addressed by a host controller using a single wire connection between each of the devices in the daisy chain. In some examples, an address programming protocol may initiate a sequence of events that allow the slave devices to programmed with addresses that are automatically determined by slave devices (e.g., automatically determined based on the order in which the slave devices receive an address programming command). In this way, a host controller may be able to uniquely address devices in a daisy chain without requiring the slave devices to have factory-programmed device addresses.
This disclosure describes a technique for assigning device addresses to slave devices in a system comprising of a host controller and multiple slave devices that are connected in a daisy chain configuration. This disclosure also describes a protocol by which the host controller can communicate with any of the slave devices based on their assigned address or with certain subsets of the slave devices. Both the address assignment technique and the communication protocol utilize the single bus connecting the host controller and slave devices in a daisy chain configuration.
Disclosed herein is a slave device according to various embodiments, the slave device comprising: an upstream port connecting the slave device to an upstream device, wherein the upstream port receives an address assignment command from the upstream device, and wherein the address assignment command includes a first device address; an internal memory configured to store an assigned device address identifying the slave device; a logic unit operable to program the internal memory to store the first device address as the assigned device address and further operable to increment the first device address to generate a second device address and further operable to generate an updated address assignment command that includes the second device address; and a downstream port connecting the slave device to a downstream device, wherein the downstream port transmits the updated address assignment command to the downstream device.
According to various additional embodiments, the logic unit is further operable to generate an address assignment response command and further operable to transmit the address assignment response command to the upstream device via the upstream port. According to various additional embodiments, the downstream port receives a second address assignment response from the downstream device and wherein the upstream port transmits the second assignment response to the upstream device. According to various additional embodiments, the upstream device via a single wire and wherein the downstream port is connected to the downstream device via a single wire. According to various additional embodiments, the logic unit is further operable to determine if no downstream device is connected to the downstream port. According to various additional embodiments, the upstream port receives an address initialization command from the upstream device, and wherein the downstream port transmits the address initialization command to the downstream device. According to various additional embodiments, the logic unit is further operable to disconnect the downstream port upon transmitting the address initialization command to the downstream device and is further operable to reconnect the downstream port upon transmitting the address assignment response to the upstream device.
Also disclosed herein is a host controller device according to various embodiments, the host controller device comprising: a downstream port connecting the host controller to one or more downstream devices connected in a daisy chain via a single-wire communication bus, wherein the downstream port transmits an address assignment command, and wherein the downstream port receives address assignment responses from the one or more downstream devices; an internal memory configured to store address assignments and a logic unit operable to process the address assignment responses to determine a device address assignment for each of the one or more downstream devices and further operable to store the address assignments to the internal memory.
According to various additional embodiments, the address assignment command includes an initial device address. According to various additional embodiments, the address assignments for each of the one or more downstream devices are sequentially incremented addresses starting from the initial device address. According to various additional embodiments, the downstream port transmits a memory operation command, the memory operation command addressed to a first downstream device based on the stored address assignment for the first downstream device. According to various additional embodiments, the memory operation command specifies a memory location of the first downstream device.
Also disclosed herein is a slave device according to various additional embodiments, the slave device comprising: an upstream port connecting the slave device to an upstream device, wherein the upstream port is configured to receive a command from the upstream device, and wherein the command specifies one or more intended recipients; a downstream port connecting the slave device to a downstream device, wherein the downstream port is configured to transmit the command to the downstream device; an internal memory storing an assigned device address identifying the slave device, and a logic unit operable to determine whether the slave device is an intended recipient of the command based on the assigned device address.
According to various additional embodiments, the logic unit is further operable, if the slave device is not an intended recipient, to reconfigure the downstream port to receive a command response from the downstream device and to reconfigure the upstream port to transmit the command response to the upstream device. According to various additional embodiments, the logic unit is further operable, if the slave device is the only intended recipient, to generate a command response and to disable the downstream port and to reconfigure the upstream port to transmit a command response to the upstream device. According to various additional embodiments, the logic unit is further operable to determine whether the downstream device is an intended recipient of the command based on the assigned device address. According to various additional embodiments, the logic unit is further operable, if the slave device is an intended recipient and the downstream device is an intended recipient, to reconfigure the downstream port to receive a first command response from the downstream device and to reconfigure the upstream port to transmit the first command response to the upstream device. According to various additional embodiments, the logic unit is further operable, upon receiving the first command response from the downstream device and transmitting the first command response to the upstream device, to generate a second command response, and to reconfigure the upstream port to transmit the second command response to the upstream device and to disable the downstream port. According to various additional embodiments, the command includes calibration information specifying the baud rate used by the upstream device to transmit the command. According to various additional embodiments, the command specifies a device address identifying a single intended recipient.
Also disclosed herein is a method according to various embodiments for assigning unique device addresses to a series of devices, the method comprising: receiving an address assignment command from an upstream device, wherein the address assignment command includes a first device address; assigning the first device address to a device from the series of devices; incrementing the first device address to generate a second device address; generating an updated address assignment command, wherein the updated address assignment command includes the second device address; and transmitting the updated address assignment command to a downstream device.
According to various additional embodiments, the method further comprises: generating a first address assignment response command; and transmitting the first address assignment response command to the upstream device. According to various additional embodiments, the method further comprises: receiving a second address assignment response from the downstream device; and transmitting the second assignment response to the upstream device.
Also disclosed herein is a method according to various embodiments for communicating within a series of devices, wherein each device is assigned a unique identifier and wherein each device comprises a downstream port and an upstream port, the method comprising: configuring the upstream port of a device from the series of devices, wherein the upstream port is configured to receive communications from an upstream device; configuring the downstream port of the device to transmit communications to a downstream device; receiving a command from the upstream device, wherein the command specifies one or more intended recipients; transmitting the command to a downstream device; and determining whether the device is an intended recipient of the command.
According to various additional embodiments and if the device is not an intended recipient of the command, the method further comprises: reconfiguring the downstream port to receive a command response from the downstream device; and reconfiguring the upstream port to transmit the command response to the upstream device. According to various additional embodiments and if the device is the only intended recipient of the command, the method further comprises: disabling the downstream port; generating a command response; reconfiguring the upstream port to transmit communications to the upstream device; and transmitting the command response to the upstream device. According to various additional embodiments, the method further comprises: determining whether the downstream device is an intended recipient of the command based on the unique identifier of the device.
Embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Aspects of the disclosure may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art such that one skilled in the art may be able to use the various embodiments.
This disclosure describes techniques and communication protocols that may allow a host controller to communicate with each a plurality of slave devices that are coupled to the host controller in a daisy chain configuration. In some example daisy chain configurations, each device can directly communicate only with neighboring devices. In such examples, a host controller can directly communicate only with a single of the slave devices in the daisy chain. This disclosure describes a protocol by which the host can communicate with any slave device in the daisy chain, while utilizing only the daisy chain connections that link the individual slave devices. In order to communicate with the individual slave devices, the host controller may need to uniquely identify each of the slave devices. Thus, each slave device may be associated with a unique identifier and the host may be informed of the unique identifier used by each slave device in the daisy chain.
One approach to configuring a daisy chain with unique identifiers is for slave device manufacturers to provide a factory programmed unique address for each individual slave device. One disadvantage of this approach is that it places an artificial limit on the maximum number of devices that can be put in the daisy chain network. For many types of relatively low-cost slave devices, such as sensors, it may be a burden for manufacturers of such devices to maintain separate manufacturing flows for devices with different factory programmed unique addresses. Due to this burden, manufacturers may only support a limited number of different device address options (e.g., ten different addresses), which may be too low for certain applications, for instance large networks of sensors.
Even if a manufacturer is willing to support a sufficient number of device addresses, utilizing factory programmed devices is also burdensome on the customer that is assembling the device components into the daisy chain configuration. On a logistical level, the customer may need to implement systems capable of managing otherwise identical devices according to their different device addresses. The customer may need to accurately order and track these devices based on their different addresses and ensure that manufacturing systems are provided with the correct device and the correct address associated with the device.
The use of factory programmed addresses may pose addition burdens to the manufacturing processes. During both the design and assembly of a daisy chain of such devices, the manufacturing process may need to correctly track the different devices based on their hard-coded device address in order for the system to be manufactured and operate correctly. Also testing systems may be used to ensure that each device is correctly located based on its device address. Systems for diagnosing and repairing failures are likewise effected as a customer may implement processes capable of identifying failed devices based on their device address and replacing the defective device with another device that utilizes the same device address or otherwise reprogramming the daisy chain to utilize a different address for the device at the location of the replacement.
Another possible mechanism for providing addresses to slave devices in a daisy chain configuration is for each device to provide an address pin that is configured to receive an address assignment. Using an address pin may require that each device be configured to process address pin commands. Using one or more dedicated address pins also places an artificial limit on the max number of devices in the application as adding pins increases die area incrementally and package size exponentially, thereby increasing the cost of the device significantly.
Certain systems implemented using daisy chained devices may use only a single wire be used to link the devices. Such systems may be limited to a single wire due to factors such as cost and/or board space. Certain conventional approaches for linking daisy chained devices utilize a return wire that runs from the terminal device in the chain back to the host controller on the other end of the chain. This approach simplifies certain aspects of the communications by the slave devices and the host controller, but is not feasible due to the extra cost and complexity that may be attendant with a return wire.
Referring back to the system of
In the addressing scheme illustrated in
The behavior of each of the slave devices 310, 315, 320 in forwarding commands to neighboring slave devices is determined according to the current operating mode of the slave device, with different operating modes providing different forwarding and processing operations by the slave device. Using these modes, the daisy chain of slave devices 310, 315, 320 is configured by the host controller 305 via a series of commands transmitted via the communication bus 325 linking the devices. Each of the slave devices 310, 315, 320 is configured to identify commands issued by the host controller 305 that direct the slave devices to change to a different mode of operation.
By default, the slave devices 310, 315, 320 are configured to begin operation in a forward pass-through mode. A slave device configured in forward pass-through mode is illustrated in
Referring back to
As illustrated in
As illustrated in
Referring back to
The address programming scheme continues, as illustrated in
As illustrated in
Referring back to
Also illustrated in
Address programming continues as illustrated in
As depicted in
As illustrated in
As illustrated in
In certain embodiments, upon determining a failure to receive an address confirmation from a downstream device, the third slave device 1120 signals an end-of-procedure condition to the second slave device 1115 and switches to the default forward pass-through mode. Upon receiving the end-of-procedure signal, the second slave device 1115 repeats this process of forwarding the signal and reverting to forward pass-through mode. Each slave device repeats the process until the daisy chain is configured again as illustrated in
According to certain embodiments, the third slave device 1120 programs itself as the terminal device on the communication bus upon detecting that is the final slave device in the daisy chain. In the illustrated embodiment, the third slave device 1120 stores a bit in a specified register that identifies it as the terminal device. Other embodiments may utilize other mechanisms for programming this terminal device identification by the terminal device. The terminal device identifier may be utilized in certain commands issued by the host controller where the processing of these commands may involve special processing by the terminal device in the chain.
This address programming process is further illustrated in the flowchart of
In this manner, any number of slave devices can be linked in a daisy chain and configured to receive an address assignment. Each slave device is further configured to generate a new address based on the address it receives and assign the generated address to a downstream device. Configured as such, each slave device in the daisy chain is assigned a unique device address with respect to this particular system of devices. Each slave device is further configured dispatch an address response command upstream and participate in forwarding address responses received from downstream devices. Each slave device reports its assigned address to the host controller using an address response command. The host controller is configured to receive the address confirmation commands from each of the slave devices. The host controller processes these confirmations to track the device address received and programmed by each of the slave devices. Using this information, the host controller can address a command to any slave device in the daisy chain. The host controller can optimize its internal operations by taking advantage of the correlation between a slave device's position in the chain and its assigned device address relative to the starting address issued by the host controller to the first slave device.
The ability to program unique addresses to any number of slave devices in this manner obviates the need for slave devices to be provided with factory programmed addresses. As described above, providing factory programmed addresses places a significant burden on device manufactures and system integrators utilizing these devices. Addressing a set of slave devices utilizing embodiments maintains greater flexibility in the number of slave devices that can be supported and simplifies manufacturing and logistical processes that would otherwise be necessary to track slave devices according to their factory assigned address. The lack of factory programmed addresses also allows system designers to easily replace a slave device in the daisy chain. Once a faulty device is replaced, the slave devices are reset and the address programming scheme is re-initialized. This improves the ability to quickly replace malfunctioning slave devices during testing.
Once the slave devices of the daisy chain have been addressed and the host controller has received confirmation of each slave device address assignment, the host controller may begin communicating with each of the slave devices. According to various embodiments, the host controller is configured to utilize the byte structure illustrated in
In the embodiment of
The slave devices connected to the host controller are configured to receive calibration bytes, such as the typical byte illustrated in
In the embodiment illustrated in
Next, the command byte includes a bit sequence 1920 that specifies whether a device address or a command instruction will be provided in the following bit sequence 1925 of the command byte. If the bit sequence 1920 indicates a device address will follow, the subsequent bits 1925 provide the unique address assigned to a particular slave device. This ability to specify the unique address of a device using bit sequences 1920 and 1925 is utilized when bit sequence 1910 specifies that the command is directed to a specific slave device. In the embodiment illustrated in
The bit sequence 1920 of the command byte may also be used to indicate that a command instruction will be provided in the following bit sequence 1925. If a command instruction is provide in bit sequence 1925, this command instruction directs all of the slave devices that receive the command to carry out a specific function, such as a software reset or changing the status of an interrupt pin. The command ends with an end signal 1930 that follows the bit sequence 1925 that specifies a device address or command instruction. In the illustrated embodiment, the end signal 1930 consist of pulling the voltage high on the single-wire communication bus.
In the byte structure of a host controller communication illustrated in
Referring back to
In the embodiment of
Utilizing the byte structure illustrated in
As illustrated, slave devices 2015, 2020, 2025 are configured in forward pass-through mode such each slave device receives the write command 2010, reads the command and forwards the write command to the downstream slave device via the communication bus. The first slave device 2015 receives the write command 2010, parses the command byte and determines that an individual write command is specified, but the device address specified by the command byte command is different from the device address of the first slave device 2015. Since the write command 201 is individual command not addressed to the first slave device 2015, the first slave device takes no further action.
The second slave device 2020 receives the write command 2010 on the communication bus, reads the command and forwards the command downstream to the third slave device 2025. The second slave device 2020 processes the write command 2010 and determines that that the device address specified in the command byte matches the device address assigned to the second slave device. The second slave device 2020 processes the write command 2010 further to extract the address location encoded in the register pointer byte. In some embodiments, multiple register pointer bytes will be included in the write command 2010. The second slave device 2020 processes the data byte of the write command 2010 to extract the data provided by the host controller. In some scenarios, multiple data bytes will be included in the write command 2010. The second slave device 2020 stores the data to the register specified by the register pointer byte.
As describe with respect to
In scenarios where a global write command is issued to all devices in the chain, no device address is specified in the byte command. In certain embodiments, however, a global write command may be issued to a subset of the slave devices by including a device address in a global write command. In certain of such embodiments, each slave device processes the command to determine if its assigned address is less than or equal to the specified device address. If a slave device determines its assigned address is less than or equal to the specified address, the slave device responds to the command by writing the provided data to the specified memory location. In certain other embodiments, slave devices will respond if their device address is greater than or equal to the specified address. In this manner, the host controller can rely on the sequential device addresses assigned as describe above to address a command to a portion of the device chain.
This ability to direct a global command to subset of slave devices while only providing a single device address in the command is possible due to the position-based address programming scheme described above. Each slave device can easily determine whether it is located upstream or downstream from any given device based only on address information. Additionally, each slave device is able to easily determine its relative position from the host controller, the terminal slave device or any other device in the daisy chain.
The host controller may further utilize the byte structure illustrated in
The first slave device 2115 receives the command and reads it to memory. The first slave device 2115 forwards the command downstream to the second slave device 2120. The first slave device 2115 processes the command and determines it is an individual read command that is directed to a slave device located downstream from the first slave device. Based on this determination, the first slave device 2115 switches from forward pass-through mode to reverse pass-through mode. Configured in this fashion, the first slave device 2115 is configured to cooperate in forwarding the requested data to the host controller.
Upon receipt of the forwarded command, the second slave device 2120 forwards the command downstream, processes it and determines it is an individual read command that is directed to the second slave device. Based on this determination, the second slave device 2120 switches from forward pass-through mode to reverse controlled mode. As illustrated, the third slave device 2125 receives the forwarded command, processes it and takes no action upon determining that it is an individual command directed to an upstream slave device. The second slave device 2120 processes the read command further to extract the register address encoded in the register pointer byte. The second slave device 2120 reads the data from the specified memory address and dispatches the retrieved data upstream to the host controller via a data response 2110 sent to the first slave device 2105. Upon dispatching the data response 2110, the second slave device 2120 switches back to forward pass-through mode. The first slave device 2115 receives the data response 2110. Configured in reverse-pass through mode, the first slave device 2115 forwards the data response 2110 upstream to the host controller 2105 and switches configurations to forward pass-through mode.
The host controller may also issue global read commands. As described above, in certain embodiments global commands may be limited to a subset of slave devices with addresses above or below a device address specified in the command byte. In the embodiment illustrated in
Upon determining that its device address matches the device address specified in the global read command such that no downstream devices will respond to the command, the second slave device 2220 retrieves the data stored at the location specified by the register pointer byte of the global read command. The first slave device 2215 transmits the retrieved data by dispatching a data response 2210 upstream to the host controller 2205 via the first slave device 2215. Upon completing this transmission, the second slave device 2220 configures itself to forward pass-through mode. The first slave device 2215, still in reverse pass-through mode, receives the data response 2210, reads the response and forwards it upstream to the host controller 2205.
As illustrated in
As described above, the byte structure of
In addition to the above described advantages provided according to embodiments, numerous other advantages are provided. For instance, by utilizing embodiments efficient address programming can be provided. In conventional address programming procedures, significant delays may result due to uncertainty regarding the completion of the addressing procedure such that device operations may commence. Embodiments provide a technique by which each addressed slave device confirms its address assignment to the host controller. Consequently, the host controller need only be provided with the number of slave devices that have been connected in the daisy chain to determine that the address assignment procedure has failed and may be able to pinpoint the malfunctioning slave device(s). When successful, the address assignment procedure can be exited and device operations may begin as soon as the host controller receives address assignment confirmations matching in number to the number of connected slave devices.
Once initialized, the embodiments utilizing the described communication protocol may provide efficient messaging to a large number of slave devices. In conventional daisy chain communication protocols, communicating with every slave device may require polling each device individually. This is a communication intensive process that is very tedious to manage. Embodiments provide the ability for a host controller to issue commands to one slave device, all slave devices, or certain subsets of the slave devices using a single command.
Embodiments also provide improved efficiency with respect to power consumption. Programming the internal memory of a slave device consumes a significant amount of power. In conventional address programming schemes that program the addresses of all the devices in a daisy chain at the same time, the total instantaneous power consumed can be large. The power to simultaneously program all slave devices is further increased due to significant resistance in the long power supply lines of certain daisy-chained systems. Such power demands can often not be accommodated in systems where many devices are powered using a common regulator with limited current sourcing ability. Even when such surges in power can be accommodated the resulting instantaneous drop in the supply can cause various system malfunctions or spurious behaviors. Embodiments may use much less power for address programming due to the programming progressing sequentially along the daisy chain one device at a time. With only a single slave device being programmed at any one time, in some examples, power requirements remain minimal. Consequently, available power can be utilized more efficiently to address chains of devices connected in longer cable systems.
Additional advantages are provided by embodiments with respect to various implementation efficiencies relative to conventional daisy chain protocols. Embodiments provide the ability to implement an address programming scheme and communication protocol for a daisy chain of slave devices using only a single-wire communication bus connecting the devices. By using a single wire, embodiments minimize the cost, board space and pins required to implement the communication protocol. Conventional daisy chain communication protocols that are unidirectional may require a return wire from the terminal device to the host controller. Such return lines can add significant complexity since this may be a long path from the terminal slave device to the host controller.
Additional advantages are provided by embodiments with respect to configuring, testing and debugging daisy chain systems. In systems where devices are connected in a daisy chain, there is an inherent risk that a single point of failure in one of the devices can disable the entire system. In conventional systems, diagnosing such failures may require manually testing and/or replacing individual devices until the faulty device is located. Embodiments may allow the host controller to easily identify the location of failed slave devices in the daisy chain by issuing diagnostic commands and monitoring the slave devices that reply with responses to the diagnostic command. The ability of the host controller to identify faulty devices is aided by the structure of the daisy chain being known the host controller based on the responses provided by the slave devices to the host controller during address programming. In certain embodiments, the address programming scheme described above may be re-initialized in order to detect faulty slave devices.
Another advantage provided by embodiments is the ability to implement the communication and address assignment protocol using UART communication capabilities that are commonly supported by host controllers and slave devices. Conventional protocols that are able to utilize a single-wire communication bus may require the use of customized communication protocols. Adapting a host controller or slave device to support a customized communication protocol is problematic and costly exercise. Additionally, these customized protocols are often difficult to modify. Certain conventional systems circumvent this issue by using intermediate converter devices in order to broker the use of the customized communication protocol by the host controller. Embodiments, on the other hand, may be implemented using standard UART communication capabilities commonly supported by host controllers and slave devices.
Many modifications and other embodiments will come to mind to one skilled in the art to which this disclosure pertains having the benefit of the teachings presented in the foregoing descriptions, and the associated drawings. Therefore, it is to be understood that the disclosure is not to be limited to the specific embodiments disclosed. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.
The present application claims the benefit of the filing date of Provisional Application No. 62/101,788, filed Jan. 9, 2015.
Number | Date | Country | |
---|---|---|---|
62101788 | Jan 2015 | US |