Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
42
5
CPU System Tick (SysTick) Timer
The System Tick (SysTick) Timer is present on both the KM4 and the KM0. The SysTick clock is fixed to half the frequency of the system clock.
5.1
Features
Simple 24-bit timer
Dedicated exception vector
Clocked internally by the system clock or the system tick clock (SYSTICKCLK)
5.2
Functional Description
The SysTick timer is an integral part of both the KM4 and the KM0. It is a 24-bit timer that counts down to zero and generates an interrupt, to
provide a fixed 1 millisecond time interval between interrupts for use by an operating system or other system management software. The
SysTick timer is clocked from the CPU clock (the system clock) or from the SDM32.768 clock. In order to generate recurring interrupts at a
specific interval, the SYST_RVR register must be initialized with the correct value for the desired interval.
Since the SysTick timer is a part of the CPU, it facilitates porting of software by providing a standard timer that is available on ARM Cortex-M
based devices. The SysTick timer can be used for:
A RTOS tick timer which fires at a programmable rate (for example 1000Hz) and invokes a SysTick routine.
A high-speed alarm timer using the core clock.
A simple counter. Software can use this to measure time completed and used.
An internal clock source control based on missing/meeting durations. The COUNTFLAG bit in the SYST_CSR register can be used to
determine if an action completed within a set duration, as part of a dynamic clock management control loop.
Refer to the appropriate ARM Cortex User Guide for more details.
5.3
Register Description
The SysTick timer registers are located on the private peripheral bus of each CPU, and the details of registers are shown in Table 5-1. The
physical base address is 0xE000_E000
.
Table 5-1 Memory map of SysTick timer
Name
Offset
Access
Description
0x010
R/W
System Timer Control and Status Register
0x014
R/W
System Timer Reload Value Register
0x018
R/W
System Timer Current Value Register
0x01C
RO
System Timer Calibration Value register
5.3.1
SYST_CSR
Name
: System Timer Control and Status Register
Size
: 32 bits
Address offset
: 0x010
Read/write access
: read/write
This register contains control information for the SysTick timer and provides a status flag. It is a part of the CPU, and determines the clock
source for the SysTick timer.
31
30
29
28
27
…
22
21
20
19
18
17
16
RSVD
COUNTFLAG
R/W
The document authorized to
SZ99iot
2019-05-15 10:08:03