Shop OBEX P1 Docs P2 Docs Learn Events
Physically connecting SPI chips/busses? — Parallax Forums

Physically connecting SPI chips/busses?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-04-02 05:26 in General Discussion
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?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-03-31 14:53
    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?

    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.

    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?

    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.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-04-02 05:26
    Don't be too intimidated by various lables. Some SPI chips from different sources use different ones. If the logic Vhi and Vlo are right and you can read the timing diagrams, you can make it work. And in some cases, you can easily combine the input and output pins. There are ways to use diodes and transistors, even logic chips to do this with just about anything.

    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?
Sign In or Register to comment.