
APPLICATION
2.4 Timer 1, timer 2, and timer 3
3822 GROUP USER’S MANUAL
2–98
2.4.3 Register setting example
Figure 2.4.13 shows an example of setting registers for timers 1, 2, and 3.
Fig. 2.4.13 Example of setting registers for timers 1, 2, and 3
[Notes on use]
Notes 1: For using interrupt processing, set the following :
Before setting below, clear the respective timer interrupt enable bits and the
timer respective interrupt request bits to “0.”
After setting below, set the respective timer interrupt enable bits to “1”
(interrupts enabled)
2: The values written in the timers 1 and 3 are set into both the respective latches
and the respective counters at the same time.
3: To enable the TOUT output when the timer 2 is used, set port P5 6 (this port is
also used the TOUT pin) for the output mode.
4: Write values in the order of the timer 1, timer 2, and timer 3.
Set count value to timer 1 (T1) [Address 24 16]
Set count value to timer 3 (T3) [Address 26 16]
Set count value to timer 2 (T2) [Address 25 16]
Setting of timer 123 mode register
Select count source or others
b7
b0
T123M : Timer 123 mode register [Address 29 16]
b0 : Timer 2 TOUT output active edge switch bit
0 : Start at “H” output
1 : Start at “L” output
b1 : Timer 2 TOUT output control bit
0 : TOUT output disabled
1 : TOUT output enabled
b2 : Timer 2 write control bit
0 : Write data in latch and counter
1 : Write data in latch only
b3 : Timer 2 count source selection bit
0 : Timer 1 underflow
1 : f(XIN)/16 (Middle-/high-speed mode)
f(XCIN)/16 (Low-speed mode)
b4 : Timer 3 count source selection bit
0 : Timer 1 underflow
1 : f(XIN)/16 (Middle-/high-speed mode)
f(XCIN)/16 (Low-speed mode)
b5 : Timer 1 count source selection bit
0 : f(XIN)/16 (Middle-/high-speed mode)
f(XCIN)/16 (Low-speed mode)
1 : f(XCIN)