2017-03-01 07:29 AM
I'm working with STM32L475 and I'm using LPTIM to create a PWM signal. LSE clock is used (because I will use Stop mode), and period is set to 31 in ordet to generate 1kHz signal. PWM is working fine and dutycycle is modified according to the pulse value I set to the 'HAL_LPTIM_PWM_Start' function. Nevertheless, when I try to set PWM signal to 100% or 0%, the output signal looks similar to the one I have when dutycycle is set to 99% or 1%. Do you know why I get such behaviour?
#lptim #stm32l4 #pwmSolved! Go to Solution.
2017-03-01 03:39 PM - edited 2024-08-21 02:23 PM
Posted on March 02, 2017 at 00:39
This is the limitation of LPTIMs hardware. The period is (LPTIM_ARR+1) x prescaled_clock_cycle, and pulse width is (LPTIM_CMP+1) x prescaled_clock_cycle, with LPTIM_CMP = 0...(LPTIM_ARR-1), as required by RM.
Pity the RM does not explain this clearly.
JW
2017-03-01 03:39 PM - edited 2024-08-21 02:23 PM
Posted on March 02, 2017 at 00:39
This is the limitation of LPTIMs hardware. The period is (LPTIM_ARR+1) x prescaled_clock_cycle, and pulse width is (LPTIM_CMP+1) x prescaled_clock_cycle, with LPTIM_CMP = 0...(LPTIM_ARR-1), as required by RM.
Pity the RM does not explain this clearly.
JW