![](http://datasheet.mmic.net.cn/90000/ML66Q525-NTB_datasheet_3507944/ML66Q525-NTB_194.png)
ML66525 Family User’s Manual
Chapter 8
General-Purpose 8/16-Bit Timers
8 - 31
8.8.3 Example of Timer 6-related Register Settings
Auto-reload timer mode settings
(1)
General-purpose 8-bit timer 6 counter (TM6C)
Set the timer value that will be valid at the start of counting.
When writing to TM6C, the
same value will also be simultaneously and automatically written to the general-purpose 8-bit
timer 6 register (TM6R).
(2)
General-purpose 8-bit timer 6 register (TM6R)
This register sets the value to be loaded after general-purpose 8-bit timer 6 counter (TM6C)
overflows.
If the timer value (TM6C) and the reload value (TM6R) are identical, this register
will automatically be set just by setting TM6C.
If the values are different or are to be
modified, this register must be set explicitly.
(3)
General-purpose 8-bit timer 6 control register (TM6CON)
Bits 0 to 2 (WDTC0 to WDTC2) of this register specify the count clock for timer 6.
If bit 3
(ATMRUN) is set to “1”, timer 6 will begin counting.
If reset to “0”, timer 6 will halt
counting.
Watchdog timer (WDT) mode settings
(1)
General-purpose 8-bit timer 6 register (TM6R)
This register sets the value to be loaded into general-purpose 8-bit timer 6 counter (TM6C).
(2)
General-purpose 8-bit timer 6 control register (TM6CON)
(i) Specify the count clock for timer 6 with bits 0 to 2 (WDTC0 to WDTC2) of this register.
(ii) Set bit 7 (MODWDT) to “1” to enter the WDT mode.
(Settings (i) and (ii) can be performed simultaneously by using a byte instruction such as
MOVB.)
(3)
General-purpose 8-bit timer 6 counter (TM6C)
Write the WDT activation code, “n3H”, to start WDT counting.
(At this time, the contents of TM6C are not modified.
“n3H” is only used to activate WDT.)
Thereafter, WDT is initialized by alternately writing “nCH” and “n3H” before overflow.
WDTLDE (bit 6) of TM6CON can be read to determine whether the value to be written for the
next initialization is “nCH” or “n3H”.
“WDT initialization” is defined as loading the value of
TM6R into TM6C.
(n is an arbitrary value from 0 to F.)