
HT48R10A-1
Rev. 1.20
16
July 2, 2001
Timer/Event Counter
Atimer/eventcounters(TMR)isimplementedin
the microcontroller. The timer/event counter
contains an 8-bit programmable count-up coun-
ter and the clock may come from an external
source or from the system clock or RTC.
Using the internal clock sources, there are 2
reference time-bases for timer/event counter.
The internal clock source can be selected as
coming from f
SYS
(can always be optioned) or
f
RTC
(enabled only system oscillator in the Int.
RC+RTC mode) by ROM code option. The exter-
nalclockinputallowstheusertocountexternal
events, measure time intervals or pulse widths,
or to generate an accurate time base and PFD
signals.
There are 2 registers related to the timer/event
counter;TMR([0DH]),TMRC([0EH]).Twophys-
ical registers are mapped to TMR location; writ-
ing TMR makes the starting value be placed in
Label (TMRC)
Bits
Function
PSC0~PSC2
0~2
To define the prescaler stages, PSC2, PSC1, PSC0=
000: f
INT
=f
SYS
/2 or f
RTC
/2
001: f
INT
=f
SYS
/4 or f
RTC
/4
010: f
INT
=f
SYS
/8 or f
RTC
/8
011: f
INT
=f
SYS
/16 or f
RTC
/16
100: f
INT
=f
SYS
/32 or f
RTC
/32
101: f
INT
=f
SYS
/64 or f
RTC
/64
110: f
INT
=f
SYS
/128 or f
RTC
/128
111: f
INT
=f
SYS
/256 or f
RTC
/256
TE
3
To define the TMR0 active edge of timer/event counter 0
(0=active on low to high; 1=active on high to low)
TON
4
To enable/disable timer 0 counting
(0=disabled; 1=enabled)
5
Unused bit, read as "0"
TM0
TM1
6
7
To define the operating mode
01=Event count mode (external clock)
10=Timer mode (internal clock)
11=Pulse width measurement mode
00=Unused
TMRC register
- ( % $ "
$ ' % - # $ , $ . /
* 3 $ * . / # * (
1 3 / 4
1 , $ # $ . /* - . / $ #
# $ ( * ' 3 $ + 1 % / $ #
1 , $ # $ . /
* - . / $ #
' / '- %
$ ( * ' 3
$ # ) ( * A
/ * / $ # # - 0 /
: % / ' + $ # $ % & ' ( $ #
:
)
)
)
* 3 $ 0 / 1 * .
7
8
Timer/Event Counter