Timer (Colibri)
From ToradexWiki
HW Timers
The Colibri modules all provide HW timers which can be used to generate interrupts etc. Due to a bug in the Marvell PXA3xx silicons the normal usage of a timer on any Colibri PXA3xx is restricted. To avoid problems, Marvell suggests to use one timer only. Since Windows CE is already using an timer (OST), using a second timer for an application could lead to crashes. There is a special handling needed in order to use multiple timers. Toradex recommends to not use additional HW timers on PXA3xx modules whenever possible. For more details please take a look at Marvell's errata FEr#22:
Marvell PXA Datasheets
Marvell Specification Update (Erratas)
Creating a SW Timer at 1ms
For most applications it is enough to have a 1ms periodical timer. This can be achieved quite easy under WinCE. Just create a thread at high priority and use the following Windows CE API. This function is not declared in a public header file, so just create your own declaration.
void SleepTillTick(); // your high priority thread while (1) { SleepTillTick(); // returns at every tick which occurs every 1ms in WinCE // do your periodic stuff }
