Interrupt priorities

18 Jan 2010

Hi,

I am working on a program that has mulitple ticker interrupts at different times. Is there a way to prioritise ticker interrupts so that one will always run on time at the expense of another?

18 Jan 2010

Hi Martin,

All the Tickers and Timeouts are virtualised off one underlying timer/interrupt; think of them as just an ordered queue of events. That basically means they are all an equal priority, and one will never interrupt another. It could be possible to implement it in such a way that the next event is scheduled on entry to the previous, and with a modified priority, but that doesn't really fix the problem;  any number of future events could require scheduling. This feels like the realm of multiple interrupts and/or an RTOS scheduler.

For example, the right approach may be two timer-based interrupts to trigger your events. The mbed library doesn't expose all the underlying hardware timers directly at the moment, but you should be able to code them up fairly easily to experiment with. Have a look at the timer section of the manual and the timer structure: http://mbed.org/projects/libraries/svn/mbed/trunk/LPC1768/LPC17xx.h#L206. If you describe how you progress i'm sure people can help you out and it may also help understand what a good tutorial for doing this sort of thing might look like.

Simon