
Page 264
8
4
f
o
6
0
2
,
1
3
.
n
a
J
1
3
.
1
.
v
e
R
1
3
1
0
-
4
3
0
B
9
0
J
E
R
21. Intelligent I/O (Base Timer)
)
T
3
8
/
C
2
3
M
,
3
8
/
C
2
3
M
(
p
u
o
r
G
3
8
/
C
2
3
M
21.1 Base Timer
The base timer is a free-running counter that counts an internally generated count source.
Table 21.2 lists specifications of the base timer. Figures 21.5 to 21.9 show registers associated with the
base timer. Figure 21.16 shows a block diagram of the base timer. Figure 21.17 shows an example of a
cascaded connection. Figure 21.18 shows an example of the base timer in counter increment mode. Figure
21.19 shows an example of the base timer in counter increment/decrement mode. Figure 21.20 shows an
example of two-phase pulse signal processing mode.
Table 21.2 Base Timer Specifications
Item
Specification
Count Source (fBTi) (i=0 to 3)
f1 divided by
2(n+1) (Group 0 to 3),
two-phase pulse input divided by
2(n+1) (Group 0 and 1)
n: determined by the DIV4 to DIV0 bits in the GiBCR0 register
n=0 to 31; however no division when n=31
Counting Operation
The base timer increments the counter
The base timer increments/decrements the counter
Two-phase pulse signal processing
Counter Start Condition
When starting the base timer of each group separately, set the BTS bit in
the GiBCR1 register to "1" (base timer starts counting)
When starting the base timer of multiple groups simultaneously, set the
BTiS bit in the BTSR register to "1" (base timer starts counting)
Counter Stop Condition
Set the BTiS bit in the BTSR register to "0" (base timer reset) and the BTS
bit in the GiBCR1 register to "0" (base timer reset)
Base Timer Reset Condition
Synchronized with the base timer reset in different groups:
Group0 : synchronized with group 1 base timer reset
Group1 : synchronized with group 0 base timer reset
Group2 : synchronized with group 1 base timer reset
Group3 : synchronized with group 2 base timer reset
Matching values in the base timer and GiPO0 register
"L" signal applied to the external interrupt pin
________
Group 0 : INT0 pin
________
Group 1 : INT1 pin
Reset request from communication function (Group 2 and 3)
Value when the Base Timer is Reset
"000016"
Interrupt Request
The BTiR bit in the interrupt request register is set to "1" (interrupt requested)
when bit 14 or bit 15 in the base timer overflows (See Figure 10.14.)
Read from Base Timer
The GiBT register indicates counter value while the base timer is running
The GiBT register is indeterminate when the base timer is reset
Write to Base Timer
When a value is written while the base timer is running, the counter
immediately starts counting from this value. No value can be written while
the base timer is reset.
Selectable Function
Cascaded connection (Group 0 and 1)
Group 1 base timer is incremented every time bit 15 in the group 0 base
timer overflows (See Figure 21.17)
Counter increment/decrement mode (Group 0 and 1)
The base timer starts when the BTS bit or the BTiS bit is set to "1". After
incrementing to "FFFF16", the counter is then decremented back to
"000016". If the RST1 bit in the GiBCR1 register is set to "1" (the base timer
is reset by matching with the GiPO0 register), the counter decrements after
the base timer matches the GiPO0 register. The base timer increments the
counter again when the counter becomes "000016." (See Figure 21.19.)