Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
294
/
631
external clock source can be selected from GPIO.
For external clock source, the LPTIM has two configurations:
The LPTIM uses both external clock and internal clock.
The LPTIM only use external clock from comparator or external Input1. This configuration is suitable for LOW
POWER application.
LPTIM_CFG.CLKSEL and LPTIM_CFG.CNTMEN bits are used for the clock source configuration. The active
clock edge is configured through LPTIM_CFG.CLKPOL[1:0] bits.
When the LPTIM only uses external clock source, it can only select one active clock edge. LPTIM can select both
active clock edges only when it is using internal clock source or both external and internal clock sources.
Note: When both active edges for external clock, LPTIM needs to use an internal clock to oversample the external
clock. The internal clock frequency should be at least 4 times higher than the external clock frequency.
Prescaler
The LPTIM counter is preceded by a configurable power-of-2 pre-scaler. The prescaler ratio is controlled by the
LPTIM_CFG.CLKPRE[2:0] field. The table below lists all the possible division ratios:
Table 13-1 Pre-scaler division ratios
Control bits
The corresponding frequency division factor
000
/1
001
/2
010
/4
011
/8
100
/16
101
/32
110
/64
111
/128
Glitch filter
LPTIM has glitch filters for inputs to remove glitches and prevent unexpected counts or triggers.
Glitch filter needs an internal clock source to operate. And the clock source should be provided before the glitch filter
is enabled. This is necessary to guarantee the proper operation of the filters.
The glitch filters has two major purposes:
For the external inputs: The filter sensitivity is configured through the LPTIM_CFG.CLKFLT[1:0] bits.
For the internal trigger inputs: The filter sensitivity is configured through the LPTIM_CFG.RIGFLT[1:0] bits.
Note:
The detection configuration is only applicable for its corresponding inputs.
The filter sensitivity acts on the number of consecutive equal samples that should be detected on one of the LPTIM
inputs to consider a signal level change as a valid transition.
Figure 13-2 shows
an example of glitch filter behavior when detected a 2 consecutive samples.