Physically connecting SPI chips/busses?
rwgast_logicdesign
Posts: 1,464
So I have not had the pleasure of working with SPI yet, only i2c. The board I am building has a Propeller connected to an mcp3208 and also connected to an AVR chip. I want to set up a bus between the AVR and Prop than can be used as either UART or SPI.
Since the AVR and the ADC are not on the same SPI Bus I am looking to save as many Pins as I can. What I was wondering is can I just make the connections for MISO, MOSI, and SCLK, do I actually need the fourth CS line if there is only one chip on the bus?
As for the mcp3208 I was looking at this page, http://gadgetgangster.com/tutorials/397 over at Gadget Gangster, and they recommend connnecting the DIN and DOUT pins (These are the equivalent of MISO and MOSI correct) togather with a resistor? How does this work? I am assuming you can't just tie miso and mosi together on any old SPI chip?
Since the AVR and the ADC are not on the same SPI Bus I am looking to save as many Pins as I can. What I was wondering is can I just make the connections for MISO, MOSI, and SCLK, do I actually need the fourth CS line if there is only one chip on the bus?
As for the mcp3208 I was looking at this page, http://gadgetgangster.com/tutorials/397 over at Gadget Gangster, and they recommend connnecting the DIN and DOUT pins (These are the equivalent of MISO and MOSI correct) togather with a resistor? How does this work? I am assuming you can't just tie miso and mosi together on any old SPI chip?
Comments
Usually, yes. The CS line is used to signal the start of a read or write. Most, if not all SPI devices need an active CS line.
Yes about Din and Dout being MOSI and MISO. Many SPI chips don't output anything important as a data is written. Some chips output important data at the same time as the data is being sent to the chip. It depends on the chip if you can tie the lines together or not.
The rule of thumb is whether you really need the chip and you don't have enough pins, then you start looking to combine in and out. Why bother if you have enough pins and good code?