Use GPTs in real-time capable applications

Important

This is the Azure Sphere (Legacy) documentation. Azure Sphere (Legacy) is retiring on 27 September 2027, and users must migrate to Azure Sphere (Integrated) by this time. Use the Version selector located above the TOC to view the Azure Sphere (Integrated) documentation.

Azure Sphere supports using general purpose timers (GPTs) in real-time capable applications.

Each real-time core on the MT3620 supports five GPTs. Timers GPT0, GPT1, and GPT3 are interrupt-based. These timers count down from an initial value and assert an interrupt when the count reaches 0. Timers GPT2 and GPT4 are free-running timers. These timers count up from an initial value.

Two modes are defined for interrupt-based timers:

  • One-shot mode: The times stops when it counts down to 0.
  • Auto-repeat mode: The timer restarts after it counts down to 0.

GPT control registers for each real-time core are mapped to addresses 0x2103_0000 through 0x2103_FFFF in the core's private memory.

For more information about using the real-time core GPTs in applications, see Azure Sphere MT3620 M4 API Reference Manual.

Note

The Azure Sphere OS does not reset peripherals on start-up. Your applications should ensure that peripherals are in a known-good state on start-up or after restart.

The GPT sample applications

The following sample applications demonstrate how to use GPTs on MT3620 real-time cores: