This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What are daisy-chain commands doing? (PGA112, PGA113, PGA116, PGA117)

Other Parts Discussed in Thread: PGA116, PGA117, PGA112, PGA113

Hello alltogether,

I don't understand what the daisy-chain commands of PGA112, PGA113, PGA116, and PGA117 are for.

What happens if I use them on a single device?

What happens if I use non-daisy-chain commands on two (or more) daisy chained devices?

I'm referring to table 3 & 4 (p. 27) of PGA112, PGA113, PGA116, PGA117 datasheet
named SBOS424B–MARCH 2008–REVISED SEPTEMBER 2008.

Thanks for every hint – Peter

  • Hello Peter,

    The Daisy-Chain commands for the PGA116-117 are used to allow the designer to connect multiple PGA116-PGA117 devices on the same SPI bus without having to use a dedicated /CS signal for each device.  On a typical SPI bus with multiple devices, all SCLK, DIN, and DOUT signals on the bus are connected together and shared for each device.  Then to select which device a command will get sent to each device will get its own /CS signal and only one /CS will go low a time on the bus signalling the selected device to receive and transmit on the bus.  Therefore on a typical SPI bus you will have 3 wires plus 1 wire for every device on the bus.  With multiple PGA116/117 devices on an SPI bus, only 4 wires (SCLK, DIN, DOUT, /CS) are used regardless of the number of devices on the bus because of the daisy-chain feature. 

    Daisy chain commands are generally not used with the PGA112/113 because the DIN and DOUT lines of the PGA116-117 are tied together and called DIO on the PGA112/113 and would only allow for one-directional communication.  However,  this configuration is described in Figure 62 on page 21 of the datasheet. 

    If you don't intend to have more than one PGA116/117 on the bus then you don't need to worry about the daisy-chain commands and should simply communicate with the device as described outside of the daisy-chain section of the datasheet.  Also, if you don't want to use the daisy-chain configuration you can still run individual /CS signals to each PGA116/117 on the bus and treat it like a normal SPI bus.

    So to directly answer your questions, see below:

    What happens if I use them on a single device?
    Daisy-chain commands shouldn't be issued if there is only one PGA116/117 on the bus.  If used on a single device, you will likely experience undesirable effects because the DOUT signal of the single device will behave the same as the first of the two devices as shown in the timing diagrams in images 65-67.  Unless your controller is expecting the device to behave as shown in the daisy-chain timing diagrams then the communication will fail. 

    What happens if I use non-daisy-chain commands on two (or more) daisy chained devices?
    This is also undesirable because you will not be able to communicate with any device but the first in the chain if you don't use the daisy-chain commands.  You would only be able to write to the first device and not read from it because the read function would require the other devices in the chain to pass the information to the next device in the chain. 

    Regards,
    Collin Wells
    Precision Linear Applications

  • Hello,

    thanks, Collin, for your detailed description. Maybe im blind, but I didn't get the point, even after prolonged staring to fig. 65…67.

    As far as I understood, every PGA got a 16 bit shift register. Bits clocked in will appear after 16 clocks at the output, and, in case of daisy chaining, will be clocked into the next device. The PGA look out for the contents of shift register only on edges of the /CS signal. In case of read (ref. fig. 66/67) of two devices it will take 32 clocks to input both read commands into both PGAs. After cycling the /CS line, both PGAs have processed the commands and loaded their answers into their shift registers. Now it will take another 32 clocks to shift out both 16-bit-answers (consisting of 2 times 8 bits of payload and 2 times 8 bits of zeros in this example).

    I don't get the difference of behaviour of DOUT of first device compared to DOUT in fig. 64, as stated by Collin. (Except that the leading zeros of the answer are explicitly painted by the lo-graph of the oscilloscope-like diagram on fig. 64, opposed to the eye-pattern representation of the zeros in fig. 66…67 – but that's a difference mere in illustration, I think.)

    In order to not fail, what behaviour does the controller has to expect exactly, when Collin says "unless your controller is expecting…"?

    Sorry, my project isn't in a stage where I can just connect a scope to look for an answer on its screen.

    Thanks – Peter

  • Hello Peter,

    I'm still not clear on whether or not you're trying to use the daisy-chain feature to communicate to multiple devices or if you're trying to avoid having issues communicating with a single device because of the daisy-chain commands.  Do you have more than one PGA116/117 in your system and are you trying to daisy-chain them?

    I'm really not sure about your question, but your understanding of the daisy-chain operation seems correct.  The single-device read in Figure 64 shows 16-bits clocked into the device and 16-bits of data clocked out.  Figures 66 & 67 show the daisy-chain read and 32-bits clocked into the first device which causes it to output the first 16-bits to the second device on the second 16 clocks.  Then once the /CS is cycled, on the next 16 clocks both the 1st and 2nd device output their data.  Since the output of the 1st device is fed into the 2nd device, on the second 16 clocks the 2nd device outputs the 1st device's data. 

    These are quite different situations and my point was that if you're controller is intending to communicate on a 16-bit protocol then it will likely fail to read correctly on a 32-bit protocol because everything would be left-justified and your 16 LSBs would be blank instead of your 16 MSBs. 

    Perhaps you could be a little more clear about what you're worried about or what you're trying to achieve and we can help more.

    Regards,
    Collin Wells
    Precision Linear Applications 

  • Dear Collin, hello everybody,

    in my system there is just one PGA, actually one PGA112, so there's no daisy chaining possible at all, firstly because there's just one IO pin, secondly because there's aren't two devices. Therefore I think I'm fine if I just used the non-daisy-chain commands. The point is just my curiosity; the will to understand the things I'm twiddling with. Especially because I got a feeling that the datasheet is somewhat ambiguous regarding description of the SPI.

    So initially I hoped that I'll get the point if I know what will fail if the wrong combinations (no daisy chain exist/daisy chain command used; daisy chain exists/simple command used) are applied.

    I've never heard before that there are special daisy-chaining commands on other SPI devices – provided that there are separated input and output pins and a continous shift register between them, all of them interconnected in a sensible manner, it will result just in an equivalent of a very long single SPI device. The rest will be done by software's savvy. But also, the PGA ist the first device I've seen which is available with full duplex DIn/DOut (like MOSI/MISO) as well as combined half duplex DIO. In addition, if I imagine that 2 channel and 10 channel PGAs are the same piece of silicon just in different cases, there is a suspicion that slowly arouses: Does both facts correlate? Does the state of D12 (which is the only difference between any daisy chain command and the corresponding simple command) has something to do with preparing the bidirectional DIO-mode of PGA112/113's single data line?

    As stated, just curiosity…

    Thanks – Peter

  • Hi Peter,

    You are correct, if you have the PGA112 then you should not use daisy-chain commands.  You are also correct that the single-device read and a daisy-chain read commands are only one bit different, 0x6A vs. 0x7A.  However, unless you violate timing specifications under no case should you have an issue with the PGA112 receiving the single-device (0x6A) read instead of the daisy-chain command (0x7A). 

    Also, I think you may have some confusion regarding the PGA112/113 vs. the PGA116/117.  These are different products and although they are similar in some ways, they are different in several other ways including the digital input/output structure which is discussed in detail in the datasheet.  Both devices can accept single-device read/write commands but only the PGA116/117 devices will react to the daisy-chain read command.  As discussed in Figure 62 you can use the PGA112 at the end of the daisy-chain but you will not be able to perform any reads because the PGA112 does not have a separate DOUT line to communicate back to the main controller with.

    Hope this helps,
    Collin Wells
    Precision Linear Applications