English
Language : 

M16C28 Datasheet, PDF (166/423 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES
M16C/28 Group (M16C/28, M16C/28B)
13. Timer S
13.1 Base Timer
The base timer is a free-running counter that counts an internally generated count source.
Table 13.2 lists specifications of the base timer. Table 13.3 shows registers associated with the base timer.
Figure 13.11 shows a block diagram of the base timer. Figure 13.12 shows an example of the base timer
in counter increment mode. Figure 13.13 shows an example of the base timer in counter increment/decre-
ment mode. Figure 13.14 shows an example of two-phase pulse signal processing mode.
Table 13.2 Base Timer Specifications
Item
Specification
Count source(fBT1)
f1 or f2 divided by (n+1) , two-phase pulse input divided by (n+1)
n: determined by the DIV7 to DIV0 bits in the G1DV register. n=0 to 255
However, no division when n=0
Counting operation
The base timer increments the counter value
The base timer increments/decrements the counter value
Two-phase pulse signal processing
Count start condition
The BTS bit in the G1BCR1 register is set to "1" (base timer starts counting)
Count stop condition
The BTS bit in the G1BCR1 register is set to "0" (base timer reset)
Base timer reset condition
(1) The value of the base timer matches the value of the G1BTRR register
(2) The value of the base timer matches the value of G1PO0 register.
________
(3) Apply a low-level signal ("L") to external interrupt pin,INT1 pin
Value for base timer reset
"000016"
Interrupt request
The base timer interrupt request is generated:
(1) When the bit 14 or bit 15 in the base timer overflows
(2) The value of the base timer value matches the value of the base timer
reset register (See Figure 13.11)
Read from timer
• The G1BT register indicates a counter value while the base timer is running
• The G1BT register is indeterminate when the base timer is reset
Write to timer
Selectable function
When a value is written while the base timer is running, the timer counter
immediately starts counting from this value. No value can be written while
the base timer is reset.
• Counter increment/decrement mode
The base timer starts counting from "000016". After incrementing to
"FFFF16", the timer counter is then decremented back to "000016". The base
timer increments the counter value again when the timer counter reaches
"000016". (See Figure 13.13)
• Two-phase pulse processing mode
Two-phase pulse signals from P80 and P81 pins are counted (See Figure
13.14)
P80
P81
The timer increments The timer decrements
a counter on all edges a counter on all edges
Rev. 2.00 Jan. 31, 2007 page 146 of 385
REJ09B0047-0200