Adding New Hardware Types


Generally there are 2 types of hardware you might want to add:

Similar Hardware

This is hardware that directly controls the programmer by bit-bashing port pins.

The most common differences will simply be different polarities of control lines, and the absence of many features (eg software power-off, dual programming).

The structure hw_fun in pphw.c .h has a single line for each hardware type. In it you change the routines that are called to toggle the various control lines. Changing rxyz to sxyz will change the polarity (ie change set_xyz to reset_xyz). Since the BEL Dual Programmer has far more features than other programmer hardware, most hardware won't even need any new routines.

So in summary, many types of programmer can be added will just a single extra line.

An environment variable can be used to select the hardware type, or a commandline option.

Fundamentally Different Hardware

In this case you are going to need to replace higher level routines. pphw.h lists the high level subroutines used by the main program. If your hardware has this base functionality, you shouldn't have too much trouble. A example might be a serial port programmer that uses a micro to do the actual bit control.

You may find it simplest to replace PPHW.C rather than trying to stretch the run-time hardware selection code, ie produce a special version for your hardware.

High Level Functions

void run_mode(int mode);
void reset(int channel); // reset a particular channel (only for use in GO mode)
void prog_mode(int volt);
void out_word(int w);
int in_word(void);
void command(int cmd);

Debugging Hardware

In the test subdirectory there is a printer port control program ppcon.exe and several batch files that can be used to fully exercise and examine and pin of a printer port.

Mostly it is better to use the built-in debug function that exercises the various modes etc.

pp06 -debug

back to contents Home

Contact Us