Instruction manual
AMPDIO DRIVERS
Page 34
The specified timer/counter channel is set to mode 2 with an initial count of 65536 and divides the
event clock. The output is fed to the input of another timer/counter channel offset by +1 from the
specified channel. This second channel is set to mode 0 with an initial count of 65536. The initial
count of the second channel is loaded by toggling the mode of the first channel. The initial count of
the first channel is loaded on the first event clock pulse. To read the event count, the status of the
two channels and their counts are read. The status indicates whether the first event clock has
occurred yet (by checking whether the initial count of the first channel has been loaded) and
indicates whether the 32-bit count has overflowed (by checking the output state of the second
channel).
The 32-bit event counter functions do not work on the PC24E, PC25E, PC26AT, PC27E or
PC30AT because the status of the timer/counter chips cannot be monitored on these cards.
3.2 Digital I/O Functions
The library supports a number of basic digital I/O functions that do not require the use of interrupts.
3.2.1 Basic Digital I/O
The library supports basic digital I/O for mode 0 of the 82C55 programmable peripheral interface
chip. The 82C55 ports A, B and C can be configured as inputs or outputs using the DIOsetMode
function (see section 6.4.11.2). Port C is split into two 4-bit halves, individually configurable as
inputs or outputs.
The library supports the concept of digital I/O channels. The channels can be 1, 2, 4, 8, 12 or 24
bits wide. The DIOsetChanWidth function (see section 6.4.11.4) is used to configure channel
widths. The channels are mapped onto the physical ports in the following way.
Channel Width Channel Mapping Port Mapping
1 X0..X7
X8..X15
X16..X24
Port A bits 0,1,2,..,7
Port B bits 0,1,2,..,7
Port C bits 0,1,2,..,7
2 X0..X3
X4..X7
X8..X11
Port A bits 0&1,2&3,..,6&7
Port B bits 0&1,2&3,..,6&7
Port C bits 0&1,2&3,..,6&7
4 X0
X1
X2
X3
X4
X5
Port A bits 0 to 3
Port A bits 4 to 7
Port B bits 0 to 3
Port B bits 4 to 7
Port C bits 0 to 3
Port C bits 4 to 7
8 X0
X1
X2
Port A bits 0 to 7
Port B bits 0 to 7
Port C bits 0 to 7
12 X0
X1
Port A and Port C bits 4..7
Port B and Port C bits 0..3
24 X0 Port A bits 0 to 7
Port B bits 0 to 7
Port C bits 0 to 7
Note that the 12-bit channel configuration does not follow the same pattern as the others. The 12-
bit channels are arranged in a way that is compatible with mode 1 and mode 2 strobed data
communication.
The DIOsetData and DIOgetData functions (see sections 6.4.11.5 and 6.4.11.6) are used to read
and write the digital channels.