Search by Tags

Timer (Colibri)

 

Article updated at 25 May 2022
Compare with Revision




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 Specification Update (Erratas)

For information about the timers on the Tegra modules see: Colibri T20 Timers

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 Windows CE API SleepTillTick(). This function is not declared in a public header file, so just create your own declaration.

#ifdef __cplusplus
extern "C" {
#endif
void SleepTillTick();
#ifdef __cplusplus
}
#endif
// your high priority thread
while (1)
{
    SleepTillTick(); // returns at every tick which occurs every 1ms in WinCE
    // do your periodic stuff
}