Shop OBEX P1 Docs P2 Docs Learn Events
SPI boards — Parallax Forums

SPI boards

Dr_AculaDr_Acula Posts: 5,484
edited 2011-02-02 23:19 in Propeller 1
I was wondering if anyone knows of a generic SPI board?

As I understand it, I2C has the device ID internal to the chip. But SPI uses a "chip select" line. So any bus system you might think about needs to have some sort of decoder to decode all the chip selects.

There are so many cool SPI chips I'd love to add to the Propeller, but only so much room on a board. So... why not add them all with a series of boards you can mix and match?

Take 6 lines from a propeller board. 3V,0V, SO, SI, Clk and CS. Possibly the reset line as well.

I started with this page of Microchip products http://www.futurlec.com/ICSFMicrochip.shtml and found this SPI I/O expander for $1.35 that gives you 16 lines http://www.futurlec.com/SFMicrochip/MCP23017.shtml

We could call this the SPI motherboard. In the interests of keeping the fast signal lines short, I'd probably put an SD card on the motherboard and make that permanently device zero.

Now take the 15 chip select lines, plus 3V 0V SO SI and Clk and that makes 20 lines. Use a 20 way ribbon cable header to jump to the next board, OR use an Arduino shield arrangement with 10 pins on each side of a board. It does not matter. Indeed, you could do both on the PCB and install the one you prefer.

Keep each board a standard size, eg credit card or maybe even half credit card.

Each board has some old-school headers 15x2 and you just put a jumper across one of 15 pins to select which chip select this board is. No complex programming needed. No potential conflicts (anyone remember 'plug and pray'?)

And then create a range of boards with various SPI chips.
23K256 ram chips.
Analog to digital
Digital to analog
Digital pots
Real time clock

etc etc


I'm thinking that one person might want lots of analog input and output. But another person might just want lots and lots of memory.

I had a quick look on google but couldn't find anything like this. Would such boards be useful?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-02 17:23
    You could certainly do it. Whether they would be useful is another question. SPI is quite different from I2C. It's much faster, but there's tremendous variation in how these chips can be wired, how they're controlled, etc. There are a variety of ways for multi-bit serial I/O to be done. The RAM and Flash chips these days provide for reading 2 bits and even 4 bits at a time, all called SPI. Some chips require a separate input and output bus while others allow these to be combined. The "bottom line" is that you have to look at the chip documentation in detail to see whether two different chips can be combined. It's not enough to know that they're called SPI chips.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-02 17:55
    Good points Mike. Ok, so maybe keep it to chips that have CS, DO, DI and Clk. No combined DO/DI and no multiple bits at the same time. That still seems to include a lot of chips. I've ordered some today and I'll test out the idea.
  • TubularTubular Posts: 4,717
    edited 2011-02-02 22:00
    Drac,
    Why not follow the C3 SPI select guidelines? You'd need a 7 line bus - 3v, 0v, SO, SI, CLK, SPI_SEL_CLK and SPI_SEL_CLR.
    The advantages are it would be compatible with C3, and you'll never run out of SPI selects!
    You could design boards to stack on the existing C3 connector. I've already raised with Ken that we need a RTC add on C3 board
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-02-02 22:38
    I've got a board with SPI expansion like that in the works; with five expansion headers. I'll release more information once it is closer to launch; I am not going to make the same mistake as last year and talk about boards that I can't show yet.

    I got the PCB a couple of months after last UPEW, and I should have production boards before this UPEW. This board uses less pins than the C3 to provide 8 SPI devices :)

    On PropCade I used a seven pin SPI setup - 3 bits for SPI device selection, /CS, CLK, MOSI, MISO - the main advantage of this approach is that it is 99% compatible with existing stand-alone SPI objects.

    Dr_Acula: Due to fanout issues (mostly capacitance) I would not put more than 8 SPI devices on one SPI bus - not if I want to run them at a high speed anyway.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-02 23:04
    Some great ideas - thanks!

    Regarding fanout and capacitance, only one SPI device will be enabled at any one time. But the longer the wires, the higher the capacitance. That might lead to a design with stackable PCBs rather than connecting them with headers and ribbon cable. I wonder how long the lines need to be before you have to think about terminating resistors to prevent reflection etc?
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-02-02 23:19
    I would also be careful not to put any length of cable on the SD bus. It has already been noted that this is fragile and we are probably pushing the limits here with a lot of access.
    However, the concept is great. Don't forget to add a pin before the 3v3, gnd, xxxxx sequence in case 5V is required. Unfortunately, I fear that there may be some incompatible pin headers but a short cable will solve the problem. There was a pinout discussion a couple of months ago for normal expansions (10/11/12 pins) and others were discussed also.

    The better RTC seems to be the DS1302 (vs DS1307) but it's neither SPI or I2C. However, a supercap can be used. I noted that Sieko produce much cheaper ones, but they seem quite a bit more complex to drive.
Sign In or Register to comment.