16-Bit Timers
Registers
MC68HC(7)05H12
—
Rev. 1.0
General Release Specification
MOTOROLA
16-Bit Timers
107
L
G
R
($23) is also written. The user must write both bytes (locations) if the
MSB is written first. A write made only to the LSB ($23) will not inhibit the
compare function. The free-running counter is updated every four
internal bus clock cycles. The minimum time required to update the
output compare register is a function of the program rather than the
internal hardware.
The processor can write to either byte of the output compare register 1
without affecting the other byte. The output level (OLVL1) bit is clocked
to the output level register regardless of whether the output compare flag
(OC1F) is set or clear.
Because the output compare flag OC1F and the output compare register
1 are undetermined at power-on and are not affected by external reset,
care must be exercised when initializing the output compare function.
The following procedure is recommended
Write the high byte to the compare register 1 to inhibit further compares
until the low byte is written.
Reading the status register arms the OC1F if it is already set.
Write the output compare register 1 low byte to enable the output
compare 1 function with the flag clear.
The purpose of this procedure is to prevent the OC1F bit from being set
between the time it is read and the write to the corresponding output
compare register.
9.3.4 Output Compare Register 2
The 16-bit output compare register 2 is made up of two 8-bit registers at
locations $26 (MSB) and $27 (LSB). The output compare register
contents are compared with the contents of the free-running counter
once every four internal processor clock cycles. If a match is found, the
output compare flag OC2F (bit 1 of the timer status register ($2E)) is set
and the corresponding output level OLVL2 bit is clocked to TCMP2
output.