NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
237
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
6.8.5.5 Continuous Counting Mode
If timer controller is configured at continuous counting mode (TCSR[28:27] is 11) and CEN bit is
set, the timer counter starts up counting. Once the TDR value reaches TCMP value, the TIF flag
will be set to 1 and TDR value keeps up counting. In the meantime, if the IE bit is enabled, the
timer interrupt signal is generated and sent to NVIC to inform CPU also. User can change
different TCMP value immediately without disabling timer counting and restarting timer counting in
this mode.
For example, TCMP value is set as 80, first. The TIF flag will set to 1 when TDR value is equal to
80, timer counter is kept counting and TDR value will not goes back to 0, it continues to count 81,
82, 83,˙˙˙ to 2
24
-
1, 0, 1, 2, 3, ˙˙˙ to 2
24
-1 again and again. Next, if software programs TCMP
value as 200 and clears TIF flag, the TIF flag will set to 1 again when TDR value reaches to 200.
At last, software programs TCMP as 500 and clears TIF flag, the TIF flag will set to 1 again when
TDR value reaches to 500.
In this mode, the timer counting is continuous. So, this operation mode is called as continuous
counting mode.
TDR = 0
Set
TCMPR = 80
TIF = 1 and
Interrupt
Generation
Clear TIF as 0
and Set
TCMPR = 200
TDR from 2
24
-1 to 0
TDR = 100
TDR = 200
TDR = 300
TDR = 400
TDR = 500
TDR = 2
24
-1
TIF = 1 and
Interrupt
Generation
Clear TIF as 0
and Set
TCMPR = 500
TIF = 1 and
Interrupt
Generation
Clear TIF as 0
and Set
TCMPR = 80
Figure 6.8-3 Continuous Counting Mode