
21. Intelligent I/O
21.1
Base Timer
The base timer counts an internally generated count source continuously.
Table
21.2 lists specifications of the base timer. Figures
21.2 and
21.3 show registers associated with the base timer.
Figure 21.8 shows a block diagram of the base timer.
Figure 21.9 shows a base timer operation example in count
increment mode.
Figure 21.10 shows a base timer operation example in count increment/decrement mode.
Figure21.11 shows a base timer operation example in two-phase pulse signal processing mode.
Table 21.2
Base Timer Specifications (1)
Item
Specification
Count source (fBTi)
(i = 0, 1)
f1 divided by 2(n+1), two-phase pulse input divided by 2(n+1)
n
: determined by bits DIV4 to DIV0 in the GiBCR0 register (n = 0 to 31);
however, no division when n = 31
Count operations
The base timer increments the counter value
The base timer both increments and decrements the counter value
Two-phase pulse signal processing
Count start condition
Set the BTS bit in the GiBCR1 register to 1 (base timer starts counting)
Count stop condition
Set the BTS bit to 0 (base timer reset)
Base timer reset condition
The base timer value matches the GiPO0 register
Apply to a low-level (“L”) signal to the INT0 or INT1 pin
Value when the base timer is reset 0000h
Interrupt request
The BTiR bit in the interrupt request register is set to 1 (interrupt requested) when
Read base timer value
The base timer value can be obtained by reading the GiBT register while the
base timer is counting
The base timer value is undefined when reading the GiBT register during base
timer reset
Write to base timer
When a value is written while the base timer is counting, the timer immediately
starts counting from the written value. No value can be written during base timer
reset
Selectable function
Count increment/decrement mode
The base timer starts counting when the BTS bit is set to 1. After incrementing
up to FFFFh, the base timer is then decremented back to 0000h.
If the RST1 bit in the GiBCR1 register (i = 0, 1) is set to 1 (base timer is
reset by matching with the GiPO0 register), the base timer decrements in the
second clock after the base timer value matches the GiPO0 register. The
base timer increments the counter value again when the base timer reaches
Increment/Decrement Mode
)
Two-phase pulse processing mode
Two-phase pulse signals from the UDiA (P3_0, P7_6, or P8_0) and UDiB pin
(P3_1, P7_7, or P8_1) are counted. (See Figure 21.11 Base Timer Operation in Two-Phase Pulse Signal Processing Mode
) The IPSA register controls
UDiA
(P3_0,P7_6, or
P8_0)
Timer increments at all edges
Timer decrements at all edges
UDiB
(P3_1, P7_7, or
P8_1)