Instruction manual

Table Of Contents
PC215E Page 42
Bits 5…0 Counter's programmed Mode exactly as written in the last Mode Control Word
Bit 6 State of the addressed counter element
0 Count available for reading
1 Null Count
Bit 7 State of the addressed counter OUT pin
0 OUT pin is '0'
1 OUT pin is '1'
5.3.14 Z2 Counter 0 Data Register
The 82C54 Programmable Timer Counter Z2 provides three 16 bit counter/timers which can be
independently programmed to operate in any one of six modes with BCD or Binary count
functions. The register definition for Z2 Counter 0 Data is as follows.
Register
Offset
Write and/or
Read
Register
Width
Register
Title
Mnemonic
14
16
Write and Read 8 bits
82C54 Counter/Timer Z2
Counter 0 Data Register
Z2 CT0
FUNCTION
The Z2 Counter 0 Data Register is used to write and read 8 bit data to the 82C54 Z2
counter/timer 0. The counter is normally configured for 16 bit operation and to ensure validity of
the data it is important to always write/read two bytes to the register, least significant byte first.
Please note that the 16-bit count values written to this register are not latched into the counting
element until the next clock pulse (assuming the gate input is high). Subsequent read
operations from this register will therefore not reflect the new count value until this clock pulse
has latched the data.
The counter can be configured to operate in several modes. Further details may be found by
reference to the device manufacturer's 82C54 data sheets in the appendices.
The input to counter 0 can be any of the five internal master clock frequencies (10 MHz, 1 MHz,
100 kHz, 10 kHz or 1 kHz), an external clock, the Z2 External Clock signal or the output of Z1
counter 2. This clock source selection is made by writing to the Group Z Clock Connection
Register described in Section 5.3.19.
The output of counter 0 is available on the user socket, SK1 pin 57, and also as a possible clock
source for Z2 counter 1. The inverted output of Z2 counter 0 is also available on SK1 pin 38.
The gate input to counter 0 can be selected as VCC (permanently enabled), GND (permanently
disabled), the inverted output of Z1 Counter 1, or an external gate signal on SK1 pin 18. This
gate selection is made by writing to the Group Z Gate Connection Register described in Section
5.3.20.