Joined: Fri Aug 30, 2002 1:09 am Posts: 8544 Location: Southern California
|
SPI-10, a hobbyist-friendly connector standard, for small SPI modules
This post is to summarize what we settled on in in previous posts regarding the SPI-10 specification, background, and goals. My thanks go to those who contributed above.
Background
SPI is is a four-wire, synchronous-serial interface standard used by hundreds, possibly thousands, of different ICs on the market. The small number of wires reduces layout or assembly time as well as board space, compared to parallel interfaces. All wires are unidirectional, so voltage translation (if necessary) is easy. Possible speeds range from zero to nearly 200Mbps, and gone are the timing requirements of asynchronous serial interfaces like RS-232 (now officially called TIA-232). SPI is trivial to bit-bang with standard I/O ICs used in 65xx computers, or you can use dedicated SPI hardware like Daryl's 65SPI IC or a microcontroller or programmable logic.
However, SPI does not specify a connector. In most situations, there's no need to, assuming the SPI parts are on the same board with the controller and don't go through any connectors, or if they do, the connector might be handling other signals too. In our case, we want to be able to make small modules that plug in, similar to the SD-card idea, and make it easier to share designs and perhaps even hardware in the future, with a connector that's hobbyist-friendly.
Filling a different SPI need, there's our super-flexible 65SIB (6502.org serial interface bus, not to be confused with Daryl's 65SPI IC). 65SIB, which can be as simple or as intelligent as you want it to be, was developed to extend the usefulness of SPI and similar interfaces in several directions at once. 65SIB however, with its 20-pin connectors, ribbon cables, auto addressing, and other features, is intended for connecting multiple pieces of outboard equipment, similar to the IEEE-488 idea, and still leaves a need for something smaller like SPI-10.
Imagine small, plug-in modules for:
- flash memory
- an IR port
- a real-time clock (ie, time-of-day clock, including alarm interrupt output)
- temperature sensor
- ambient light sensor
- SD card
- wireless RF transceiver
etc., all small enough to be mechanically supported by a 2x5 pin header connector that 0.5" long and 0.2" wide. If a cable connecting other things outside the module is acceptable, we can add a lot more to the list:
- analog-to-digital (A/D) converters
- digital-to-analog (D/A)
- keypad
- display
- stepper-motor controller
- servo
- general-purpose I/O
and more. A single-board computer's SPI-10 port can be used to interface all of these (one at a time), and multiple ports could be put on the same SBC.
Goals and characteristics
- Uses common, hobbyist-friendly connectors which go into common perfboard with holes on .100" centers. The pins are .025" square posts.
- capability for 5V devices and lower-voltage devices too such as 3.3V (although one port will usually only work at one voltage)
- keyed, so you cannot plug the module in backwards, or plug a 3.3V (or lower) module into a 5V port
- partial compatibility with UEXT, although SPI-10 will also have attractions UEXT does not. UEXT devices that only use the SPI portion of the UEXT spec can plug into 3.3V SPI-10 ports and operate.
- has one SPI channel (data in, data out, clock, and one select), plus 3 more pins which the slave can optionally use: IRQ\ slave output, RST\ slave input, and an auxiliary function pin (normally an input to the slave)
- The socket goes on the module, since the module will get more handling than the controller board, and pins present more risk of mechanical or static damage. The controller gets the pin header.
- Power is available on the connector, whether 5V or 3.3V.
- Shrouded, keyed pin headers are preferred but not required. If there's a shroud, the keyway in the shroud is necessary for plugging in UEXT devices. Matching PCB-mount sockets are available (Omron part number XG4H-1031, Digi-Key stock number Z5647-ND, shown in a post above) but the main method of keying for SPI-10 modules is pin 3 or 4 of the pin header cut (for 5V or 3.3V respectively) and the corresponding socket hole blocked.
- SPI-10 is not intended to be hot-pluggable, because common, hobbyist-friendly connectors do not give any way to connect the power and ground first when plugging in and disconnect them last when unplugging. However, if necessary, the controller board can bring its output signals low and turn off the power to the SPI-10 port for the purpose of plugging in or unplugging a module without powering down the entire controller board. An LED on the controller board, showing the power-on status of the port, would be good. Modern LEDs only need 1 or 2mA for the job.
Pinout
First, these are the pins needed. They are not in order of pin number. The terms "master" and "controller" are interchangeable. The SPI-10 module is the slave.
- SS\ (slave-select-not module input. The controller brings this low to select the module for SPI transactions. This is the only line that should not be bused with other SPI-10 ports or other SPI ICs.)
- Clock (The controller uses this line to coordinate bit transfers by telling the slave when to sample the MOSI state and when to go to the next MISO bit.)
- MOSI (master-out, slave-in data line)
- MISO (master-in, slave-out data line)
- RST\ (most SPI ICs don't need this, but a few will. Master controls it.)
- IRQ\ (a few SPI ICs will have this IRQ\ open-drain/collector output) Note: "IRQ\" does not necessarily mean it connects directly to your 6502/816's IRQ\ pin. One user asked if it would be ok to connect it to a VIA's CB1 pin. The answer is "Sure, just put a pull-up resistor on it." IRQ\ is common nomenclature for this kind of thing.
- AUX (auxiliary line, whose function will vary among the minority of SPI ICs that use it. Master controls it.)
- Ground
- Power to the module, typically 5V or 3.3V
- (plus one for keying)
Here's the pinout for a 3.3V SPI-10 controller port, looking into the pins. Pin 4 is actually cut or removed so that a 3.3V SPI-10 module that's keyed only by plugging that hole in the socket (as opposed to having a key on the outside of the socket) cannot be plugged in backwards.
Attachment:
textPinout3V3.gif [ 9.81 KiB | Viewed 22085 times ]
An SPI-10 module with hole #4 plugged would not be able to plug into a UEXT controller.
Now for a 5V SPI-10-only port where you wouldn't want to be able to accidentally plug a 3.3V-only part into it:
Attachment:
textPinout5V.gif [ 9.69 KiB | Viewed 22085 times ]
and again a module with hole #3 plugged would not be able to plug into a UEXT controller (where it wouldn't work anyway). 5V versus 3.3V ports have different pins cut (#3 versus #4, respectively). There is probably no danger of damaging anything by plugging a 5V module into a 3.3V port; but the vice-versa is not true.
SS\ above stands for "slave-select not." You might also see CS\ for "chip-select not," and individual ICs may have a pin called CE\ for "chip-enable not." (My apologies—I don't think there's any way to do the overbar in forum posts.)
Pin 1 is on the same side with the keyway in the optional shroud, agreeing with an earlier post showing the front edge of the 3U VME board, as well as with all the suppliers' related pictures I could find. The component side of an SPI-10 module has the odd-numbered pins, and this keyway. If the controller board has a 90° pin header at the edge of the board, the components on the controller board and the module will face the same way. Make sure you always start numbering from the correct corner for pin header versus socket. 90° sockets for the module (as opposed to IDCs), especially sockets with the key on the outside, seem to be rare; and it takes less board space anyway to use straight soldertail pins on the socket, putting the PCB between the soldertails and soldering the row of odd numbers to pads on the component side, and the row of even numbers to pads on the opposite side.
If you opt for a 90° shrouded, keyed header (which goes on the controller, not the module), it will look something like this (except that you'll remove one of the pins, either #3 or #4):
Attachment:
shrouded10b.jpg [ 13.68 KiB | Viewed 22085 times ]
Two practical header orientations for the controller board are the lower two in this picture (thanks to Dr Jefyll for the next three pictures):
Attachment:
HeaderOrientations.jpg [ 87.55 KiB | Viewed 22085 times ]
Take care to number the pins correctly. Pin 1 is indicated here with the arrow. Pin 2 is below it.
Attachment:
pin 1 location.jpg [ 83.5 KiB | Viewed 22085 times ]
The pinout, shown photographically for a vertical, unshrouded pin header, is as follows:
Attachment:
SPI-10 3-5 Vol2t.gif [ 158.6 KiB | Viewed 22085 times ]
Headers and sockets both can be purchased in longer strips, up to 100 positions, and you can cut off however many you need to use at a time. This may come out cheaper; and if you unexpectedly need different lengths for other projects, you have stock.
My own first SPI-10 module is a flash-memory module, shown two posts down. I've built a few up for my own use, and will be supplying at least the tiny boards for others who would like them.
_________________ http://WilsonMinesCo.com/ lots of 6502 resources The "second front page" is http://wilsonminesco.com/links.html . What's an additional VIA among friends, anyhow?
|
|