ML66525 Family User’s Manual
Chapter 8
General-Purpose 8/16-Bit Timers
8 - 16
8.6.2 Description of Timer 4 Registers
(1)
General-purpose 8-bit timer 4 counter (TM4C)
The general-purpose 8-bit timer 4 counter (TM4C) is an 8-bit up-counter.
When this counter
overflows, an interrupt request is generated and it is loaded with the contents of
general-purpose 8-bit timer 4 register (TM4R).
TM4C can also be used as a baud rate
generator for SIO1.
TM4C 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 TM4C are undefined.
[Note]
Writing a timer value to TM4C causes the same value to also be written to the
general-purpose 8-bit timer 4 register (TM4R).
(2)
General-purpose 8-bit timer 4 register (TM4R)
The general-purpose 8-bit timer 4 register (TM4R) consists of 8 bits.
This register stores the
value to be reloaded into the general-purpose 8-bit timer 4 counter (TM4C).
TM4R 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 TM4R are undefined.
(3)
General-purpose 8-bit timer 4 control register (TM4CON)
The general-purpose 8-bit timer 4 control register (TM4CON) consists of 5 bits.
Bits 0 to 2
(TM4C0 to TM4C2) of TM4CON select the timer 4 count clock, bit 3 (TM4RUN) starts or
halts the counting, and bit 7 (TM4OUT) specifies the initial timer output level (High or Low)
at start-up. And each time TM4C overflows, the content of bit 7 (TM4OUT) is reversed.
TM4CON 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), TM4CON becomes 70H.
Figure 8-8 shows the TM4CON configuration.
[Note]
Just before TM4C overflows, if an SB, RB, XORB or other read-modify-write instruction is
performed on TM4CON, then TM4OUT may not operate correctly.