rtel wrote on Sunday, December 14, 2008:
Yes it is possible to use the core timer, but there is a danger in doing so as unfortunately the core timer is not ideal for periodic interrupt generation.
When using the peripheral timer you can setup the timer to generate an interrupt on a compare match. Each time an interrupt is generated the timer count value is automatically reset and starts counting again from the beginning until it reaches the match value. The important thing is this happens automatically, even if your software is doing something else. The next interrupt will be pended at the right time.
If you were using the core timer then there is no way of getting the timer to automatically reset - it just keeps counting. This means you have to calculate the next match value from within interrupt itself (look up table or calculation). If for some strange reason your application keeps interrupts disabled for too long, or you have lots of higher priority interrupts coming in, then it is possible that you will only write out the next match value AFTER the timer has already gone past it. This would have the effect of freezing your system until the timer had wrapped all the way around.
This is an unlikely occurrence, but is more likely the faster the tick rate. You could also put in some software guards against this happening, but you will get into race conditions.
It is because of these reasons I did not use the core timer, but you can are free to change this. The timer is setup in prvSetupTimerInterrupt() within port.c.