mc68hc05jb4p Freescale Semiconductor, Inc, mc68hc05jb4p Datasheet - Page 59

no-image

mc68hc05jb4p

Manufacturer Part Number
mc68hc05jb4p
Description
Mc68hc705jb4 Microcontroller
Manufacturer
Freescale Semiconductor, Inc
Datasheet
MC68HC05JB4
REV 2
The timer registers (TMRH, TMRL) shown in Figure 9-3 are read-only locations
which contain the current high and low bytes of the 16-bit free-running counter.
Writing to the timer registers has no effect. Reset of the device presets the timer
counter to $FFFC.
The TMRL latch is a transparent read of the LSB until the a read of the TMRH
takes place. A read of the TMRH latches the LSB into the TMRL location until the
TMRL is again read. The latched value remains fixed even if multiple reads of the
TMRH take place before the next read of the TMRL. Therefore, when reading the
MSB of the timer at TMRH the LSB of the timer at TMRL must also be read to
complete the read sequence.
During power-on-reset (POR), the counter is initialized to $FFFC and begins
counting after the oscillator start-up delay. Because the counter is sixteen bits and
preceded by a fixed divide-by-four prescaler, the value in the counter repeats
every 262, 144 internal bus clock cycles (524, 288 oscillator cycles).
When the free-running counter rolls over from $FFFF to $0000, the timer overflow
flag bit (TOF) is set in the TSR. When the TOF is set, it can generate an interrupt if
the timer overflow interrupt enable bit (TOIE) is also set in the TCR. The TOF flag
bit can only be reset by reading the TMRL after reading the TSR.
Other than clearing any possible TOF flags, reading the TMRH and TMRL in any
order or any number of times does not have any effect on the 16-bit free-running
counter.
To prevent interrupts from occurring between readings of the TMRH and TMRL,
set the I bit in the condition code register (CCR) before reading TMRH and clear
the I bit after reading TMRL.
TMRH
$0018
TMRL
$0019
reset:
reset:
Figure 9-3. Programmable Timer Counter Registers (TMRH, TMRL)
W
W
R
R
TMRH7
TMRL7
BIT 7
1
1
Freescale Semiconductor, Inc.
For More Information On This Product,
TMRH6
TMRL6
BIT 6
1
1
Go to: www.freescale.com
February 24, 1999
TMRH5
TMRL5
BIT 5
16-BIT TIMER
1
1
NOTE
TMRH4
TMRL4
BIT 4
1
1
TMRH3
TMRL3
GENERAL RELEASE SPECIFICATION
BIT 3
1
1
TMRH2
TMRL2
BIT 2
1
1
TMRH1
TMRL1
BIT 1
1
0
TMRH0
TMRL0
BIT 0
1
0

Related parts for mc68hc05jb4p