
ML62Q1000 Series User's Manual
Chapter 8 16-Bit Timer
FEUL62Q1000 8-19
8.3 Description of Operation
Two timer modes are available for the 16-bit timer:
ž
16-bit timer mode
ž
8-bit timer mode
8.3.1 16-Bit Timer Mode
When the THn8BM bit of the THnMOD register is set to "0", the timer operates in the 16-bit timer mode.
In the 16-bit timer mode, writing "1" to the THnRUN bit causes the 16-bit counter to start counting up in synchronization
with the rising edges of the timer clock.
If output of the general-purpose port is enabled by choosing the timer output (TMHnOUT) through the shared function
setting of the port, the output of the port is reversed when the timer count value matches with TMHnD register value. In
addition, writing "1" to the THnSTP bit during counting causes the counting to stop in synchronization with the timer
clock and the output of the port is reset to the initial value. For the the initial value of the port, "H" and "L" levels can be
chosen through the THnNEG bit of the HnMOD register.
In the 16-bit timer mode, following two operation modes are available:
ž
Repeat mode
ž
One-shot mode
8.3.1.1
Repeat Mode
Figure 8-3 shows the repeat mode operation in the 16-bit timer mode.
TMHnD
Register
value
TMHn
C
register
value
TMHnSTAT
TMHn Interrupt
TMHnOUT
Enable Port
Output
Start
timer
The count
value
matches
HiZ
Initial value
T
TMI
Stop
timer
Clear
TMHnC
Initial value
Figure 8-3 Repeat Mode Operation Timing in 16-Bit Timer Mode
In the repeat mode, when the timer count value matches with the TMHnD register, 16-bit timer n interrupt request
(TMnINT) is generated and the value of the port is reversed. Then, the timer count value automatically is reset to
"0x0000" and the counting up operation is resumed.
The TMnINT generation cycle and the port output reverse cycle can be expressed in the following formula:
T
TMI
=
TMHnD + 1
(n = 0 to 7)
THnCK (Hz)
TMHnD : TMHnD register setting value (0001H to 0FFFFH)
THnCK : Count clock frequency chosen in the TMHnMOD register
See Section 8.3.3.1 "Start/Stop Timing" for the timing of the timer start/stop and counting up. See Section 8.3.3.2
"External Input Count Timing" for the counting up timing when using the external input.
Summary of Contents for ML62Q1000 Series
Page 17: ...Chapter 1 Overview...
Page 112: ...Chapter 2 CPU and Memory Space...
Page 154: ...Chapter 3 Reset Function...
Page 166: ...Chapter 4 Power Management...
Page 196: ...Chapter 5 Interrupts...
Page 248: ...Chapter 6 Clock generation Circuit...
Page 274: ...Chapter 7 Low Speed Time Base Counter...
Page 291: ...Chapter 8 16 Bit Timer...
Page 320: ...Chapter 9 Functional Timer FTM...
Page 382: ...Chapter 10 Watchdog Timer...
Page 402: ...Chapter 11 Serial Communication Unit...
Page 456: ...Chapter 12 I2 C Bus Unit...
Page 491: ...Chapter 13 I2 C Master...
Page 512: ...Chapter 14 DMA Controller...
Page 531: ...Chapter 15 Buzzer...
Page 550: ...Chapter 16 Simplified RTC...
Page 559: ...Chapter 17 GPIO...
Page 594: ...Chapter 18 External Interrupt Function...
Page 612: ...Chapter 19 CRC Generator...
Page 632: ...Chapter 20 Analog Comparator...
Page 644: ...Chapter 21 D A Converter...
Page 655: ...Chapter 22 Voltage Level Supervisor...
Page 676: ...Chapter 23 Successive Approximation Type A D Converter...
Page 709: ...Chapter 24 Regulator...
Page 714: ...Chapter 25 Flash Memory...
Page 743: ...Chapter 26 Code Option...
Page 750: ...Chapter 27 LCD Driver...
Page 788: ...Chapter 28 On Chip Debug Function...
Page 795: ...Chapter 29 Safety Function...
Page 813: ...Appendix A...
Page 881: ...Revision History...