SPI boards
Dr_Acula
Posts: 5,484
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?
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
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
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.
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?
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.