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

nRF52 realtime interrupts?

With the nRF51, it was not possible to run a high frequency realtime task due to the SoftDevice running with the highest interrupt priority, is this different for the nRF52? I couldn't find anything definite in the docs so far, did this change?

(Specifically I'm looking to run a pulse generator interrupt in the 50kHz region, for stepper motor control. It's a showstopper against the nRF51, with the TI CC2640 being the alternative.)

  • No and yes. The basic design hasn't changed, the softdevice still has priority over everything else and running realtime interrupt-based tasks is still not going to work.

    However the nRF52 has added more hardware peripherals which are not processor-bound, most of them use EasyDMA and can be set and left. There's a new PWM module, the documentation on which is rather long because it has a lot of configurable options for generating pulse trains which can change on a per-cycle basis and also uses EasyDMA to read programmed sequences out of RAM. Does that have enough options to do what you want?

    I tried quite hard to like the TI chip but can't get past their awful development environment and it's back to mouldering in a box on the shelf.

  • Unfortunately, I don't see a way to program a speed ramp in the PWM modules that isn't made of a series of discrete constant-width pulse sequences, which for this application is rather bad.

    I do wonder if the SoftDevice really needs top priority, after all, it works in the ms range, while the 50kHz are 0.02ms, with irq execution times < 0.01ms.

Related