| 数据搜索系统,热门电子元器件搜索 |
|
RM0352 数据表(PDF) 70 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
RM0352 数据表(HTML) 70 Page - STMicroelectronics |
|
70 / 138 page ![]() System timer (SysTick) RM0352 70/138 DocID024647 Rev 1 Reset: 0x80000000 Description: SysTick calibration value register 9.4 Configuring SysTick To configure the SysTick you need to load the SysTick reload value register with the interval required between SysTick events. The timer interrupt or COUNTFLAG bit (in the SysTick control and status register) is activated on the transition from 1 to 0, therefore it activates every n + 1 clock ticks (the SysTick clock is the CPU clock). If a period of 100 is required, 99 should be written to the SysTick reload value register. The SysTick reload value register supports values between 1 and 0x00FFFFFF. If you want to use the SysTick to generate an event at a timed interval, for example 1 ms, you can use the SysTick calibration value register to scale your value for the reload register. The SysTick calibration value register is a read-only register that contains the number of pulses for a period of 10 ms, in the TENMS field (bits 0 to 23). This register also has a SKEW bit (30) that is used to indicate that the calibration for 10 ms in the TENMS section is not exactly 10 ms due to small variations in clock frequency. Bit 31 is used to indicate if the reference clock is provided. The control and status register allows you to select between polling the timer by reading COUNTFLAG (bit 16), or by the SysTick generating an interrupt. By default the SysTick is configured for polling mode. In this mode, user code must read COUNTFLAG to ascertain if the SysTick event had occurred. This is indicated by COUNTFLAG being set. Reading of the control and status register clears the COUNTFLAG bit. To configure the SysTick to generate an interrupt you must set TICKINT (bit 1 of the SysTick control and status register) HIGH. You will also need to enable the appropriate interrupt in the Nested Vector Interrupt Controller (NVIC). You must keep CLKSOURCE (bit 2) to 1 to select the core clock. The Timer is enabled by setting bit 0 of the SysTick Status and control register. For more details about SysTick registers, see “Cortex-M0 Devices Generic User Guide”. [31] NOREF: read as one indicates that no separate reference clock is provided. [30] SKEW: read as one indicates calibration value for the 10 ms inexact timing is not known. This may affect the suitability of the SysTick as a software real- time clock. [29:24] RESERVED [23:0] TENMS: contains the number of ticks to generate a 10 ms interval. Read as zero indicates calibration value is not known. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |