![](http://datasheet.mmic.net.cn/30000/M30280M8V-XXXHP_datasheet_2358818/M30280M8V-XXXHP_159.png)
13. Timer S
).
r
e
v
-
V
/.
r
e
v
-
T
(
p
u
o
r
G
8
2
/
C
6
1
M
page 139
0
9
3
f
o
7
0
2
,
0
3
.r
a
M
0
1
.
1
.
v
e
R
0
1
0
-
7
8
2
0
B
9
0
J
E
R
The timer increments
a counter on all edges
The timer decrements
a counter on all edges
P80
P81
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
Read from timer
The G1BT register indicates a counter value while the base timer is running
The G1BT register is undefined when the base timer is reset
Write to timer
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.
Selectable function
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 pins P80 and P81 are counted (See Figure
13.14
)