
Rev.2.10 Apr 14, 2006 page 125 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 13. Timers
Item Specification
Count source f1, f2, f8, f32, fC32
Count operation • Down-count
• When the counter reaches 0000h, it stops counting after reloading a new value
• If a trigger occurs when counting, the timer reloads a new count and restarts counting
Divide ratio 1/n n : set value of the TAi register 0000h to FFFFh
However, the counter does not work if the divide-by-n value is set to 0000h.
Count start condition The TAiS bit in the TABSR register = 1 (count starts) and one of the following
triggers occurs.
• External trigger input from the TAiIN pin
• Timer B2 overflow or underflow,
Timer Aj overflow or underflow,
Timer Ak overflow or underflow
• The TAiOS bit in the ONSF register is set to 1 (timer starts)
Count stop condition • When the counter is reloaded after reaching 0000h
• TAiS bit is set to 0 (count stops)
Interrupt request generation timing
When the counter reaches 0000h
TAiIN pin function I/O port or trigger input
TAiOUT pin function I/O port or pulse output
Read from timer An undefined value is read by reading the TAi register
Write to timer • When not counting and until the 1st count source is input after counting start
Value written to the TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to the TAi register is written to only reload register
(Transferred to counter when reloaded next)
Select function • Pulse output function
The timer outputs a low when not counting and a high when counting.
13.1.3 One-shot Timer Mode
In one-shot timer mode, the timer is activated only once by one trigger. When the trigger occurs, the timer
starts up and continues operating for a given period. Table 13.4 lists the One-shot Timer Mode Specifications.
Figure 13.11 shows Registers TA0MR to TA4MR in One-shot Timer Mode.
Table 13.4 One-shot Timer Mode Specifications
i = 0 to 4
j = i - 1, except j = 4 if i = 0
k = i + 1, except k = 0 if i = 4
Kommentare zu diesen Handbüchern