Hello @Community member ,
- Enable the LSE crystal as the clock source for the RTC (Real-Time Clock) peripheral.
- Enable the LPTIM peripheral and configure it to run in PWM mode.
- Set the LPTIM's prescaler and ARR (Auto Reload Register) values to generate a 40 kHz PWM signal.
- Configure the LPTIM's compare register to generate the desired duty cycle for the PWM signal.
- Enable the PWM output on the LPTIM's corresponding GPIO pin
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.