High priority repetitive task

leoc7 gravatar image

asked 2018-01-11 14:45:50 +0100

Hi everyone,

My configuration:

  • nrf52832 microcontroller
  • Softdevice S132 V4.0.2
  • Nordic SDK 13.0

I need to develop a repetitive task with 10 Hz frequency. This task contains only algorithms and it doesn't involve the use of any peripherals.

This task has to be executed always and it must never be interrupted.

What is the best solution to do this? RTC, Timer, Timeslot, ...? Which mechanism give me the certainty of precise and uninterrupted task execution?


edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
ovrebekk gravatar image

answered 2018-01-12 12:37:23 +0100


Unfortunately there is no way to guarantee un-interrupted access to the CPU at a specific point in time when the SoftDevice is running.

The SoftDevice has exclusive access to the highest priority interrupts (0 and 1), and when the link layer in the SoftDevice is doing something critical (like processing an incoming packet) it will block everything else for a couple of hundred microseconds.

The RTC and TIMER modules can run in the background and generate events at a consistent rate, but you won't be able to process the events if the SoftDevice is busy. The timeslot API can give you a period during which you won't be interrupted, but you won't be able to start a timeslot if the SoftDevice has scheduled a higher priority activity at the same time.

If it is enough that you can guarantee that the code will be executed within a certain amount of time, but you can accept some variation within those limits, then you should be able to find a solution.

Best regards
Torbjørn Øvrebekk

edit flag offensive delete publish link more


Many thanks!

leoc7 ( 2018-01-12 14:05:34 +0100 )editconvert to answer

Happy to help. Feel free to accept my answer, if you are satisfied with it :)

Torbjørn Øvrebekk ( 2018-01-12 16:04:15 +0100 )editconvert to answer

Done! Thanks :)

leoc7 ( 2018-01-12 17:27:02 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

1 follower


Asked: 2018-01-11 14:45:50 +0100

Seen: 45 times

Last updated: jan. 12