English
Language : 

MC68HC05P9A Datasheet, PDF (98/158 Pages) Freescale Semiconductor, Inc – HCMOS Microcontroller Unit
Timer
Freescale Semiconductor, Inc.
Timer Registers
The read-only timer registers (TRH and TRL) contain the current high
and low bytes of the 16-bit counter. Reading TRH before reading TRL
causes TRL to be latched until TRL is read. Reading TRL after reading
the timer status register clears the timer overflow flag (TOF). Writing to
the timer registers has no effect.
$0018 Bit 7
6
5
4
3
2
1
Bit 0
Read: Bit 15
14
13
12
11
10
9
Bit 8
Write:
Reset:
Reset initializes TRH to $FF
$0019 Bit 7
6
5
4
3
2
1
Bit 0
Read: Bit 7
6
5
4
3
2
1
Bit 0
Write:
Reset:
Reset initializes TRL to $FC
= Unimplemented
Figure 53. Timer Registers (TRH and TRL)
Reading TRH returns the current value of the high byte of the counter
and causes the low byte to be latched into a buffer. The buffer value
remains fixed even if the high byte is read more than once. Reading TRL
reads the transparent low byte buffer and completes the read sequence
of the timer registers.
INTERNAL
DATA BUS
LATCH
BUFFER
READ TRH
TRH ($0018)
TRL ($0019)
Figure 54. Timer Register Reads
NOTE:
To prevent interrupts from occurring between readings of TRH and TRL,
set the interrupt mask (I bit) in the condition code register before reading
TRH, and clear the mask after reading TRL.
18-tim1ic1oc_a
98
Timer
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com