|
7220 Datasheet, PDF (62/303 Pages) Renesas Technology Corp – 8-BIT SINGLE-CHIP MICROCOMPUTER | |||
|
◁ |
FUNCTIONAL DESCRIPTION
2.6 Timers
2.6.1 Timer functions
There are four timers; Timer 1, Timer 2, Timer 3, Timer 4 and each timer has an 8-bit reload latch. All
timers are the count-down type, and when the timer latch value is ânâ, the divide ratio is 1/(n+1)(ânâ = 0
to 255). When the valve ânâ is written to reload latch, is also set ânâ to its timer, simultaneously.
Timer value is counted down each rising edge of count source. The timer overflows at the count next pulse,
after the count value reaches â0016,â and the interrupt request occurs. At the same time of timer overflow,
the reload latch value ânâ is set (reload) to timer, and timer continues to count down. The divide ratio is
1/(n+1). Make sure that set ânâ in the range â0016â to âFF16.â
Count source
Timer
nn16 nn16-1
Writing Value
Overflow signal
0116 0016 nn16 nn16-1
Interrupt request
Fig. 2.6.2 Timer overflow timing
(1) Timer 1
Timer 1 can select one of the following count sources:
q f(XIN)/16
q f(XIN)/4096
(This is a clock by f(XIN)/4096 interrupt and is valid only when PWM count source is supplied.)
The count source of timer 1 is selected by setting bit 0 of the timer 12 mode register (address
00F416).
Timer 1 interrupt request occurs at timer 1 overflow.
(2) Timer 2
Timer 2 can select one of the following count sources:
q f(XIN)/16
q Timer 1 overflow signal
q External clock from pin P24/TIM2
The count source of timer 2 is selected by setting bits 4 and 1 of the timer 12 mode register (address
00F416). When timer 1 overflow signal is a count source for timer 2, timer 1 functions as an 8-bit
prescaler.
Timer 2 interrupt request occurs at timer 2 overflow.
7220 Group Userâs Manual
2-35
|
▷ |