SLAU847D October 2022 – May 2024 MSPM0L1105 , MSPM0L1106 , MSPM0L1227 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346 , MSPM0L2227 , MSPM0L2228 , MSPM0L2228-Q1
The system tick timer (SysTick) is a tightly-coupled timer clocked by MCLK, which can be used for system time keeping. The SysTick is available in RUN and SLEEP modes but is not available for use in STOP, STANDBY, or SHUTDOWN modes.
The SysTick is configured through memory-mapped registers in the system private peripheral bus (PPB) region. See Table 3-7 for the list of SysTick configuration registers. The software development kit (SDK) provided with the devices supports the standard Arm Cortex Microcontroller Software Interface Standard (CMSIS) register access definitions for the SysTick.
The SysTick timer can be used in several different ways, including:
The SysTick timer is a simple 24-bit down counter, which counts down from its reload value to zero. Upon reaching zero, SysTick will re-load the value programmed into the reload value register (SYST_RVR) on the next clock cycle, and then again begin counting down to zero.
A SysTick event is generated when the SysTick counter reaches zero, and which point the COUNTFLAG status flag will be set. Reading the SYST_CSR register will clear the COUNTFLAG status bit. Writing to the current value register (SYST_CVR) clears the register and the COUNTFLAG status but does not generate an interrupt to the CPU. Reading SYST_CVR returns the counter value at time of access.
Address | Register | CMSIS | Description |
---|---|---|---|
0xE000.E010 | SYST_CSR | SysTick->CTRL | Control and status register, used to enable/disable SysTick and its related exception, and to check the COUNTFLAG status |
0xE000.E014 | SYST_RVR | SysTick->LOAD | Reload register used to program the counter reload value to set the SysTick interval in MCLK cycles |
0xE000.E018 | SYST_CVR | SysTick->VAL | Returns the current value of the SysTick counter; a write clears the counter to zero and clears COUNTFLAG in SYST_CSR |
0xE000.E01C | SYST_CALIB | SysTick->CALIB | Not implemented |
Application software must only use 32-bit word-aligned word accesses to the SysTick registers. To initialize the SysTick, follow the steps below: