Skip to main content
AMova.2
Associate II
March 15, 2023
Solved

Using STM32WB55 Based on 32 KHz LSE how can we generate 40 KHz signal.

  • March 15, 2023
  • 1 reply
  • 1407 views

Dear all,

How can we generate a 40 KHz signal based on LSE (32KHz crystal)?

If I Feed the HSE 32MHz / 32 to run the either LPTIMER's would it be still in low power?

Thanks,

mmsya.

This topic has been closed for replies.
Best answer by Foued_KH

Hello @Community member​ ,

  1. Enable the LSE crystal as the clock source for the RTC (Real-Time Clock) peripheral.
  2. Enable the LPTIM peripheral and configure it to run in PWM mode.
  3. Set the LPTIM's prescaler and ARR (Auto Reload Register) values to generate a 40 kHz PWM signal.
  4. Configure the LPTIM's compare register to generate the desired duty cycle for the PWM signal.
  5. Enable the PWM output on the LPTIM's corresponding GPIO pin

Foued

1 reply

Foued_KH
Foued_KHBest answer
ST Employee
March 17, 2023

Hello @Community member​ ,

  1. Enable the LSE crystal as the clock source for the RTC (Real-Time Clock) peripheral.
  2. Enable the LPTIM peripheral and configure it to run in PWM mode.
  3. Set the LPTIM's prescaler and ARR (Auto Reload Register) values to generate a 40 kHz PWM signal.
  4. Configure the LPTIM's compare register to generate the desired duty cycle for the PWM signal.
  5. 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.