This is revision B of the Controller24 module.
The Controller24 module is used to connect microcontrollers that conform to the defacto pin out standard of the Parallax® Basic Stamp 2 to the RoboBricks2 bus.
This module has the following features:
The programming depends upon which of the several chips that pin compatible with the Parallax Basic Stamp 2. There is one section below for each different microcontoller:
When this module is used in conjunction with the Parallax Basic Stamp 2, the SHIFTIN and SHIFTOUT commands are used to exchange data with the RoboBricks2 bus. According to the Parallax Basic Stamp 2 module, the SHIFTIN and SHTIFOUT commands are capable of shifting data at the following rates:
Processor Speed (kbits/sec.) BS2 ~16 BS2e ~16 BS2sx ~42 BS2p ~42 BS2pe ~16 BS2px ~65
Since the RoboBricks bus runs at 500 kbits/sec., clearly there needs to be some synchronization and buffering to provide error free communication with the RoboBricks2 bus. Some additional I/O pins are used to synchronize everything. The various bins are given logical names and the binding to physical pins is given in a table at the end of this section.
The format of the Parallax Basic Stamp SHIFTOUT command is:
SHIFTOUT
Dpin,
Cpin,
Mode,
[Outdata, ...]
and the format of the SHIFTIN command is:
SHIFTIN
Dpin,
Cpin,
Mode,
[Variable, ...]
where
Dpin
- is the data pin that data is shifted in (SHIFTIN) or out (SHIFTOUT) on,
Cpin
- is the clock pin used for shifting data,
Mode
- is specifies the mode for the operation,
Outdata
- is the output data to be shifted out, and
Variable
- is the input data to be shifted in.
In general, the bus microcontroller is much faster than the Basic Stamp 2. Thus, it turns out that this means that the Basic Stamp 2 can just send data with little regards for synchronization.
' Select the IO8 module: ' Set 9th bit to 1 to indicate an address is coming: HIGH address SHIFTOUT sdo, sck, shiftout_mode, [8] ' Send command to IO8: ' Clear 9th bit LOW address SHIFTOUT sdo, sck, shiftout_mode, command
Reading data basically requires waiting until the data is ready. What happens is that we need to handshake between the bus microcontroller and the Basic Stamp 2 using a couple of pins.
' Indicate that we are waiting: HIGH waiting ' Wait until bus controller has data: Loop: IF NotReady THEN Loop ' Clear wait for the next time and shift the data in: LOW waiting SHIFTIN sdi, sck, shiftin_mode, [variable]
Here is the promised table:
Basic Stamp 2 Bus µController Description Variable In/Out Pin In/Out Label Pin SDO Out {tbd} In SDI 7 Shift Data Output SDI In {tbd} Out SDO 8 Shift Data Input SCK Out {tbd} In SCK 10 Shift clock ADDRESS Out {tbd} In ? ? 9th data bit for address NOTREADY In {tbd} Out ? ? Indicate that bus controller does not have data yet WAITING Out {tbd} In ? ? Indicate that we are waiting for data
The hardware consists of a circuit schematic and a printed circuit board.
The schematic for the Controller24 module is shown below:
The parts list kept in a separate file -- controller24.ptl.
The printed circuit board files are listed below:
The following files are available:
Any fabrication issues are listed here.