A800 - 8 Channel Stepper Pulse Generator Board

The A800 is an IBM PC compatible 8 channel stepper motor indexer board for ISA, ISA-16, and EISA slots.
The OPCS software uses this board to generate step/direction signals to stepper motor drives via the DB-37 connector.


Installation and Configuration

A800 PCB Circuit Board

Chip Datasheets

A800 Board Gerber Files

The boards can be printed at a PCB printing service using the Gerber/Drill files in a800-REV-A1.zip which can be sent to the PCB printing company
to have the boards printed. I've used PCBWay.com (China) and Avanti Circuits (AZ, USA) to print the A800 boards.
To print the A800 boards, the PCB service must support gold fingers and 45 deg beveling.

A800 Circuit Layout

The circuit board's layout was designed with Sprint6 Layout, which is commercial circuit board design software that's about $50 for a license.
The Sprint6 project file for REV-A1 is opcs-a800-REV-A1.lay6. (Note: this file is only needed to make edits (changes/customizations) to the board design.
To just print boards, use the above .zip file.

What follows are images of the different layers as they appear in Sprint6 Layout and/or a Geber viewer (such as the open source tool 'gerbv').

A800 top and bottom layer

A800 top layer

A800 bottom layer

A800 photo bottom side

A800 photo top side

A800 Board Schematics

Sheet 1 of 4

Sheet 2 of 4

Sheet 3 of 4

Sheet 4 of 4

A800 PIC Firmware

The firmware was written in PIC assembly for speed and for critical step timing.
The circuit board is very simple hardware, so all the "smarts" are implemented in firmware.

The precompiled .HEX file for REV-A1 is here: a800-opcs-asm-REV-A.X.production.hex, which can be programmed onto new PIC chips to create new A800 boards.
I used Microchip's free MPLAB X IDE (v5.25) and their approx. $50 USB PIC PicKit4 programmer, but third party programmers also work.

The source code is managed as a GPL V.3 licensed project on github here: https://github.com/erco77/a800-opcs-pic-asm. The project uses tags for the different revision boards. Note that the firmware for "REV-A" also works for "REV-A1". This is because REV-A1 made no electrical changes. The assembly source code is generally not useful unless someone is trying to implement new features, apply a firmware fix, or wants to study in depth the low level operation of the board. The only useful thing to a casual reader might be the comments and README files.

The firmware design had to be extremely precise, with care taken to count every PIC instruction's execution time in clock cycles to ensure timing accuracy of the step pulses. This code is no walk in the park; besides being in assembly (which is hard enough to maintain), the critical timing requirements makes it extra hard to write, with loops unwound and NOP padded conditionals to ensure equal execution time for all conditions and states.

The code is modularized into separate .asm files to make it easy to maintain; unwinding loops causes redundant code, so having e.g. the A/B/C/D velocity loading code in separate .asm files makes it easy to compare the files with a tool like 'xxdiff' to clearly see diffs and detect typos.

The code can be compiled in "MPLAB X", Microchip's free Interactive Development Environment for their line of microcontrollers. It includes a C compiler and their own XC8 assembler. The code was originally conceived as a C program, but later rewritten in pure assembly to leverage the PIC's assembly level features, such as jump tables in place of switch() and if/else, low execution time branches, highly optimized array indexing, etc. There are references to the original C code in the assembly to make it easier to follow what's going on.

Once assembled into a .HEX file, it can then be programmed onto the PIC chip using a USB programmer, such as Microchip's PICKIT-3 or PICKIT-4 programmers, which are approx. $50 devices available from from companies like Digikey, Amazon, or direct from Microchip's online store.

Suffice it to say the firmware interacts with the IBM PC through the onboard 8255 interface chip, reading new velocities from the OPCS software that are buffered and fed to the motors on the next real time interrupt, and puts out a pulse stream to the final output buffer chips (either 74HCT04 inverters, or 7407 open collector outputs) that output to the DB-37 connector on the rear of the board.

A800DRV.COM - Device Driver Source Code

This is the DOS device driver source code which is part of the A800 card's github project. It can be built with the MASM v1.0 assembler into a .COM file.

The program is a TSR (Terminate Stay Resident) application written in 80x86 assembly, and attaches itself to software interrupt 0x99 (INT 099h) which is the API to the main application, and vectors hardware interrupt IRQ 5 to itself, which is triggered by the A800 card to request new velocities for each time sample.

The driver expects a 64k 'ring buffer' to be allocated by the main program to use for buffering velocities to be fed in realtime to the motors. The main program notifies the driver of the address of this buffer through the INT 099h API. The A800 board triggers IRQ5 at approx. 100Hz to feed velocities from the ringbuffer to the motors.

The program should be installed in memory on boot (via the AUTOEXEC.BAT file) so that it is present for use by OPCS via INT 099h.

The driver is based on older Kuper RTMC48 driver code I wrote back in the 1990s, but updated for the A800 card. The driver allocates a 20,000 byte 'environment' that needs to be common between OPCS and other external applications (e.g. HOME.EXE) so that they all agree on what the current motor max speeds and positions are, etc. The memory is allocated by the driver, and a pointer to it is returned by one of the INT 099h API calls. The main applications manage the data that is put into that buffer, so that e.g. counter values can be persistent when going in and out of OPCS applications.

The device driver source code is provided with a GPL v3 license, the API designed to work closely with the OPCS software, but can be used by other user applications as well (e.g. the HOME.EXE Program) to move the motors using the API, as described in device drivers docs.