Timer nRF52833 problem when using PWM+ble_app_uart+libuartes

Hi I'm developing an application using using PWM+ble_app_uart+libuartes.  So I have 2 questions
1. I'm using PWM to ring the buzzer a simple  melody.
What is the example I should you ?And what is common frequency when using PWM to rinng the buzzer?
2. I merger the code ble_app_uart and libuartes using 2 libuartes and It's work fine. I find that this application using 3 Timers. Soft Device(Timer0), Timer1, Timer2 used for libuartes.
According to nRF52833 document, nRF52833 have 5 Timers. So how can I use the rest timers for PWM (initialize, generate..)? 
Thank you, hope your reply soon !

Parents
  • Hello,

    What is the example I should you ?And what is common frequency when using PWM to rinng the buzzer?

    That depends on the buzzer, I guess. Just remember that buzzers typically changes tone on frequency, and not PWM duty cycle. So try setting the duty cycle to 50%, and change the frequency to change the tone. 

    2. I merger the code ble_app_uart and libuartes using 2 libuartes and It's work fine. I find that this application using 3 Timers. Soft Device(Timer0), Timer1, Timer2 used for libuartes.
    According to nRF52833 document, nRF52833 have 5 Timers. So how can I use the rest timers for PWM (initialize, generate..)? 

    That is correct. I believe you don't need more than one timer for the PWM.

    BR,
    Edvin

  • That depends on the buzzer, I guess. Just remember that buzzers typically changes tone on frequency, and not PWM duty cycle. So try setting the duty cycle to 50%, and change the frequency to change the tone.

    Hi Edvin, 

    Can you give me the example and the main function that show how to implement this quote. ?

    I'm new at PWM and I want to build an simple feature with my buzzer quickly. 

    Thank Edvin

  • I suggest you check out the app_pwm example. It doesn't really use the PWM peripheral, but a timer. I think this is simpler to use, and the example SDK\examples\peripheral\app_pwm shows how to use it quite easily.

    BR,

    Edvin

Reply Children
No Data
Related