Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
184
/
631
‘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
the pulse width t
PULSE
;
5. Configure TIMx_CTRL1.ONEPM=1 to enable single pulse mode, configure TIMx_CCMOD1.OC1MD = ‘111’to
select PWM2 mode;
6. Wait for an external trigger event on TI2, and a one pulse waveform will be output on OC1;
Special case: OCx fast enable:
In one-pulse mode, an edge is detected through the TIx input, and triggers the start of the counter to count to the
comparison value and then output a pulse. These operations limit the minimum delay t
DELAY
that can be achieved.
You can set TIMx_CCMODx.OCxFEN=1 to turn on OCx fast enable, after triggering the rising edge, the OCxREF
signal will be forced to be converted to the same level as the comparison match occurs immediately, regardless of
the comparison result. OCxFEN fast enable only takes effect when the channel mode is configured for PWM1 and
PWM2 modes.
Clearing the OCxREF signal on an external event
If user set TIMx_CCMODx.OCxCEN=1, high level of ETRF input can be used to driven the OCxREF signal to low,
and the OCxREF signal will remains low, until the next UEV happens. Only output compare and PWM modes can
use this function. This cannot be used when it is in forced mode.
Here is an example for it. To control the current, user can connect the ETR signal to the output of a comparator, and
the operation for ETR should be as follow:
Set TIMx_SMCTRL.EXTPS=00 to disable the external trigger prescaler.
Set TIMx_SMCTRL.EXCEN=0 to disable the external clock mode 2.
Set TIMx_SMCTRL.EXTP and TIMx_SMCTRL.EXTF to configure the external trigger polarity and external
trigger filter according to the need.
Here is an example for the case that when ETRF input becomes high, the behavior of OCxREF signal for different
value of OCxCEN. Timer is set to be in PWM mode in this case.