uC with multiple daisy-chained Slave devices

Status
Not open for further replies.

electroRF

Member
Hi,
I have a question on the following circuit below (taken from https://www.maximintegrated.com/app-notes/index.mvp/id/3947)

It says there that for this circuit to work, the following conditions must be satisfied - it is condition #2 that I don't understand.

Could you please help me understand condition #2?

1. For daisy-chaining to work successfully, the slave must be able to input a command at DIN during a given command-cycle (defined by the number of clock pulses required to clock in one command), and output the same command at DOUT during the subsequent command-cycle. Stated simply, there is a DIN-to-DOUT delay of one command-cycle.

2. The slave must, moreover, only execute the command written to it on the rising edge of active-low CS.
This means that as long as active-low CS remains low, the slave ignores the command and outputs it at DOUT on the following command-cycle.
If active-low CS goes high after a given command-cycle, all slaves execute the commands just written to their respective DIN inputs.
If active-low CS goes high, data is not output at DOUT.
This process makes it possible for every slave in the chain to execute a different command.

* As long as these daisy-chain requirements are satisfied, the microcontroller only needs three signals (active-low SS, SCK, and MOSI) to control all the slaves in the network.



Thank you very much!
 
I dont know for shure but there seems to be a typo in #2.
 
I don't see what is wrong.
There is a shift register from Din to Dout. Often 8 to 16 bits long.
If CS=1 there is no shifting.
If CS=0 data is shifted with every clock. (and the slave does not respond to the data)
On CS rising edge the slave does something based on the data/command that is in its shift register. (does not know about the data that passed through many clocks ago that is now down stream)
 
Oh I see.
Thank you very much Ron and 4P.

So, these are "speical" slaves, in the sense that when nCS = 0, they take the DIN data that they received in this cycle, and shift it to DOUT in the next cycle, and when nCS goes High, they actually act like normal slave and perform the command that appeared in Din.
 
They are not "special". This is how slaves work.
example: if the slave is 8 bit it only stores the last 8 bits and anything before that is forgotten.
 
I disagree with you.

You can work with a slave with nCS connected to gnd, and it will still perform its commands.
 
So how much distance do you think you could put between slave shift registers with out line drivers?
10 feet? 100 feet?
 
example please
Hi,
I read the SPI Protocol, and it was mentioned in one tutorial that I read that if you work with only one master and one slave, you don't really need to connect the nCS line of the Slave to I/O port, but you can connect it directly to Ground.

However, it is recommended for cases when the Slave is stuck so you can init it.

--EDIT (for addition)
The nCS line tells (when LOW) the salve to listen to the Master on the DATA-IN line.
when its HIGH, the slave does not listen to the Master.

So when it's LOW, it listens AND performs commands that are written to it in the Data-IN line.
 
Last edited:
So when it's LOW, it listens AND performs commands that are written to it in the Data-IN line.
It listens to the data/command, I don't see how it knows when the command is finished.
example: data is 8 long, so there are 8 clocks. The slave does not know if it is the first or last slave. How does it know, now is the time to do something with the command/data.

Find a part that works that way. There must be I just don't know of one.
 
Hi Ron,
I understand what you're saying, but I think it's incorrect.

Say that the command is 0x FE-4A

You can send it this way:
nCS Low -> Send 0xFE -> nCS High -> nCS Low -> 0x-4A -> nCS High

And the slave would know that the command was 0xFE-4A, and not stand-alone 0xFE or stand alone 0x4A


Additionally, how do you explain it that it doesn't say in the protocol that you must set nCS from LOW to HIGH after sending a command?


----Edition
see quote from Wiki:
"If a single slave device is used, the SS pin may be fixed to logic low if the slave permits it. Some slaves require a falling edge of the chip select signal to initiate an action, an example is the Maxim MAX1242 ADC, which starts conversion on a high→low transition."
 
Last edited:
Again: please indicate what device does that. What part can operate with out SS.
I can send 100s of data sheets saying SS rising edge indicates "go" do the command.
You probably can find one. I can't.

Maybe we should stop this and agree that many parts need CS or SS and some parts don't.
 
Hi Ron,

i think I got you.

Could you please share one datasheet for example?

Say that you got a device that has a command that composed of 3 bytes: 0xFE-4A-5D
(for example, this commands tells a SPI Slave GLCD to draw a line).

Would you set the nCS from HIGH to LOW before 0xFE and from HIGH to LOW after 0x5D?
Or would you also toggle it between 0xFE and 0x4A and 0x5D?
 
OK,
The ADCs, DACs, port expander, and all simple parts need CS rising edge.
The title of this thread has the word "slave". All parts I have searched that are slave-able need CS rising edge. I assumed, by your examples, we are talking daisy-chain.

My challenge is to find a part that can be operated with out CS.
Attached is a RAM part that can operate the way you say. (+/-) It can not be daisy-chained!
 

Attachments

  • 25156A.pdf
    586.5 KB · Views: 288
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…