ML610Q111/ML610Q112 User’s Manual
Chapter 8 Timers
FEUL610Q111
8-35
8.3 Description of Operation
8.3.1
Timer basic operation
When the TnRUN bit of timer 8 to B,E,F control register 1 (TMnCON1) is set to “1”, the timer counter (TMnC) is set to an
operating state (TnSTAT is set to “1”) on the first falling edge of the timer clock (TnCK) being selected by the Timer 8 to
B,E,F control register 0 (TMnCON0). Then, the timer counter (TMnC) starts incrementing on the 2nd falling edge.
When the count value of TMnC and the timer 8 to B,E,F data register (TMnD) coincide, timer 8 to B,E,F interrupt
(TMnINT) occurs on the next timer clock falling edge and at the same time, TMnC is reset to “00H” and continues
incrementing.
Whenever the value of the count value of TMnC and the preset value of a timer n data register (TMnD) is matched , the
output value of timer output (TM9OUT, TMFOUT) is reversed. This timer output can be outputted outside as fourthly
function of a port A. Timer out is set to "0" to the time of system reset, and a timer count stop.
When the TnRUN bit is set to “0”, TMnC stops incrementing after counting the falling of the timer clock (TnCK) once.
Confirm that TMnC has been stopped by checking that the TnSTAT bit of the Timer 8 to B,E,F control register 1
(TMnCON1) is “0”. When the TnRUN bit is set to “1” again, TMnC restarts incrementing from the previous value. To
initialize TMnC to “00H”, perform a write operation to TMnC.
The timer interrupt period (T
TMI
) is expressed by the following equation.
T
TMI
=
TMnD + 1
(n =
8 to B,E,F
)
TnCK (Hz)
TMnD: Timer 8 to B,E,F data register (TMnD) setting value (01H to 0FFH)
TnCK:
Clock frequency selected by the Timer 8 to B,E,F control register 0 (TMnCON0)
After the TnRUN bit is set to “1”, the timer is synchronized by the timer clock to start counting. Therefore, an error of a
maximum of 1 clock period occurs until the first timer interrupt occurs. The timer interrupt periods from the second time
onward are constant.
Figure 8-2 shows the continuous mode operation timing diagram of Timer 8 to B,E,F.
Figure 8-2 Continuous mode Operation Timing Diagram of Timer 8 to B,E,F
Note
:
Even if “0” is written to the TnRUN bit, counting operation continues up to the falling edge (the timer 8 to B,E,F status flag
(TnSTAT) is in a “1” state) of the next timer clock pulse. Therefore, the timer 8 to B,E,F interrupt (TMnINT) may occur.
During a timer stop, an external-triggering stop becomes invalid until TnSTAT will be set to "1", if a TnRUN bit is set "1".
Moreover, when the timer is running, an external-triggering start becomes invalid until TnSTAT will be set to "0", if a
TnRUN bit is set "0".
TMnC
XX
00
88
TMnD
TMnINT
TnSTAT
Write TMnC
TnCK
TnRUN
01
02
87
88
00
87
88
02
01
88
88
(n=8 to B,E,F)
T
TMI
00
01
T
TMI
TMmOUT
(m=9, F)
Summary of Contents for ML610Q111
Page 1: ...ML610Q111 ML610Q112 User s Manual Issue Date Nov 16 2016 FEUL610Q111 05 ...
Page 14: ...Chapter 1 Overview ...
Page 26: ...Chapter 2 CPU and Memory Space ...
Page 34: ...Chapter 3 Reset Function ...
Page 38: ...Chapter 4 MCU Control Function ...
Page 53: ...Chapter 5 Interrupts INTs ...
Page 81: ...Chapter 6 Clock Generation Circuit ...
Page 95: ...Chapter 7 Time Base Counter ...
Page 103: ...Chapter 8 Timers ...
Page 145: ...Chapter 9 Watchdog Timer ...
Page 153: ...Chapter 10 PWM ...
Page 199: ...Chapter 11 Synchronous Serial Port ...
Page 212: ...Chapter 12 UART ...
Page 240: ...Chapter 13 I2 C Bus Interface Master ...
Page 254: ...Chapter 14 I2 C Bus Interface Slave ...
Page 269: ...Chapter 15 Port A ...
Page 279: ...Chapter 16 Port B ...
Page 291: ...Chapter 17 Port C ...
Page 303: ...Chapter 18 Port D ...
Page 312: ...Chapter 19 Port AB Interrupts ...
Page 317: ...Chapter 20 Successive Approximation Type A D Converter ...
Page 335: ...Chapter 21 Voltage Level Supervisor ...
Page 342: ...Chapter 22 Analog Comparator ...
Page 353: ...Chapter 23 Data Flash Memory ...
Page 373: ...Chapter 24 On chip Debug ...
Page 375: ...Appendixes ...
Page 393: ...Appendix E ...
Page 398: ...Revision History ...