
NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 324 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
counting initial value then timer counter enable bit CE (TMRx_CSR[30]) is cleared to 0 by timer
controller automatically. That is to say, timer operates timer counting and compares with TCMP
(TMRx_CMPR[23:0]) value function only one time after programming the timer compare register
TCMP (TMRx_CMPR[23:0]) value and timer counter enable bit CE (TMRx_CSR[30]) is set to 1. So,
this operating mode is called One-shot mode.
Periodic Mode
5.10.5.2
If the timer is operated in Periodic mode (MODE (TMRx_CSR[28:27]) is 0x1) and timer counter enable
bit CE (TMRx_CSR[30]) is set to 1, the timer counter starts up counting. Once the timer counter value
(TMRx_DR) reaches timer compare register (TMRx_CMPR) value, the interrupt signal will be asserted
then timer interrupt flag TIF (TMRx_ISR[0]) will set to 1 if timer interrupt enable bit IE=0
(TMRx_CSR[29]=1). If IE (TMRx_CSR[29]) is set to 0, the timer interrupt flag TIF (TMRx_ISR[0]) will
not be set to 1.
In this operating mode, once the timer counter value TDR (TMRx_DR[23:0]) reaches timer compare
register TCMP (TMRx_CMPR[23:0]) value and IE (TMRx_CSR[29]) set to 1, timer interrupt flag TIF
(TMRx_ISR[0]) will set to 1, the timer counter value TDR (TMRx_DR[23:0]) goes back to counting
initial value and timer counter enable bit CE (TMRx_CSR[30]) is kept at 1 (counting enable
Periodically) and timer counter operates up counting again. If timer interrupt flag TIF (TMRx_ISR[0]) is
cleared by software, once the timer counter value TDR (TMRx_DR[23:0]) reaches timer compare
register TCMP (TMRx_CMPR[23:0]) value again, TIF (TMRx_ISR[0]) will set to 1 also. That is to say,
timer operates timer counting and compares with TCMP (TMRx_CMPR[23:0]) value function
periodically. The timer counting operation does not stop until the timer counter enable bit CE
(TMRx_CSR[30]) is set to 0. The interrupt signal is also generated periodically. So, this operating
mode is called Periodic mode.
Continuous Mode
5.10.5.3
If the timer is operated in Continuous mode (MODE (TMRx_CSR[28:27]) is 0x3) and timer counter
enable bit CE (TMRx_CSR[30]) is set to 1, the timer counter starts up counting. The 24-bit timer
counter in Continuous mode will keep counting until the counting value reaches to the maximum value
(0xFFFFFF), then timer counter value TDR (TMRx_DR[23:0]) will be reset to 0x0 and keep up
counting while CE=1 (TMRx_CSR[30]=1).
Once the timer counter value TDR (TMRx_DR[23:0]) is equal to the timer compare register TCMP
(TMRx_CMPR[23:0]) value and timer interrupt enable bit IE (TMRx_CSR[29]) is set to 1, the timer
interrupt flag TIF (TMRx_ISR[0]) will set to 1. If IE (TMRx_CSR[29]) is set to 0, TIF (TMRx_ISR[0]) will
not be asserted. In Continuous mode, changing the value of compare register TCMP
(TMRx_CMPR[23:0]) will not affect the current value of TDR (TMRx_DR[23:0]), but it will clear timer
counter value TDR (TMRx_DR[23:0]) to 0x0 in other operation modes. User can change the compare
register TCMP (TMRx_CMPR[23:0]) at any time and the timer counter will keep up counting
continuously to generate the new interrupt event. So, this operating mode is called Continuous mode.