Nations Technologies Inc.
Tel
:
+86-755-86309900
:
info@nationstech.com
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
249
/
631
Note: If the nth PWM cycle CCDATx shadow register >= AR value, the shadow register value of CCDATx in the
(n+1)th PWM cycle is 0. At the moment when the counter is 0 in the (n+1)th PWM cycle, although the value of the
counter = CCDATx shadow register = 0 and OCxREF = '0', no compare event will be generated
.
One-pulse mode
In the one-pulse mode (ONEPM), a trigger signal is received, and a pulse t
PULSE
with a controllable pulse width is
generated after a controllable delay t
DELAY
. The output mode needs to be configured as output compare mode or PWM
mode. After selecting one-pulse mode, the counter will stop counting after the update event UEV is generated.
Figure 11-20 Example of One-pulse mode
The following is an example of a one-pulse mode:
A rising edge trigger is detected from the TI2 input, and a pulse with a width of t
PULSE
is generated on OC1 after a
delay of t
DELAY
.
1. Counter configuration: count up, counter TIMx_CNT < TIMx_CCDAT1 ≤ TIMx_AR;
2. TI2FP2 is mapped to TI2, TIMx_CCMOD1.CC2SEL= ‘01’; TI2FP2 is configured for rising edge detection,
TIMx_CCEN.CC2P= ‘0’;
3. TI2FP2 acts as the trigger (TRGI) of the slave mode controller and starts the counter, TIMx_SMCTRL.TSEL=
‘110’, TIMx_SMCTRL.SMSEL= ‘110’ (trigger mode);
4. TIMx_CCDAT1 writes the count value to be delayed (t
DELAY
), TIMx_AR - TIMx_CCDAT1 is the count value of
TI2
OC1
OCxREF
t
TIMx_AR
TIMx_CCDAT1
Counter
t
DELAY
t
PULSE
0