SN32F760 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 32
Version 2.0
2.2.2
SYSTICK USAGE HINTS AND TIPS
The interrupt controller clock updates the SysTick counter. Some implementations stop this clock signal for low power
mode. If this happens, the SysTick counter stops.
Ensure SW uses word accesses to access the SysTick registers.
The SysTick counter reload and current value are not initialized by HW. This means the correct initialization sequence
for the SysTick counter is:
1. Program the reload value in SYSTICK_LOAD register.
2. Clear the current value by writing any value to SYSTICK_VAL register.
3. Program the Control and Status (SYSTICK_CTRL) register.
2.2.3
SYSTICK REGISTERS
2.2.3.1
System Tick Timer Control and Status register (SYSTICK_CTRL)
Address: 0xE000 E010 (Refer to Cortex-M0 Spec)
Bit
Name
Description
Attribute
Reset
31:17
Reserved
R
0
16
COUNTFLAG
This flag is set when the System Tick counter counts down to 0, and is
cleared by reading this register.
R/W
0
15:3
Reserved
R
0
2
CLKSOURCE
Selects the SysTick timer clock source.
0: reference clock.
1: system clock. (Fixed)
R
1
1
TICKINT
System Tick interrupt enable.
0: Disable the System Tick interrupt
1: Enable the System Tick interrupt, the interrupt is generated when the
System Tick counter counts down to 0.
R/W
0
0
ENABLE
System Tick counter enable.
0: Disable
1: Enable
R/W
0
2.2.3.2
System Tick Timer Reload value register (SYSTICK_LOAD)
Address: 0xE000 E014 (Refer to Cortex-M0 Spec)
The RELOAD register is set to the value that will be loaded into the SysTick timer whenever it counts down to zero.
This register is set by software as part of timer initialization. The SYSTICK_CALIB register may be read and used as
the value for RELOAD if the CPU or external clock is running at the frequency intended for use with the
SYSTICK_CALIB value.
The following example illustrates selecting the SysTick timer reload value to obtain a 10 ms time interval with the
system clock set to 50 MHz.
The SysTick clock = system clock = 50 MHz
RELOAD = (system tick clock frequency × 10 ms)
−1 = (50 MHz × 10 ms) −1
= 0x0007A11F.
Bit
Name
Description
Attribute
Reset
31:24
Reserved
R
0
23:0
RELOAD
Value to load into the SYSTICK_VAL when the counter is enabled and
when it reaches 0.
R/W
0x5F7F9B