
ML66525 Family User’s Manual
Chapter 8
General-Purpose 8/16-Bit Timers
8 - 4
8.4.2 Description of Timer 0 Registers
(1)
General-purpose 16-bit timer 0 counter (TM0C)
The general-purpose 16-bit timer 0 counter (TM0C) is a 16-bit up-counter.
When this counter
overflows, an interrupt request is generated and it is loaded with the contents of
general-purpose 16-bit timer 0 register (TM0R).
TM0C can be read from and written to by the program.
When reset (RESn signal input, execution of a BRK instruction, overflow of the watchdog
timer, opcode trap), the contents of TM0C are undefined.
[Note]
Writing a timer value to TM0C causes the same value to also be written to the
general-purpose 16-bit timer 0 register (TM0R).
(2)
General-purpose 16-bit timer 0 register (TM0R)
The general-purpose 16-bit timer 0 register (TM0R) consists of 16 bits.
This register stores
the value to be reloaded into the general-purpose 16-bit timer 0 counter (TM0C).
TM0R can be read from and written to by the program.
When reset (RESn signal input, execution of a BRK instruction, overflow of the watchdog
timer, opcode trap), the contents of TM0R are undefined.
(3)
General-purpose 16-bit timer 0 control register (TM0CON)
The general-purpose 16-bit timer 0 control register (TM0CON) consists of 5 bits.
Bits 0 to 2
(TM0C0 to TM0C2) of TM0CON select the timer 0 count clock, bit 3 (TM0RUN) starts or
halts the counting, and bit 7 (TM0OUT) specifies the initial timer output level (High or Low)
at start-up.
And each time TM0C overflows, the content of bit 7 (TM0OUT) is reversed.
TM0CON can be read from and written to by the program.
However, write operations are
invalid for bits 4 to 6.
If read, a value of “1” will always be obtained for bits 4 to 6.
When reset (RESn signal input, execution of a BRK instruction, overflow of the watchdog
timer, opcode trap), TM0CON becomes 70H.
Figure 8-2 shows the TM0CON configuration.
[Note]
Just before TM0C overflows, if an SB, RB, XORB or other read-modify-write instruction is
performed on TM0CON, then TM0OUT may not operate correctly.