
RX - 4591 CF
Page - 7
MQ - 402 - 01
8.2.3. Timer counter (Reg-B and Reg-C)
Address
Function
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
B
Timer counter 0
128
64
32
16
8
4
2
1
C
Timer counter 1
2048
1024
512
256
This register controls 12 bits of internal preset-able down counter used for timer interrupt.
TSEL0 and TSEL1 of Reg-D specify the count cycle of the down counter (source clock). Timer counter 0 and timer
counter 1 specify the preset value of the down counter.
When the TE bit of Reg-D is set to "0, The presetable counter loads the written data to the timer counter (It is initial
value. ), and then stops the count down. Afterwards, when the TE bit set to 1, count down starts.
Using a source clock cycle, the down counter continues the countdown. When the data becomes zero, the TF (Timer
Flag) of Reg-E is set to "1". At this moment, if the TIE bit (Timer Interrupt Enable) of Reg-F was set to 1 beforehand,
the /IRQ pin is asserted low for generate the interrupt signal.
When the TIE bit is set to "0", output from the /IRQ pin is prohibited.
Next, it reloads the data of timer counter register and restarts the countdown (repeat operation).
But, even if write 1 to the TE bit, and write 0 to the timer counter, timer interrupt from the /TIRQ pin is not generated.
In order to operate timer expectedly, you should set the TE bit and the TIE bit adequately.
If timer interrupt is not used, then addresses B and C may be used as memory registers. In this case, set TE bit and
TIE bit to "0", to prohibit timer operation and timer interrupts.
Timer interrupt and source clock selection
TSEL1
TSEL0
Source clock
0
4096 Hz
0
1
64 Hz
1
0
1 Hz
1
Update in minutes
Timer interrupt interval
Source clock
Timer
counter
setting
value
4096 Hz
64 Hz
1 Hz
Update in
minutes
0
1
244.14
s
15.625 ms
1 s
1 min
2
488.28
s
31.25 ms
2 s
2 min
41
10.010 ms
640.63 ms
41 s
41 min
82
20.020 ms
1.281 s
82 s
82 min
128
31.250 ms
2.000 s
128 s
128 min
192
46.875 ms
3.000 s
192 s
192 min
205
50.049 ms
3.203 s
205 s
205 min
320
78.125 ms
5.000 s
320 s
320 min
410
100.10 ms
6.406 s
410 s
410 min
640
156.25 ms
10.000 s
640 s
640 min
820
200.20 ms
12.813 s
820 s
820 min
1229
300.05 ms
19.203 s
1229 s
1229 min
1280
312.50 ms
20.000 s
1280 s
1280 min
1920
468.75 ms
30.000 s
1920 s
1920 min
2048
500.00 ms
32.000 s
2048 s
2048 min
2560
625.00 ms
40.000 s
2560 s
2560 min
3200
0.7813 s
50.000 s
3200 s
3200 min
3840
0.9375 s
60.000 s
3840 s
3840 min
4095
0.9998 s
63.984 s
4095 s
4095 min