I’m currently using a 32 bit timer with success; however, for convenience I would also like to introduce a 64 bit timer. This will take my rollover time, from about 36 seconds, up to about 4874 years (hopefully I won’t be around to see what happens :-) )
I just can’t get it to work.
The initialisation routine is:
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC_UP);
TimerEnable(TIMER2_BASE,TIMER_BOTH);
And I do a read every so often as:
Timer64 = TimerValueGet64(TIMER2_BASE);
Where Timer64 is defined as uint64_t timer64;
The problem is that I get only 32 bits of resolution because of two problems:
1) The counter is going at 216 times faster than expected, so I’m losing 16 bits
2) The top 16 bits are always zero, so I’m loosing another 16 bits
The end result is that no matter what I do, I’m still getting wrap around after about 36 seconds.
Has anyone had success with TimerValueGet64 ? What’s happening here?