3 system timer (systick), System timer (systick), Nuc140 series data sheet – Rainbow Electronics NUC140 User Manual

Page 25

Advertising
background image

NUC140 Series DATA SHEET

Publication Release Date: May 31, 2010

- 25 -

Revision V1.02

5.2.3

System Timer (SysTick)

The Cortex-M0 includes an integrated system timer, SysTick. SysTick provides a simple, 24-bit
clear-on-write, decrementing, wrap-on-zero counter with a flexible control mechanism. The counter
can be used in several different ways, for example:

y

An RTOS tick timer which fires at a programmable rate (for example 100Hz) and invokes a
SysTick routine.

y

A high speed alarm timer using Core clock.

y

A variable rate alarm or signal timer – the duration range dependent on the reference clock used
and the dynamic range of the counter.

y

A simple counter. Software can use this to measure time to completion and time used.

y

An internal clock source control based on missing/meeting durations. The COUNTFLAG bit-field
in the control and status register can be used to determine if an action completed within a set
duration, as part of a dynamic clock management control loop.


When enabled, the timer will count down from the value in the SysTick Current Value Register
(SYST_CVR) to zero, reload (wrap) to the value in the SysTick Reload Value Register (SYST_RVR)
on the next clock edge, then decrement on subsequent clocks. When the counter transitions to zero,
the COUNTFLAG status bit is set. The COUNTFLAG bit clears on reads.

The SYST_CVR value is UNKNOWN on reset. Software should write to the register to clear it to zero
before enabling the feature. This ensures the timer will count from the SYST_RVR value rather than
an arbitrary value when it is enabled.

If the SYST_RVR is zero, the timer will be maintained with a current value of zero after it is reloaded
with this value. This mechanism can be used to disable the feature independently from the timer
enable bit.

For more detailed information, please refer to the documents “

ARM®

Cortex™-M0 Technical

Reference Manual” and “

ARM® v6-M Architecture Reference Manual”.


Advertising