Systick using non-standard timer

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
doceme
Posts: 4
Joined: Wed Feb 06, 2013 6:06 am

Systick using non-standard timer

Post by doceme »

Would it be possible to implement a systick timer with a timer peripheral that is not 16 or 32 bits?

For example, on a chip that doesn't have a systick interrupt, if I wanted to use an RTC peripheral that has a counter resolution of 24 bits, could I still use it's periodic interrupt handler to call osalOsTimerHandlerI() and simply ignore the overflow that happens at 0xFFFFFF? As long as I continue to get periodic interrupts at the desired systick frequency, it seems like I could still define OSAL_ST_RESOLUTION as 32 and typedef systime_t to uint32_t. From what I can tell, the systick time is stored in a variable and incremented on the call to osalOsTimerHandlerI(), but the timer peripheral's counter register is never checked to get the systick time. Does that make sense or am I missing something?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Systick using non-standard timer

Post by Giovanni »

Hi,

It is possible to use any kind of timer for systick regardless the system time width. The Cortex-M port uses the Systick timer which is 24 bits wide.

The timer width must match the system time width ONLY if you want to use the tickless mode.

Giovanni
doceme
Posts: 4
Joined: Wed Feb 06, 2013 6:06 am

Re: Systick using non-standard timer

Post by doceme »

Makes sense. Thanks!
Post Reply