NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 323 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
5.10.3 Block Diagram
Each timer is equipped with an 8-bit pre-scale counter, a 24-bit up-counter, a 24-bit compare register
and an interrupt request signal.
+
-
=
Timer
wakeup
WAKE_EN
(TMR0_CSR[23])
CRST
(TMR0_CSR[26])
CE
(TMR0_CSR[30])
TMR0_CLK
Reset counter
8-bit
Prescale
24-bit up counter
Power-down
24-bit TDR
(TMR0_DR[23:0])
24-bit TCMP
(TMR0_CMPR[23:0])
Reset counter
IE
(TMR0_CSR[29])
Q
Q
SET
CLR
D
TIF
(TMR0_ISR[0])
Q
Q
SET
CLR
D
TWKF
(TMR0_ISR[8])
Interrupt
status
Mode = 11
(TMR0_CSR[28:27])
Figure 5.10-1 Timer Controller Block Diagram
5.10.4 Basic Configuration
Before using Timer
, it’s necessary to enable clock of Timer. Set TIMER0 (CLK_PCLKEN0[8]), TIMER1
(CLK_PCLKEN0[9]), TIMER2 (CLK_PCLKEN0[10]), TIMER3 (CLK_PCLKEN0[11]), TIMER4
(CLK_PCLKEN0[12]) high to enable clock of each Timer.
5.10.5 Functional Description
Timer controller provides One-shot, Periodic, and Continuous operation modes. Each operating
function mode is shown as follows:
One-Shot Mode
5.10.5.1
If the timer is operated in One-shot mode when MODE (TMRx_CSR[28:27]) is 0x0 and the timer
counter enable bit CE (TMRx_CSR[30]) is set to 1, the timer counter starts up counting. Once the
timer counter value TDR (TMRx_DR[23:0]) reaches timer compare register TCMP
(TMRx_CMPR[23:0]) value, the timer interrupt signal will be asserted. If the timer interrupt signal is
asserted and the timer interrupt enable bit IE (TMRx_CSR[29]) is set to 1, the timer interrupt flag TIF
(TMRx_ISR[0]) will be asserted by hardware and then software can write 1 into TIF (TMRx_ISR[0]) bit
to clear it.
In this operating mode, once the timer counter value TDR (TMRx_DR[23:0]) reaches timer compare
register TCMP (TMRx_CMPR[23:0]) value will set the timer interrupt flag TIF (TMR_ISR[0]) to 1, then
timer counting operation stops and the timer counter value TDR (TMRx_DR[23:0]) goes back to