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

Can I use PPI with DMA and RTC to update GPIO/PWM outputs?

I am new to Nordic parts. I must say the PPI looks very neat, and the EasyDMA. I'm wondering if they can solve a particular problem.

I need to emit a rather peculiar pulse train to drive small motor. The spacings and pulse widths are irregular but are all multiples of 1/4096 seconds, so I thought to use an RTC divided by 8. I could drive a simple state machine in the ISR and set the output pins accordingly. This would certainly do the trick, but power is an issue.

It might be better if I could do all this without waking the CPU. So I wondered about using the RTC events to drive DMA reads at 4096Hz from a lookup table, and write data to one or more GPIO pins (somehow). Maybe the PWM peripheral could do it by setting the duty cycle to 100% or 0% as needed via the lookup table, except that this seems to use a specific clock rather being ticked by events. Is what I'm after possible with this hardware? I'd be grateful for any tips.

Cheers.

Al 

Parents
  • Hi,

    What kind of pulse train? 

    Unfortunately the GPIOs aren't equipped with EasyDMA, so the GPIOs can't be connected to a lookup table in RAM without using interrupts and the CPU. But PWM might be the way to go. With EasyDMA it is possible to make quite complex waveforms that will run autonomously without using the CPU. In addition to controlling the duty cycle it is also possible to control each individual period length (Waveform mode).  

Reply
  • Hi,

    What kind of pulse train? 

    Unfortunately the GPIOs aren't equipped with EasyDMA, so the GPIOs can't be connected to a lookup table in RAM without using interrupts and the CPU. But PWM might be the way to go. With EasyDMA it is possible to make quite complex waveforms that will run autonomously without using the CPU. In addition to controlling the duty cycle it is also possible to control each individual period length (Waveform mode).  

Children
No Data
Related