This is revision B of the Controller24 module.

Controller24 Module (Revision B)

Table of Contents

1. Introduction

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:

2. Programming

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:

2.1 Parallax Basic Stamp 2

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

3. Hardware

The hardware consists of a circuit schematic and a printed circuit board.

3.1 Circuit Schematic

The schematic for the Controller24 module is shown below:

Controller24 Schematic

The parts list kept in a separate file -- controller24.ptl.

3.2 Printed Circuit Board

The printed circuit board files are listed below:

controller24_back.png
The solder side layer.
controller24_front.png
The component side layer.
controller24_artwork.png
The artwork layer.
controller24.gbl
The RS-274X "Gerber" back (solder side) layer.
controller24.gtl
The RS-274X "Gerber" top (component side) layer.
controller24.gal
The RS-274X "Gerber" artwork layer.
controller24.gml
The RS-274X "Gerber" mask layer.
controller24.drl
The "Excellon" NC drill file.
controller24.tol
The "Excellon" tool rack file.

4. Software

The following files are available:

controller24.ucl
The Controller24 µCL source code file.
controller24.asm
The Controller24 boot loader assembly code listing.
controller24.lst
The Controller24 boot loader listing file.
controller24.hex
The Controller24 boot loader Intel® Hex file.

5. Issues

Any fabrication issues are listed here.


Copyright © 2006-2007 by Wayne C. Gramlich. All rights reserved.