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

BLE + PWM motor driver

The project I'm using the peripheral BLE UART that has been modified to use freeRTOS and PWM.

I'm using two channel PWM to drive a resonance motor at 25.6 kHz. If I disable the BLE thread the standard deviation of the PWM signal is ~10 Hz. However if the BLE thread is enabled, the PWM standard deviation jumps to ~ 150Hz. And unfortunately that is enough of a frequency drift to bring the motor out of resonance. Is there anything I can do to minimize this effect, and why does BLE increase the drift of the PWM signal ?

The PWM base is 16 MHz

thanks,

Parents
  • Hi

    Could you try to request high frequency clock when using BLE?

    If you don't request HF clock the BLE stack will enable and disable the HF clock manually every time the radio is needed, and this switch could introduce some jitter to the 16MHz clock rate (the RC osc could be off by 5% or more). If you request the HF clock then it will always run from the crystal, and you will have a much more accurate clock.

Reply
  • Hi

    Could you try to request high frequency clock when using BLE?

    If you don't request HF clock the BLE stack will enable and disable the HF clock manually every time the radio is needed, and this switch could introduce some jitter to the 16MHz clock rate (the RC osc could be off by 5% or more). If you request the HF clock then it will always run from the crystal, and you will have a much more accurate clock.

Children
No Data
Related