page 1  (63 pages)
2to next section

A ATB Control Software

This appendix contains listings of the author's software for testing currentmode analog circuits on the ATB. xA.1 shows the low-level routines that manipulate the functional units of the ATB. xA.2 is ftntest, a (largish) program that offers a menu of functions for testing portions of the ATB hardware, and for basic testing of circuits via the ATB. xA.3 contains miscellaneous routines that ftntest uses; xA.4 is a makefile for ftntest.

A.1 Library Routines

These three files, low-para.h, atbpara.h, and atbpara.c, provide basic routines to manipulate the parallel interface from a C-language program.

/*---------------------------------------------------------------------* | low-para.h | | | | Low-level constants and macros that define the parallel port and its | | control. Here we take care of inverted bits, weird bit/nybble | | positions, and such arcana.... | | | | Foo. | | | | 92-11-10 Split out from atbpara.h, because only the atbpara.c file | | really needs this stuff. | | 93/01/20 ... and ftntest.c ... | | 93-03-28 Rename "S_Reg_Nybble" to "S_Reg_Upper4" so I'll remember | | which nybble has the data :( | *---------------------------------------------------------------------*/ #if !defined(_LOW_PARA_H)
#define _LOW_PARA_H
#include <dos.h>

#define D_Reg 0x0378 /*----------------------------------*/ #define S_Reg 0x0379 /* Parallel-port register addresses */ #define C_Reg 0x037a /*----------------------------------*/

/*---------------------------------------------------------* | Bit 3 of the Status register is inverted. This fixes it. |