MCBSTM32EXL Keil, MCBSTM32EXL Datasheet - Page 343

no-image

MCBSTM32EXL

Manufacturer Part Number
MCBSTM32EXL
Description
BOARD EVALUATION FOR STM32F103ZE
Manufacturer
Keil
Datasheets

Specifications of MCBSTM32EXL

Lead Free Status / RoHS Status
Lead free / RoHS Compliant
RM0008
14.3.11
The OPM waveform is defined by writing the compare registers (taking into account the
clock frequency and the counter prescaler).
In our example, the DIR and CMS bits in the TIMx_CR1 register should be low.
You only want 1 pulse, so you write ‘1’ in the OPM bit in the TIMx_CR1 register to stop the
counter at the next update event (when the counter rolls over from the auto-reload value
back to 0).
Particular case: OCx fast enable:
In One Pulse Mode, the edge detection on TIx input set the CEN bit which enables the
counter. Then the comparison between the counter and the compare value makes the
output toggle. But several clock cycles are needed for these operations and it limits the
minimum delay t
If you want to output a waveform with the minimum delay, you can set the OCxFE bit in the
TIMx_CCMRx register. Then OCxRef (and OCx) is forced in response to the stimulus,
without taking in account the comparison. Its new level is the same as if a compare match
had occurred. OCxFE acts only if the channel is configured in PWM1 or PWM2 mode.
Clearing the OCxREF signal on an external event
The OCxREF signal for a given channel can be reset by applying a High level on the ETRF
input (OCxCE enable bit of the corresponding TIMx_CCMRx register set to ‘1’). The
OCxREF remains low until the next update event, UEV, occurs.
This function can be only used in output compare mode and PWM mode. It does not work in
forced mode.
For example, the OCxREF signal can be connected to the output of a comparator to be used
for current handling. In this case, the ETR must be configured as follow:
1.
2.
3.
Figure 132
for both values of the enable bit OCxCE. In this example, the timer TIMx is programmed in
PWM mode.
The t
The t
value (TIMx_ARR - TIMx_CCR1).
Let’s say you want to build a waveform with a transition from ‘0’ to ‘1’ when a compare
match occurs and a transition from ‘1’ to ‘0’ when the counter reaches the auto-reload
value. To do this you enable PWM mode 2 by writing OC1M=111 in the TIMx_CCMR1
register. You can optionally enable the preload registers by writing OC1PE=’1’ in the
TIMx_CCMR1 register and ARPE in the TIMx_CR1 register. In this case you have to
write the compare value in the TIMx_CCR1 register, the auto-reload value in the
TIMx_ARR register, generate an update by setting the UG bit and wait for external
trigger event on TI2. CC1P is written to ‘0’ in this example.
The external trigger prescaler should be kept off: bits ETPS[1:0] of the TIMx_SMCR
register set to ‘00’.
The external clock mode 2 must be disabled: bit ECE of the TIM1_SMCR register set to
‘0’.
The external trigger polarity (ETP) and the external trigger filter (ETF) can be
configured according to the user needs.
PULSE
DELAY
shows the behavior of the OCxREF signal when the ETRF Input becomes High,
is defined by the value written in the TIMx_CCR1 register.
is defined by the difference between the auto-reload value and the compare
DELAY
min we can get.
Doc ID 13902 Rev 9
General-purpose timer (TIMx)
343/995

Related parts for MCBSTM32EXL