This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM in nRF51822

Hi, I am using nRF51822 to generate two channels PWM to control motors. Softdevice is V5.2.1. But I found the the Blue tooth connection sometimes dead if the PWM frequency is high. I set the frequency to 300Hz it ran well, but when I set the PWM frequency over 2kHz, the Blue tooth connection was dead after a random period. May I have an advice about the PWM frequency limitation without Blue tooth connection affection? Thanks.

Parents
  • Hi,

    PWM is not affecting you Bluetooth connection at all. It is the power_manage() api call which pulls the device for a sleep and from this the BUTTON or say WAKEUP_BUTTON should be configured.

    If you want to not to loose the BLE connection and PWM activity also goes on, then i shall say remove the power_manage() call from the end of main context loop and place it where you find it suitable to save energy.

    Apart from this, be careful about the timers you are using to get PWM running as softdevice will occupy the timer0. So drive the PWm on other left timers with priority 3 which is the leat app priority.

Reply
  • Hi,

    PWM is not affecting you Bluetooth connection at all. It is the power_manage() api call which pulls the device for a sleep and from this the BUTTON or say WAKEUP_BUTTON should be configured.

    If you want to not to loose the BLE connection and PWM activity also goes on, then i shall say remove the power_manage() call from the end of main context loop and place it where you find it suitable to save energy.

    Apart from this, be careful about the timers you are using to get PWM running as softdevice will occupy the timer0. So drive the PWm on other left timers with priority 3 which is the leat app priority.

Children
No Data
Related