Chapter 7
16-bit Timers
VII - 22
Operation
(C)
Even if the preset register is rewritten when the TMnEN flag is ("1"), the binary counter is not
changed.
(D)
When the binary counter reaches value of compare register 1, the set value of the preset
register is loaded to the compare register at the next count clock. And the interrupt request
flag is set at the next count clock, and the binary counter is cleared to x'0000' to restart
counting up.
(E)
When the TMnEN flag is ("0"), the binary counter is stopped.
When the binary counter reaches the value of the compare register, the interrupt request flag
is set at the next count clock, and the binary counter is cleared. So set the compare register
as;
(the set value of the compare register) = (the counts till the interrupt generation - 1)
When timer n compare register 2 match interrupt is generated and TMnOC1 compare match
is selected as a binary counter clear source, the set value of the compare register 2 should
be smaller than the set value of the compare register 1.
On the interrupt service routine, clear the timer interrupt request flag before the timer is
started.
At TMnOC=x'0000', x'0001', the timer n interrupt request generation has the same wave-
form.
When more than 2 waits is set at access to the special register area by the IOW1, IOW0 flag
of the MEMCTR register, write the same value 2 times at setup of the preset register when
the timer is stopped. When 1 wait or no wait is set, there is no need to do this.
(This is for the functions of a 16-bit timer.)
[
Chapter 2 2-3-2. Control Registers]
When data is written to the 16-bit timer preset register, even the MOVW instruction of 16-bit
access is counted as a 8-bit unit data. For this reason, if data is loaded from preset register
into compare register while the data is written, correct value may not be loaded.