CMT2380F64
www. cmostek. com
64 / 83
RTC provides automatic wake up in low power mode. When a timestamp function event or intrusion detection event is
enabled on GPIO, the current calendar is saved in a register.
5.10 Timer and Watch Dog
CMT2380F64 supports 2 advanced-control timers, 1 general-purpose timer, 1 basic timer and 1 low-power timer, as well as
2 watchdog timers and 1 system tick timer.
The following table compares the functions of advanced -control timers, general -purpose timers and basic
timers:
Table 5-1. Timer function comparison
Timer
Counter
resolution
Counter
type
Prescaler
Generate
DMA
request
Capture/
Compare
channel
Complementary
output
TIM1
TIM8
16 bits
Up
Down
Up/Down
Any integer
between
1~65536
support
4
support
TIM3
16 bits
Up
Down
Up/Down
Any integer
between
1~65536
support
4
unsupport
LPTIM
16 bits
Up
2
N
,
N represents
for any integer
between 0~7
unsupport
2
unsupport
TIM6
16 bits
Up
Any integer
between
1~65536
support
0
unsupport
5.10.1 Basic timer TIM6
The basic timer (TIM6) contains a 16-bit auto-load counter, driven by a programmable prescaler. It can provide a time base for
general-purpose timers.
The main functions of the basic timer are as follows:
◆
16 bit automatic reload accumulating counter
;
◆
16 bit programmable (can be modified in real time ) prescaler
,
used to divide the input clock by coefficient
between 1 and 65536
;
◆
Interrupt / DMA request is generated when an update event (counter overflow) occurs.
5.10.2
General purpose timer TIM3
CMT2380F64 has a built-in general-purpose timer (TIM3) that can run synchronously. The timer has a 16-bit
auto-loading up/down counter, a 16-bit prescaler and 4 independent channels. Each channel can be used for input
capture (for measuring pulse width), output comparison, PWM and single pulse mode output.
The main functions of the general-purpose timer include
:
◆
16 bit up,down, up/down automatic loading counter
;
◆
16 bit programmable (can be modified in real time) prescaler, the frequncy division coefficient of the counter
clock frequncy is any value between 1
~
65536
;
◆
4 independent channels
:
⚫
Input capture
;
⚫
Output comparision
;
⚫
PWM generation (edge or center alignment mode)
;
⚫
Single pulse mode output
;
◆
Use external signals to control the timer or the synchronization circuit when multiple timers are interconnected
;
◆
Interrupt /DMA is generated when the following events occur
:
◆
Update
:
counter overflow/downflow, counter initialization (trigger through software or internal/external)
;