R01UH0092EJ0110 Rev.1.10
Page 779 of 807
Jul 31, 2012
M16C/64C Group
32. Usage Notes
32.12.2 Timer A (Timer Mode)
32.12.2.1 Reading the Timer
The counter value can be read from the TAi register at any time while counting. However, if the coun-
ter is read at the same time as it is reloaded, the read value is FFFFh. Also, if the counter is read
before it starts counting, or after a value is set in the TAi register while not counting, the set value is
read.
32.12.3 Timer A (Event Counter Mode)
32.12.3.1 Reading the Timer
While counting, the counter value can be read at any time by reading the TAi register. However, while
reloading, FFFFh can be read in underflow, and 0000h in overflow. When the counter is read before it
starts counting and after a value is set in the TAi register while not counting, the set value is read.
32.12.4 Timer A (One-Shot Timer Mode)
32.12.4.1 Stop While Counting
When setting the TAiS bit to 0 (count stopped), the following occurs:
•
The counter stops counting and reload register values are reloaded.
•
The TAiOUT pin outputs a low-level signal when the POFSi bit in the TAPOFS register is 0, and out-
puts a high-level signal when it is 1.
•
After one cycle of the CPU clock, the IR bit in the TAiIC register becomes 1 (interrupt requested).
32.12.4.2 Delay between the Trigger Input and Timer Output
As the one-shot timer output is synchronized with an internally generated count source, when an
external trigger is selected, a maximum 1.5 cycle delay of the count source occurs between the trig-
ger input to the TAiIN pin and timer output.
32.12.4.3 Changing Operating Modes
The IR bit becomes 1 when the timer operating mode is set by any of the following:
•
Selecting one-shot timer mode after reset
•
Changing the operating mode from timer mode to one-shot timer mode
•
Changing the operating mode from event counter mode to one-shot timer mode
To use the timer Ai interrupt (IR bit), set the IR bit to 0 after the changes listed above are made.
32.12.4.4 Retrigger
When a trigger occurs while counting, the counter reloads the reload register to continue counting
after generating a retrigger and decrementing once. To generate a trigger while counting, generate a
retrigger after at least one cycle of the timer count source has elapsed following the previous trigger.
When an external trigger is generated, do not generate a retrigger for 300 ns before the count value
becomes 0000h. The one-shot timer may stop counting.
Summary of Contents for M16C Series
Page 846: ...M16C 64C Group R01UH0092EJ0110...