
The following table shows the special function registers on the
PCPIC
How to Write to the Registers
It is useful to remember that the pointer register only needs to be
written to once if only one register is read or written. This means
that I/O can then be done with byte reads and writes. However, if
your program is continually changing registers it must write a new
pointer value each times it accesses a new register. This can be done
by writing a pair of bytes as a word, because the CPU in a PC does
word writes to the bus (which is one byte wide) by writing the lower
byte first, thus setting up the pointer register first.
For example, to initialise a counter two bytes must be sent to the
count register. It is not necessary to change the pointer after each
write. However, when another channel is initialised a new pointer
must be written, because the registers for that channel are at a
different addresses. The sub-section A Quick Installation Test shows
the basics of how to write to the control register.
Counter Registers
The PCPIC has a large number of I/O registers. Twelve of them are
contained in the three 8254 counter chips, IC22, 23 and 24. The rest
control the operation of the board.
Each counter chip has four registers. Three of them are the count
registers for the three counters and the fourth is the control register.
In the I/O register table above they are referred to as counter 0, 1, 2
and control register. There are many ways to program an 8254
counter, and for a detailed discussion you should read the full
manufacturer's data sheets, available from most distributors. In
addition there are explanations of programming the 8253 counter in
many books about the PC, because the 8253 is used on the PC
motherboard - the 8254 is compatible with the 8253 but has a few
additional features and can count at higher rates. In the following
explanation we present a simplified description of programming the
8254.
It is important to note that the counters are down counters. They
start from the count which you have programmed into the registers
and count down.
You can read the count value at any time, but if you read it directly
J230 PCPIC
Page 11
2192-09155-000-000
81H
Board Ident
R
Reading this should always give a value of OCH for the
PCPIC
Writing 01 switches the green LED on. Writing 00
switches it off.
80H
User LED
W
Pointer Value
Register Name
Read/Write
Comments