
ML66517 Family User’s Manual
Chapter 8
General-Purpose 8/16 Bit Timers
8 – 11
8.5.2 Description of Timer 1 and 2 Registers
(1) General-purpose 8-bit timer 1 and 2 counters (TM1C, TM2C)
The general-purpose 8-bit timer 1 and 2 counters (TM1C, TM2C) are 8-bit up-counters. When each counter
overflows, an interrupt request is generated and that counter is loaded with the contents of the
general-purpose 8-bit timer 1 or 2 register (TM1R, TM2R).
TM1C and TM2C can be read from and written to by the program.
When reset (
RES signal input, execution of a BRK instruction, overflow of the watchdog timer, opcode
trap), the contents of TM1C and TM2C are undefined.
[Note]
Writing a timer value to TM1C or TM2C causes the same value to also be written to the general-purpose
8-bit timer 1 and 2 registers (TM1R, TM2R).
(2) General-purpose 8-bit timer 1 and 2 registers (TM1R, TM2R)
The general-purpose 8-bit timer 1 and 2 registers (TM1R, TM2R) consist of 8 bits. These registers store the
value to be reloaded into the general-purpose 8-bit timer 1 or 2 counter (TM1C, TM2C).
TM1R and TM2R can be read from and written to by the program.
When reset (
RES signal input, execution of a BRK instruction, overflow of the watchdog timer, opcode
trap), the contents of TM1R and TM2R are undefined.
(3) General-purpose 8-bit timer 1 control register (TM1CON)
The general-purpose 8-bit timer 1 control register (TM1CON) consists of 5 bits. Bits 0 to 2 (TM1C0 to
TM1C2) of TM1CON select the timer 1 count clock, bit 3 (TM1RUN) starts or stops the counting, and bit 7
(TM1OUT) specifies the initial timer output level (High or Low) at start-up. The value of bit 7 (TM1OUT)
is inverted when TM1C overflows.
TM1CON 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 (
RES signal input, execution of a BRK instruction, overflow of the watchdog timer, opcode
trap), TM1CON becomes 70H.
Figure 8-5 shows the TM1CON configuration.