
Configuring the Timer Mode
In this mode, the timer can be utilized to measure fixed time intervals, providing an internal inter-
rupt signal each time the counter overflows. To operate in this mode, bits TM1 (bit7) and TM0 (bit6)
of the TMRC register must be set to 1 and 0 respectively. In this mode, the internal clock is used as
the timer clock. The input clock frequency to the timer is f
SYS
divided by the value programmed into
the timer prescaler, the value of which is determined by bits PSC0~PSC2 of the TMRC register.
The timer-on bit, TON must be set high to enable the timer to run. Each time an internal clock high
to low transition occurs, the timer increments by one; when the timer is full and overflows, an inter-
rupt signal is generated and the timer will preload the value already loaded into the preload regis-
ter and continue counting. A timer overflow condition and corresponding internal interrupt is one of
the wake-up sources, however, the internal interrupts can be disabled by ensuring that the ETI bit
of the INTC register is reset to zero.
28
Cost-Effective I/O Type MCU
T M R C R e g i s t e r f o r 8 - b i t T i m e r / E v e n t C o u n t e r
N o t i m p l e m e n t e d , r e a d a s " 0 "
b 7
E v e n t C o u n t e r A c t i v e E d g e S e l e c t
1 : c o u n t o n f a l l i n g e d g e
0 : c o u n t o n r i s i n g e d g e
T E
T O N
T M 0
T M 1
T i m e r P r e s c a l e r R a t e S e l e c t
P S C 2
0
0
0
0
1
1
1
1
b 0
P S C 2 P S C 1 P S C 0
P S C 1
0
0
1
1
0
0
1
1
P S C 0
0
1
0
1
0
1
0
1
T i m e r R a t e
1 : 2
1 : 4
1 : 8
1 : 1 6
1 : 3 2
1 : 6 4
1 : 1 2 8
1 : 2 5 6
T i m e r / E v e n t C o u n t e r C o u n t i n g E n a b l e
1 : e n a b l e
0 : d i s a b l e
O p e r a t i n g M o d e S e l e c t
T M 1
0
0
1
1
T M 0
0
1
0
1
n o m o d e a v a i l a b l e
e v e n t c o u n t e r m o d e
t i m e r m o d e
p u l s e w i d t h m e a s u r e m e n t m o d e
P u l s e W i d t h M e a s u r e m e n t A c t i v e E d g e S e l e c t
1 : s t a r t c o u n t i n g o n r i s i n g e d g e , s t o p o n f a l l i n g e d g e
0 : s t a r t c o u n t i n g o n f a l l i n g e d g e , s t o p o n r i s i n g e d g e
I n c r e m e n t
T i m e r C o n t r o l l e r
P r e s c a l e r O u t p u t
T i m e r + 1
T i m e r + 2
T i m e r + N
T i m e r + N + 1
Timer Mode Timing Chart
Содержание HT48R05A-1
Страница 7: ...vi Cost Effective I O Type MCU...
Страница 8: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Страница 9: ...2 Cost Effective I O Type MCU...
Страница 52: ...P a r t I I Programming Language Part II Programming Language 45...
Страница 53: ...46 Cost Effective I O Type MCU...
Страница 59: ...52 Cost Effective I O Type MCU...
Страница 90: ...P a r t I I I Development Tools Part III Development Tools 83...
Страница 91: ...84 Cost Effective I O Type MCU...
Страница 101: ...94 Cost Effective I O Type MCU...
Страница 104: ...Appendix Appendix 97...
Страница 105: ...98 Cost Effective I O Type MCU...
Страница 115: ...108 Cost Effective I O Type MCU...
Страница 116: ...A p p e n d i x B Package Information Appendix B Package Information 109 B...
Страница 123: ...116 Cost Effective I O Type MCU...
Страница 125: ...Amendments...