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

nRF51 BLE and PWM doesn't work simultaneously

Hi

I'm using a custom board with nRF51822 and mbed. Then, I would like to generate 25kHz PWM and use BLE simultaneously. So, I read this thread, write like the attachment code and could generate 25kHz PWM. devzone.nordicsemi.com/.../ source code.txt

However, I couldn't use BLE while my board generates PWM. Although I changed the frequency of PWM, I couldn't detect BLE. Are there anyone who face the same problem? If there are, please tell me how to solve this problem.

Best regards Ishikawa

Parents
  • Thank you for your quick responses, Keton and Bauck and I'm sorry for late.

    I achieved generating 25kHz PWM and communicating with BLE simultaneously!

    I added NVIC_SetPriority(TIMER2_IRQn, 3);
    before, NVIC_EnableIRQ(TIMER2_IRQn);.

    The other parts are almost the same as proposed in the linked post. Then, finally, I was able to generate 3 PWMs with the same more than 25kHz frequency and 50% duty cycle.

    Thank you for your help!

    You are not enabling timer 2 interrupt in the peripheral and you don't need the interrupt, so you don't have to enable it in the cortex (NVIC_EnableIRQ(TIMER2_IRQn)).

    Bauck, I would like to ask you a question about this. Don't I need to use the interrupt, because the behavior of PPIs doesn't need the help of CPU?

    Best regards

  • i don't find NVIC_SetPriority(TIMER2_IRQn, 3); or NVIC_EnableIRQ(TIMER2_IRQn);. Where can I add commands?

    best regards

Reply Children
No Data
Related