R01UH0092EJ0110 Rev.1.10
Page 315 of 807
Jul 31, 2012
M16C/64C Group
18. Timer B
18.3.2
Timer Mode
In timer mode, the timer counts an internally generated count source. Table 18.5 lists Timer Mode
Specifications, Table 18.6 lists Registers and Setting in Timer Mode, and Figure 18.4 shows an
Operation Example in Timer Mode.
Table 18.5
Timer Mode Specifications
Item
Specification
Count sources
f1TIMAB, f2TIMAB, f8TIMAB, f32TIMAB, f64TIMAB, fOCO-S, fC32
Count operations
•
Decrement
•
When the timer underflows, it reloads the reload register value and continues
counting.
Counter cycles
n: setting value of the TBi register 0000h to FFFFh
Count start condition
Set the TBiS bit to 1 (start counting).
Count stop condition
Set the TBiS bit to 0 (stop counting).
Interrupt request
generation timing
Timer underflow
TBiIN pin function
I/O port
Read from timer
Count value can be read by reading the TBi register.
Write to timer
•
When not counting
The value written to the TBi register is written to both the reload register and the
counter.
•
When counting
The value written to the TBi register is only written to the reload register
(transferred to the counter when reloaded next).
i = 0 to 5
TBiS: Bit in the TABSR or TBSR register
Table 18.6
Registers and Settings in Timer Mode
(1)
Register
Bit
Function and Setting
PCLKR
PCLK0
Select the count source.
CPSRF
CPSR
Write 1 to reset the clock prescaler.
PCLKSTP1
PCKSTP11
Set to 0 when using f1 or main clock.
PCKSTP17
Select the count source.
TBi1
15 to 0
- (setting unnecessary)
PPWFS1 to
PPWFS2
PPWFS12 to
PPWFS10
PPWFS22 to
PPWFS20
Set to 0.
TBCS0 to TBCS3
7 to 0
Select the count source.
TABSR
TBSR
TBiS
Set to 1 when starting counting.
Set to 0 when stopping counting.
TBi
15 to 0
Set the count value.
TBiMR
7 to 0
Refer to the TBiMR register below.
i = 0 to 5
Note:
1.
This table does not describe a procedure.
1
n
1
+
(
)
------------------
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...