Waveform Generation - ST STM32L4x6 Reference Manual

Table of Contents

Advertisement

RM0351
30.4.8

Waveform generation

Two 16-bit registers, the LPTIMx_ARR (autoreload register) and LPTIMx_CMP (Compare
register), are used to generate several different waveforms on LPTIM output
The timer can generate the following waveforms:
The PWM mode: the LPTIM output is set as soon as a match occurs between the
LPTIMx_CMP and the LPTIMx_CNT registers. The LPTIM output is reset as soon as a
match occurs between the LPTIMx_ARR and the LPTIMx_CNT registers
The One-pulse mode: the output waveform is similar to the one of the PWM mode for
the first pulse, then the output is permanently reset
The Set-once mode: the output waveform is similar to the One-pulse mode except that
the output is kept to the last signal level (depends on the output configured polarity).
The above described modes require that the LPTIMx_ARR register value be strictly greater
than the LPTIMx_CMP register value.
The LPTIM output waveform can be configured through the WAVE bit as follow:
Resetting the WAVE bit to '0' forces the LPTIM to generate either a PWM waveform or
a One pulse waveform depending on which bit is set: CNTSTRT or SNGSTRT.
Setting the WAVE bit to '1' forces the LPTIM to generate a Set-once mode waveform.
The WAVPOL bit controls the LPTIM output polarity. The change takes effect immediately,
so the output default value will change immediately after the polarity is re-configured, even
before the timer is enabled.
Signals with frequencies up to the LPTIM clock frequency divided by 2 can be generated.
Figure 345
output. Also, it shows the effect of the polarity change using the WAVPOL bit.
below shows the three possible waveforms that can be generated on the LPTIM
DocID024597 Rev 3
Low-power timer (LPTIM)
1029/1693
1045

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32L4x6 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF