METHODS FOR IDENTIFYING TARGET SLAVE ADDRESS FOR SERIAL COMMUNICATION INTERFACE

Information

  • Patent Application
  • 20220188254
  • Publication Number
    20220188254
  • Date Filed
    December 13, 2021
    3 years ago
  • Date Published
    June 16, 2022
    2 years ago
Abstract
A method for programming and controlling of a plurality of slave devices serially connected in a daisy chain configuration using a master device is disclosed. The method includes broadcasting, from the master device, an initialization data packet to the plurality of slave devices to assign each slave device in the plurality of slave devices a slave address that is unique to said each slave device; storing, in each slave device, the assigned slave address, defining a data packet , wherein the data packet comprises a target slave address, a read/write command, a register address, a increment value, and a start address; and transmitting the data packet serially to one or more of the plurality of slave devices until the target address in the data packet matches the slave address stored in one of the plurality of slave devices.
Description
BACKGROUND
1. Field of Technology

This disclosure provides a method for programming and controlling the serial peripheral interface, or SPI, in particular, the method for programming and controlling the SPI in a daisy chain configuration.


2. Description of Related Art

SPI is one of the popular serial interfaces. In the SPI protocol, there are a 7-bit address for the target slave device and chip select (CS). Some SPI Slave devices come with built-in address. In the independent SPI connection (e.g., FIG. 2), chip select (CS) is used to select one of the Slave devices from all Slave devices with the same built-in address. In the Daisy SPI connection (e.g., FIG. 3), the chip select (CS) for all Slave devices are connected together, the first slave output being connected to the second slave input, etc. Therefore, the Daisy SPI connection reduces the number of wires. For the daisy chain connection, the data packet should include the information of target slave device, operation (R/W), and data.


SUMMARY

A method for programming and controlling of a plurality of slave devices serially connected in a daisy chain configuration using a master device is disclosed. The method includes, broadcasting, from the master device, an initialization data packet to the plurality of slave devices to assign each slave device in the plurality of slave devices a slave address that is unique to said each slave device, assigning a unique slave address to each slave device in the plurality of slave devices by sending an initialization data packet serially from the master device serially through the plurality of slave devices, storing, in each slave device, the assigned slave address, defining a data packet, wherein the data packet comprises a target slave address, a read/write command, a register address, a increment value, and a start address, and transmitting the data packet serially to one or more of the plurality of slave devices until the target address in the data packet matches the slave address stored in one of the plurality of slave devices.


According to some embodiments, the initialization data packet comprises a slave address defines a slave address for each slave device and a location on each slave device in which the slave address is stored. According to some embodiments, the method further includes transmitting, from the master device, the data packet to a first slave device in the plurality of slave devices, comparing the target slave address in the slave address stored in the first slave device, when the target slave address and the slave address stored in the first slave device matches, reporting to the master device, or when the target slave address and the slave address stored in the first slave device does not match, updating the data packet and transmitting the updated data packet to a second slave device in the plurality of slave devices, updating the data packet comprises updating the start address by adding to the current start address the increment value. According to some embodiments, the method further includes comparing the incremented start address with the target slave address, and determining that a slave device is selected when the incremented start address matches the slave device having the target slave address.


According to some embodiments, the method further includes the second slave device transmitting the data packet to the third slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by the predetermined increment value. According to some embodiments, the method further includes comparing the incremented start address with the target slave address; and determining that a slave device is selected when the incremented start address matches the slave device having the target slave address. According to some embodiments, the increment is determined by at least of a number of the plurality of slave devices in the daisy chain. According to some embodiments, the increment is determined by at least a number of bits in the target address of the slave device in the daisy chain. According to some embodiments, the method further includes transmitting the shifted data packet from the second slave device back to the master device. According to some embodiments, the method further includes the third slave device transmitting the shifted data packet from the third slave device back to the master device to complete the daisy chain.


According to some embodiments, the data packet includes at least configuration information of the master device, the slave devices and the daisy chain.


According to some embodiments, the address programming further includes storing the corresponding salve address at a pre-determined register address in the data packet. According to some embodiments, the address programming is conducted when the daisy chain is powered on.


According to some embodiments, a method for programming and controlling of a plurality of slave devices by a master device is disclosed. The method includes deploying the plurality of slave devices and the master device in a daisy chain configuration by connecting the master device to a first of the plurality of slave devices, serially connecting the plurality of slave devices, connecting a last slave device back to the master device to form a daisy chain, defining a data structure, wherein the data packet comprises a target slave address, a read/write bit, a register address and a start address, the master device transmitting the data packet to the first slave device of the plurality of devices, and the first slave device transmitting the data packet to the second slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by a predetermined increment value.


According to some embodiments, the method further includes comparing the incremented start address with the target slave address to determine whether a slave device is selected. According to some embodiments, the method further includes the second slave device transmitting the data packet to the third slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by the predetermined increment value. According to some embodiments, the method further includes comparing the incremented start address with the target slave address to determine whether a slave device is selected. According to some embodiments, the predetermined increment value is a natural number. According to some embodiments, the method further includes the second slave device transmitting the shifted data packet back to the master device to complete the daisy chain. According to some embodiments, the data structure comprises a target slave address, a read/write bit, a register slave address to determine whether a slave device is selected. According to some embodiments, the method further includes the second slave device transmitting the shifted data packet back to the master device to complete the daisy chain.





BRIEF DESCRIPTION OF DRAWINGS

The teachings of the present invention can be readily understood by considering the following detailed description in conjunction with the accompanying drawings.



FIG. 1 illustrates a parallel interface and a serial interface.



FIG. 2 illustrates an SPI normal connection.



FIG. 3 illustrates an SPI daisy connection.



FIG. 4 illustrates an example of data encoding in SPI daisy chain connection.



FIG. 5 illustrates an example of how to program slave addresses in all slaves in SPI daisy chain connection in prior art.



FIGS. 6 and 7 illustrates a first example of how to program all slave addresses, e.g., assign an address to each slave device.



FIG. 8 is another way to illustrate the first example in FIGS. 6 and 7, in which SPI Chain starts at 0×00 and has an increment of 0×01.



FIG. 9 illustrates a second example of how to program all slave addresses.



FIGS. 10-11 data transmission in SPI Chain 1, which starts at 0×00 and has an increment of 0×02.



FIGS. 12 and 13 illustrates data transmission in SPI Chain 2, which starts at 0×01 and has an increment of 0×02.





DETAILED DESCRIPTION

Serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. In contrast, parallel communication sends several bits as a whole on a link with several parallel channels. Serial communication reduces the number of wires between transmitter and receiver because all receivers are serially connected so an additional receiver can be connected to the last receiver in the existing series of receivers.


The Serial Peripheral Interface (“SPI”) is a synchronous serial communication interface specification which is implemented for short-distance communication, for example, primarily in embedded systems. Typical applications of SPI include, for example, Secure Digital cards and liquid crystal displays.


SPI devices communicate in full duplex mode using a master-slave architecture usually implements a single master, some Atmel devices, however, can support changing roles on the fly depending on an external (SS) pin. The master device, or the controller, originates the frame for reading and writing. Multiple slave-devices may be supported through selection with individual chip select (“CS”), which re sometimes called slave select (“SS”) lines.


SPI is also known as a four-wire serial bus, in comparison to three-, two-, and one-wire serial buses. The SPI may be described as a synchronous serial interface; it is, however, different from the Synchronous Serial Interface (“SSI”) protocol, which is also a four-wire synchronous serial communication protocol. The SSI protocol implements differential signaling and provides only a single simplex communication channel. For any given transaction, SPI implements one-master and multi-slave communication. In this disclosure, “slave” and “slave device” are used interchangeably while “master” and “master device” are used interchangeably.


The SPI bus implements four logic signals: SCLK: Serial Clock (output from master); MOSI: Master Out Slave In (data output from master); MISO: Master In Slave Out (data output from slave); CS/SS: Chip/Slave Select (often active low, output from master to indicate that data is being sent). MOSI on a master connects to MOSI on a slave. MISO on a master connects to MISO on a slave. Slave Select has the same functionality as chip select and is implemented instead of an addressing concept. On a slave-only device, for example, MOSI may be labeled as SDI (Serial Data In) and MISO may be labeled, for example, as SDO (Serial Data Out).


The signal names above can be implemented to label both the master and the slave device pins as well as the signal lines between them. Pin names are always capitalized, for example, “Chip Select,” not “chip select.”


To begin communication, for example, the bus master configures the clock, using a frequency supported by the slave devices, which is typically up to a few MHz. The master then selects the slave device with a logic level 0 on the select line. If a waiting period is required, such as for an analog-to-digital conversion, the master wait for at least that period of time before issuing clock cycles.


During each SPI clock cycle, a full-duplex data transmission occurs. The master sends a bit on the MOSI line and the slave reads it, while the slave sends a bit on the MISO line and the master reads it. This sequence is maintained even when only one-directional data transfer is intended.


Transmissions usually involve two shift registers of certain given word-size, such as eight bits, one in the master and one in the slave; they are connected in a virtual ring topology. Data is usually shifted out with the most significant bit first. On the clock edge, both master and slave shift out a bit and output it on the transmission line to the counterpart. On the next clock edge, at each receiver the bit is sampled from the transmission line and set as a new least-significant bit of the shift register. After the register bits have been shifted out and in, the master and slave have exchanged register values. If more data needs to be exchanged, the shift registers are reloaded and the process is repeated. Transmission may continue for any number of clock cycles. When complete, the master stops toggling the clock signal, and typically deselects the slave.


Transmissions often carried out using eight-bit words. Other word-sizes are also common, however, for example, sixteen-bit words for touch-screen controllers or audio codecs, or twelve-bit words for many digital-to-analog or analog-to-digital converters. Multiple SPI devices may also be daisy-chained to conserve pins.


Every slave on the bus that has not been activated using its chip select line must disregard the input clock and MOSI signals and should not drive MISO, which means it must have a tristate output, although some devices need external tristate buffers to implement this.



FIG. 1 illustrates a parallel interface and a serial interface. FIG. 2 illustrates an SPI normal connection configuration 2000, which is a typical SPI bus configuration, or a SPI normal connection, with one master 2100, and three slaves 2200, 2300 and 2400. In the configuration 2000, the SCLK of the SPI master 2100 is connected simultaneously to the SCLK of the first SPI slave 2200, the SCLK of the second SPI slave 2300 and the SCLK of the third SPI slave 2400 in parallel; the MOSI of the SPI master 2100 is connected simultaneously to the MOSI of the first SPI slave 2200, the MOSI of the second SPI slave 2300 and the MOSI of the third SPI slave 2400 in parallel; the MISO of the first SPI slave 2200, the MISO of the second SPI slave 2300 and the MISO of the third SPI slave 2400 are simultaneously connected to the MISO of the SPI master 2100 in parallel. The CS1 of the SPI master 2100 is connected to the CS of the first SPI slave 2200, the CS2 of the SPI master 2100 is connected to the CS of the second SPI slave 2300 and the CS3 of the SPI master 2100 is connected to the CS of the third SPI slave 2400.


In the independent slave configuration, there is an independent chip select


CS line for each slave, which is the way SPI is normally used. The master asserts only one chip select CS at a time.



FIG. 3 illustrates an SPI daisy chain connection. The configuration 3000 is a daisy chain configuration having one master 3100 and three cooperative slaves 3200, 3300 and 3400. In the configuration 3000, the SCLK of the SPI master 3100 is connected simultaneously to the SCLK of the first SPI slave 3200, the SCLK of the second SPI slave 3300 and the SCLK of the third SPI slave 3400 in parallel. The MOSI and MISO of the master and three slaves are connected in a daisy chain configuration, for example, the MOSI of the SPI master 3100 is connected to the MOSI of the first SPI slave 3200, while the MISO of the first SPI slave 3200 is connected to the MOSI of the second SPI slave 3300, then the MISO of the second SPI slave 3300 is connected to the MOSI of the third SPI slave 3400, then the MISO of the third SPI slave is connected back to the MISO of the SPI master 3100, completing the daisy chain starting from the master through the three slaves and back to the master. The CS of the SPI master 3100 is simultaneously connected to the CS of the first SPI slave 3200, the CS of the second SPI slave 3300 and the CS of the third slave 3400.


The SPI port of each slave is configured to send out during the second group of clock-pulses an exact copy of the data it received during the first group of clock pulses.


The whole chain acts as a communication shift register; daisy chaining is often implemented with shift registers to provide a bank of inputs or outputs through the SPI. Each slave copies input to output in the next clock cycle until active low CS line goes high. Such a feature only requires a single CS line from the master, rather than a separate CS line for each slave as illustrated in FIG. 2 above.



FIG. 4 illustrates an exemplary timing and data packet of a packet in SPI daisy chain connection. In FIG. 4, 4100 is the clock, 4200 is CS, or chip select signal, and 4300 is an example of MOSI data structure, with the first 7 bits as the target slave address, the next bit as W/R, where 0 is write and 1 is read, with register address and data byte stored in the rest of the data.


Each Slave device has its own and unique address so that it can recognize whether the data it receives is intended for itself. One way to accomplish this is to require Slave devices to be equipped with address pins for hard wiring, which increases cost.


In the parallel configuration in FIG. 2, for example, the address of the first slave 2200 is address#1, the address of the second slave 2300 is address#2, the address of the third slave is address#3, and if the target slave address field in the MOSI 4300 is address#1, then the data in the MOSI 4300 will be received by the first slave 2200. Similarly, referring back to FIG. 4, if the target slave address field in the MOSI 4300 is address#2, then the data in the MOSI 4300 will be received by the second slave 2300, and if the target slave address field in the MOSI 4300 is address#3, then the data in the MOSI 4300 will be received by the third slave 2400. For example, if address#1 is 000, address#2 is 001, address#3 is 010, and if the target slave address in 4300 is 001, then the data in 4300 will be received by the second slave 2300. Similarly, if the target slave address is 010, the data in 4300 will be received by the third slave 2400.



FIG. 5 illustrates an example of how to program slave addresses in all slaves in SPI daisy chain connection that is known. As shown in FIG. 5, the salve device is identified by adding one more field in the “data packet,” hereby named “chain field.” In one aspect, the “chain field” from Master will be set as “0×00”. When the data packet pass through Slave device, the “chain field” will be increased by “1” and pushed to SDO.


The Slave device compares the “chain field” with the “Target Slave address field.” If the addresses match, the slave device is the target for the “data packet.” Although this method can identify the target slave device, the additional “chain field” occupies additional bandwidth.


Referring again to FIG. 5, 5100 is the clock and 5200 is the CS. The MOSI 5300 implements an additional chain field after the 7-bit target slave address and one bit W/R. The chain field is followed by the register address and data byte. In the daisy chain configuration, when MOSI is transmitted to the first slave device, it is shifted to the right. For example, MOSI/SDI_05400 is shifted to the right to become SDO_0/SDI_15500, and which is then shifted to become SDO_1/SDI_2, as illustrated in FIG. 5. In this example, the 7-bit target slave address is 0×02, and the chain field is 0×00. During the shifting, the chain field is compared to the target slave address, once there is a match between the chain field and the target slave address, the target salve device is located, to which data is transmitted. As discussed above, the additional “chain field” occupies additional bandwidth and is a waste of resource.


The data in the daisy chain configuration in FIG. 3 is transmitted differently. For example, the target slave address in 5300 is address#3 and the chain field in 5300 is address#1, then the MOSI 5300 is transmitted to the first slave 3200 from the master 3100, following the daisy chain in FIG. 3, when the data MOSI/SDI_05400 transmitted from the first slave 3300, the chain field is incremented and becomes address #2, then a comparison is conducted between the target slave address and the chain field address. If there is a match, then the target slave is located. Otherwise, the data is transmitted to the next slave in the daisy chain until a match is found and the target slave is located. For example, SDO_0/SDI_15500 is transmitted to the next slave 3400, and the chain field is further incremented to become address #3 which matches the target slave address address#3, then the target slave is located and it is the third slave 3400. For example, the chain field is 000, the target slave address is 002, address#1 is 000, address#2 is 001 and address#3 is 002, then when SDO_0/SDI_1 comes out of the first slave, the chain field 000 is incremented by 1 to become 001, and SDO_0/SDI_1 is transmitted to the second slave 3300. When it comes out of the second slave 3300, the chain field 001 is incremented by 1 again to become 002. When it is transmitted to the third slave 3444, a comparison between the chain field and the target slave address field is conducted and a match is found, which means the data is meant for the third slave 3400. In the above implementation, the extra data field chain field is needed, which occupies additional storage and bandwidth. It is the goal of the present disclosure to avoid such an additional chain field to save storage and bandwidth.



FIGS. 6-8 illustrate a first embodiment of the methods in this disclosure, in which all slave devices can be assigned its own unique address, and the master can control the slave devices as if the slaves were hard wired at their respective address pins.


According to the table in FIG. 6, 0×FF in the “Target Slave Address” field (byte #1) defines a command that is broadcasted to all the slave devices in the daisy chain. The “Register” field (byte #2) defines the specific location where the Slave Address for this slave device is stored. The “Slave Address” field (byte #3) is filled with the first Slave address in daisy chain.


In FIG. 7, 7100 is the clock signal, chip select CS is 7200, and MOSI 7300 includes the first 7-bit as Slave Address, the next bit W/R, followed by register Address and Start Address. For example, 7400 MOSI/SDI_0 includes the first 7-bit Slave Address 111_111, followed by the next bit 0 which is W, followed by register address 0×FF and then start address 0×00 for slave #18100. In the daisy chain configuration, MOSI/SDI_0 is transmitted to the next slave and thus shifted to the right to become SDO_0/SDI_1. The default increment is 1, the start address 0×00 is incremented by 1 to become 0×01 in slave #28200. SDO_0/SDI_1 is further shifted to the right to become SDO_1/SDI_2, the start address 0×01 is incremented by 1 to become 0×02 in slave #38300. FIG. 8 illustrates the same process in a different way, in which SPI Chain starts at 0×00 and has an increment of 0×01.


In order to avoid using the chain field, a “programing address”, or “address programming”, operation is conducted on all slave devices to initialize, or program, the salve device. This “programming address” only needs to be done once upon power on. For example, an address is stored in the “register address” field of 7300 upon initialization when the salve devices are powered on. For example, at the address 0×FF of the first slave device 3200, address#1 is stored, at the address 0×FF of the second slave device 3300, address#2 is stored, at the address 0×FF of the third slave device 3400, address#3 is stored, the starting address. The slave addresses address#1, address#2 and address#3 are programmed and stored in the slave addresses in the corresponding slave devices.


When conducting programming address operation, address#1 is stored at the 0×FF address in the first slave 3200, then address#1 is incremented to become address#2 to be transmitted to the next slave 3300, then address#2 is stored at the address 0×ff of the second slave 3300. Then again address#2 is incremented to become address#3 to be transmitted to the third slave 3400, and address#3 is stored at 0×FF of the third slave 3400. For example, address#1 is 000, 000 is stored at 0×FF of the first slave 3200, then 000 is incremented by 1 to become 001 and is transmitted to the second slave 3300, and 001 is stored at 0×FF of the second slave 3300. Then 001 is further incremented by 1 to become 002 to be transmitted to the third slave 3400, and 002 is stored at 0×FF of the third slave 3400. As such, the chain field is no longer needed in the daisy chain configuration in subsequent transmissions, only the target field is needed, thus saving storage and bandwidth.


As shown in FIGS. 7 and 8, when the slave device receives the data packet and recognizes the data packet is for programming the slave address, it stores the “slave address” (byte #3) into register at the location defined in Register field (Byte #2). In the meantime, the slave address (byte #3) will be increased by “1” and pushed to SDO. In normal operations, after all slave devices have been programmed and assigned their corresponding slave addresses (i.e., address#1, address#2 and address#3), the first field in the data packet is “target slave address”, which conducts the read and write operation for the corresponding slave device. The LSB (least significant bit) of the target slave address field defines the read/write operation. The slave device which receives the “target slave address” compares the received target slave address with the stored slave device address to check whether there is a match. If there is a match, the read/write operation is executed. When the “target slave address” matches, however, the predefined broast address, the read/write operation is executed in all the slave devices.



FIGS. 9-13 illustrate the second embodiment in the methods of disclosure. Compared with the first embodiment, the second embodiment employs one more field—the “Increment” field (byte #3), which defines the increment of the Slave Address. The “Increment” field and “Slave Address” enable the system to assign multiple Slave chains having different addresses. According to FIGS. 10-11, in first chain (SPI Chain 1), the increment is 0×02 and initial slave address is 0×00. According to FIGS. 12-13, In the second chain (SPI Chain 2), the increment is 0×02 and the initial Slave address is 0×01. Therefore, the Slave addresses in SPI Chain 1 are 0×00, 0×02, 0×04, . . . , etc., while the Slave addresses in SPI Chain 2 become 0×01, 0×03, 0×05, . . . , etc. The increment can be adjusted to accommodate more than two SPI chains.



FIG. 10 illustrates an example of how to program all slave addresses for all slaves. Signal 10100 is the clock, chip select CS is 10200, and MOSI 10300 includes the first 7-bit as Slave Address, the next bit W/R, followed by register Address and Start Address. For example, 10400 MOSI/SDI_0 includes the first 7-bit Slave Address 1111111, followed by the next bit 0 which is W, followed by register address 0×FF and then start address 0×02 for slave #111100. In the daisy chain configuration, MOSI/SDI_0 is transmitted to the next slave and thus shifted to the right to become SDO_0/SDI_1, as illustrated in FIG. 10, the increment is 2, the start address 0×00 is incremented by 2 to become 0×02 in slave #211200. SDO_0/SDI_1 is further shifted to the right to become SDO_1/SDI_2, the start address 0×02 is incremented by 2 to become 0×04 in slave #311300.


In the address programming operation, the first field is a “predefined broadcast address”, and the LSB defines a “write” operation. Another field defines the location (for example, 0×FF) in the storage for storing the “slave address” (for example, address#1). The location can be the address of a register, or the address in the memory in the salve device. This field becomes optional when the “location” is predefined. The “increment” is defined in another field for the slave address, and again, if the increment is predefined, this “increment” is optional. Another field defines “start address” for MOSI which is the master output and the slave input. Another field defines the “increment address” for the output of the slave devices.


In the address programming operation, if the slave device confirms that the packet is for programming slave address operation, the first slave device stores the “slave address” in the “location” (for example, 0×FF) in the first slave device. And the “start address” is incremented by the “increment value” to become the incremented address, which is transmitted to the second slave device. The same operation is conducted when the packet is transmitted from the second slave device to the third slave device, and so on.


In the address programming operation, once the salve device (other than the first slave device) confirms that the packet is for programming slave address purpose, the slave device stores the “incremented address” in the “location” and add the “increment value” to the “incremented address” to obtain the updated “incremented address”.



FIG. 11 illustrates an example in which SPI Chain 1 starts at 0×01 and has an increment of 0×02. The register values of slave #111100, slave #211200 and slave #311300 are illustrated corresponding to the illustration in FIG. 10.


Referring to FIG. 12, the start address can be 0×01 instead of 0×00 shown in FIG. 10. The start address of 12400 is 0×01 in MOSI/SDI_0, which is shifted to the right and incremented by 2 to become 0×03 in 12500 SDO_0/SDI_1, which is further shifted to the right and incremented by 2 to become 0×05 in 12600 SDO_1/SDI_2.



FIG. 13 illustrates an example in which SPI Chain 2 starts at 0×01 and has an increment of 0×02. The register values of slave #113100, slave #213200 and slave #313300 are illustrated corresponding to the illustration in FIG. 12.


Variations of the above embodiments are numerous. The scope of protection is not limited to the embodiments described herein. The scope of protection is only limited by the claims. The scope of the claims shall include all equivalents of the subject matter of the claims.

Claims
  • 1. A method for programming and controlling of a plurality of slave devices serially connected in a daisy chain configuration using a master device, the method comprising: assigning a unique slave address to each slave device in the plurality of slave devices by sending an initialization data packet from the master device serially through the plurality of slave devices;storing, in each slave device, the assigned slave address;defining a data packet, wherein the data packet comprises a target slave address, a read/write command, a register address, an increment value, and a start address; andtransmitting the data packet serially to one or more of the plurality of slave devices until the target address in the data packet matches the slave address stored in one of the plurality of slave devices.
  • 2. The method of claim 1, wherein the initialization data packet comprises a slave address for each slave device and a location on each slave device in which the slave address is stored.
  • 3. The method of claim 1, comprising:
  • 4. transmitting, from the master device, the data packet to a first slave device in the plurality of slave devices;
  • 5. comparing the target slave address in the slave address stored in the first slave device; when the target slave address and the slave address stored in the first slave device matches, reporting to the master device; or when the target slave address and the slave address stored in the first slave device does not match, updating the data packet and transmitting the updated data packet to a second slave device in the plurality of slave devices,wherein updating the data packet comprises updating the start address by adding to the current start address the increment value.
  • 6. The method of claim 2, further comprises: comparing the incremented start address with the target slave address; anddetermining that a slave device is selected when the incremented start address matches the slave device having the target slave address.
  • 7. The method of claim 3, further comprises: the second slave device transmitting the data packet to the third slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by the predetermined increment value.
  • 8. The method of claim 4, further comprises: comparing the incremented start address with the target slave address; and determining that a slave device is selected when the incremented start address matches the slave device having the target slave address.
  • 9. The method of claim 2, wherein the increment value is determined by at least of a number of the plurality of slave devices in the daisy chain.
  • 10. The method of claim 2, wherein the increment value is determined by at least a number of bits in the target address of the slave device in the daisy chain.
  • 11. The method of claim 5, wherein the data packet comprises at least configuration information of the master device, the slave devices and the daisy chain.
  • 12. The method of claim 1, wherein the address programming further comprises: storing the corresponding salve address at a pre-determined register address defined by the data packet.
  • 13. The method of claim 1, wherein the address programming is conducted when the daisy chain is powered on.
  • 14. A method for programming and controlling of a plurality of slave devices by a master device, the method comprising: deploying the plurality of slave devices and the master device in a daisy chain configuration by connecting the master device to a first of the plurality of slave devices, serially connecting the plurality of slave devices, connecting a last slave device back to the master device to form a daisy chain;defining a data structure, wherein the data packet comprises a target slave address, a read/write bit, a register address and a start address;the master device transmitting the data packet to the first slave device of the plurality of devices; andthe first slave device transmitting the data packet to the second slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by a predetermined increment value.
  • 15. The method of claim 12, further comprises: comparing the incremented start address with the target slave address to determinewhether a slave device is selected.
  • 16. The method of claim 13, further comprises: the second slave device transmitting the data packet to the third slave device in the plurality of slave devices by shifting the data packet and incrementing the start address by the predetermined increment value.
  • 17. The method of claim 14, further comprises: comparing the incremented start address with the target slave address to determine whether a slave device is selected.
RELATED APPLICATIONS

This application claims the benefit of priority under 35 U.S.C. § 119 to U.S. Provisional Application No. 63/124,494, filed on Dec. 11, 2020, the entire contents of which are incorporated herein by reference.

Provisional Applications (1)
Number Date Country
63124494 Dec 2020 US