cancel
Showing results for 
Search instead for 
Did you mean: 

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

AMova.2
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

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.

View solution in original post

1 REPLY 1
Foued_KH
ST Employee

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.