I will be running an Arm Cortex M3 at 156 Mhz. I have a need for an accurate timer with a resolution of 250 usecs both for implementing delays and for keeping time, as well as perhaps scheduling some action to be performed.
I’m trying to decide whether to increase the OS tick timer to this resolution, or to use another hardware timer at my disposal. I have other hardware timers available which run at 25 Mhz that can cause periodic interrupts and I can/could build a utility outside the OS to implement these functions. In fact, this code is all available from an earlier non-RTOS design.
The issues I’m concerned about as I think this over are:
1) How does increasing the tick timer from something like 200 Hz to 4 Khz effect the overall throughput of the processor? Does this vary with CPU frequency? I’m guessing that it’s less important on a processor running at 156 Mhz than one running at 25 Mhz. Is this assumption valid?
2) The OS Tick Timer is usually placed at a low priority, which means it could be quite jittery depending on the interrupt loading of higher priority interrupts and code which masks interrupts. To get an accurate delay timer/scheduling/timer I may want to consider raising the priority of the scheduler. Are there problems with having the scheduler be the highest priority interrupt instead of the lowest? I suppose this question depends on my real-time requirements for my other interrupts.
Has anybody had experience with this kind of a question?
Thanks for any feedback.