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

NRF52 help configuring TIMER + DMA + PWM

I need help configuring TIMER + DMA + PWM ( nrf52 ).

I would like to set the value of PWM with an interval of 100 ms and PWM configured to frequency of 20-40kHz.

Optinal use of EasyDMA for the PWM module is redundant over the resources used and the frequency of the PWM is not fixed.

Typically when using DMA, data at a specified interval is copied to pre-configured PWM module.

We are using the NRF52832 and the documentation describes EasyDMA in the context of using peripherals but, I did not find an implementation description for the mode copy RAM to peripheral register with timer set interval.

Does anyone know how to implement such a system?

Parents
  • Hi

    Do you have any experience with the TIMER and PPI modules?

    If you configure the PWM in the NextStep mode it will only read a new value from the buffer once you activate the NEXTSTEP task:

    NRF_PWM0->TASKS_NEXTSTEP = 1;
    

    By using the PPI controller you can connect one of the TIMER COMPARE events to the NEXTSTEP task, to have the timer control the PWM update frequency.

    Before you do this you can set up a RAM buffer for the PWM to read from, so that you can run the PWM in the background without having to continuously feed it new data.

    Best regards
    Torbjørn

  • Hi

    What is the cfg_IR_Transmit.Carrier_period_pwm variable set to, and what values do you put into the PWM buffer?

    It might be easier if you can just zip your project and attach it as a file. Then I can more easily compile and test your code.

    Best regards

Reply Children
No Data
Related