Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Help understanding daisy chain SPI interface.

Status
Not open for further replies.

brahoule

Newbie level 5
Joined
Nov 7, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,328
I try to understand how to use multiple SPI devices on a PIC18F4550.
I have read on the daisy chain using different chip select all on the same SPI BUS but i cant find any detail on how the data travel...

Example;
If i use a SD card as a data logger using the SPI and a EEPROM as a LCD buffer also SPI.
Can i use them simultaneously or i need to wait the previous chip select before sending another?
If the LCD buffer write and read all the time at full speed did i need to stop my buffer to send data to the SD card?
 

It may be different on some devices but the general principle is you feed the first device in the chain, it's output feeds the next in the chain and so on. If you have two 8-bit devices chained together and you want to send data to the second one, you have to clock 16 bits out. The first 8 clocks fill the first device and the next 8 clocks move them out of that device and into the second one. You rely on the SPI devices not latching their shift register contents until the select pin tells it to, so you first align the data along the chain with the destination device then raise/lower it's select pin to tell it the data is there to be read. You obviously need a select line to each device to do this. The alternative is to parallel all the clock and data pins along the chain so they all see the same data but the individual select lines ensure only one device accepts it. So answering your question, in a serial chain it is possible to align the data for several devices at the same time and select them all simultaneously but it's rare to do that, in a more normal situation, regardless of which connection method you use, only one device at a time would be selected.

Brian.
 
It may be different on some devices but the general principle is you feed the first device in the chain, it's output feeds the next in the chain and so on. If you have two 8-bit devices chained together and you want to send data to the second one, you have to clock 16 bits out. The first 8 clocks fill the first device and the next 8 clocks move them out of that device and into the second one. You rely on the SPI devices not latching their shift register contents until the select pin tells it to, so you first align the data along the chain with the destination device then raise/lower it's select pin to tell it the data is there to be read. You obviously need a select line to each device to do this. The alternative is to parallel all the clock and data pins along the chain so they all see the same data but the individual select lines ensure only one device accepts it. So answering your question, in a serial chain it is possible to align the data for several devices at the same time and select them all simultaneously but it's rare to do that, in a more normal situation, regardless of which connection method you use, only one device at a time would be selected.

Brian.

Exactly what i wanted to know.
Thanks a lot Brian!
 

Not sure I understand the question(s). What do you mean 'can I use them simultaneously'? You can write to multiple devices at the same time (each device's chipselect active) but you'll be writing the same data to every enabled device.

What do you mean 'did i need to stop my buffer'?

As a side note, I might question your use of an EEPROM as a buffer. There is a finite number of times you can write to the device (about 1,000,000) before it fails. Don't you really want a RAM?
 

You can write to multiple devices at the same time (each device's chipselect active) but you'll be writing the same data to every enabled device.

This exactly what i was thinking about... but i couldn't find any detail about this. now its more clear.

I might question your use of an EEPROM as a buffer. There is a finite number of times you can write to the device (about 1,000,000) before it fails. Don't you really want a RAM?

Yeah i saw that in the datasheet "10,000,000 ERASE/WRITE cycles guaranteed" but it just for testing the SPI. I have buy some 23K256 SRAM to use for my buffer but i made a mistake because i didn't check the operating voltage... The input /output of my PIC18F4550 is at 5V and the SRAM 2.7 to 3.6V. So i faced the same issue with my SD card, i have try a resistive voltage divider and it worked but really buggy so i used a "Low Voltage Bidirectional Transceiver" and everything was fine. Now i will need more transceiver for my SRAM.
My goal right now is to get multiple SPI devices working together but my knowledge on SPI is a bit limited at this time.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top