
8-13
MSM66577 Family User's Manual
Chapter 8 General-Purpose 8/16 Bit Timers
8
8.5.3 Example of Timer 1- and 2-related Register Settings
8-bit auto-reload timer mode (Timer 1)
(1)
Port 6 mode register (P6IO)
If TM1OUT (timer output) is to be used, set bit 5 (P6IO5) to "1" to configure the port as an
output. If TM1EVT (event input) is to be used, reset bit 4 (P6IO4) to "0" to configure the port
as an input.
(2)
Port 6 secondary function control register (P6SF)
If TM1OUT (timer output) is to be used, set bit 5 (P6SF5) to "1" to configure the port as a
secondary function output. If TM1EVT (event input) is to be used, disable or enable the pull-
up resistor with bit 4 (P6SF4).
(3)
General-purpose 8-bit timer 1 counter (TM1C)
Set the timer value that will be valid at the start of counting. When writing to TM1C, the same
value will also be simultaneously and automatically written to the general-purpose 8-bit
timer 1 register (TM1R).
(4)
General-purpose 8-bit timer 1 register (TM1R)
This register sets the value to be loaded after general-purpose 8-bit timer 1 counter (TM1C)
overflows. If the timer value (TM1C) and the reload value (TM1R) are identical, this register
will automatically be set just by setting TM1C. If the values are different or are to be
modified, this register must be set explicitly.
(5)
General-purpose 8-bit timer 1 control register (TM1CON)
Bits 9 to 0 (TM1C0 to TM1C2) of this register specify the count clock for timer 1. If TM1OUT
(timer output) is to be used, specify the initial value with bit 7 (TM1OUT). If bit 3 (TM1RUN)
is set to "1", timer 1 will begin counting. If reset to "0", timer 1 will halt counting.
8-bit auto-reload timer mode (Timer 2)
(1)
Port 6 mode register (P6IO)
If TM2OUT (timer output) is to be used, set bit 7 (P6IO7) to "1" to configure the port as an
output. If TM2EVT (event input) is to be used, reset bit 6 (P6IO6) to "0" to configure the port
as an input.
(2)
Port 6 secondary function control register (P6SF)
If TM2OUT (timer output) is to be used, set bit 7 (P6SF7) to "1" to configure the port as a
secondary function output. If TM2EVT (event input) is to be used, disable or enable the pull-
up resistor with bit 6 (P6SF6).
(3)
General-purpose 8-bit timer 2 counter (TM2C)
Set the timer value that will be valid at the start of counting. When writing to TM2C, the same
value will also be simultaneously and automatically written to the general-purpose 8-bit
timer 2 register (TM2R).