Home

Lesson 14 System Tick Timer (Systick Timer)

image

Contents

1. the COUNTFLAG bit in STCTRL 31 24 Reserved user software should not write ones to reserved bits The NA value read from a reserved bit is not defined From Table 441 in the LPC17xx User manual NXP Semiconductors 2010 Systick Calibration Value Register STCALIB OxEQOOQEO1C The STCALIB register contains a pre defined value for generating an interrupt every 10 milliseconds if the System Tick Timer is clocked at a frequency of 100 MHz The use of this register is not required Bit Symbol Value Description Reset value 23 0 TENMS Reload value to get a 10 millisecond System Tick underflow rate when running OxOF 423F at 100 MHz This value initialized at reset with a factory supplied value selected for the LPC1 xx The provided values of TENMS SKEW and NOREF are applicable only when using a CPU clock or external STCLK source of 100 MHz 29 24 Reserved user software should not write ones to reserved bits The valueread NA from a reserved bit is not defined 30 SKEW Indicates whether the TENMS value will generate a precise 10 millisecond time O or an approximation This bit ts initialized at reset with a factory supplied value selected for the LPC1 xx See the description of TENMS above When 0 the value of TENMS is considered to be precise When 1 the value of TENMS ts not considered to be precise 31 NOREF Indicates whether an external reference clock is available This bitis initialized 0 at reset with a factory supplied value s
2. INT System Tick interrupt From Fig 118 in the LPCI7xx User manual NXP Semiconductors 2010 The can be controlled using four registers OxE000 E010 OxE000 E014 0xE000 E018 OxE000 E01C Name Description Access Reset valuel l Address SICTRL oystem Timer Control and status register R W 0x4 STRELOAD System Timer Reload value register R W 0 STCURR System Timer Current value register RAW 0 STCALIB System Timer Calibration value register RAW 0x000F 423F 1 Reset Value reflects the data stored in used bits only It does not include content of reserved bits From Table 438 in the LPC17xx User manual NXP Semiconductors 2010 Systick Control and Status Register STCTRL OxEQOOEO10 The STCTRL register contains control information for the System Tick Timer and provides a status flag as shown in table below Bit Symbol 0 ENABLE 1 TICKINT 2 CLKSOURCE 3 16 COUNTFLAG 31 17 Description System Tick counter enable When 1 the counter is enabled When 0 the counter is disabled system Tick interrupt enable When 1 the System Tick interrupt is enabled When 0 the System Tick Interrupt is disabled When enabled the interrupt is generated when the System Tick counter counts down to 0 System Tick clock source selection When 1 the CPU clock is selected When 0 the external clock pin STCLK is selected Reserved user software should not write ones to reserved bits The value read from a reserved bit is not def
3. Lesson 14 System Tick Timer Systick Timer 1 Overview In this lesson the system tick timer Systick Timer is introduced Systick Timer is a small timer that is integrated as part of the NVIC of the Cortex M3 processor This timer is generally used to support an operating system or other system management software This timer can also be used to create time delays and generate periodic interrupts Since our microcontroller does not have an operating system we will mainly use this timer for delays and periodic interrupts Using a timer for delays or periodic polling an event is preferable to using a loop as in lab 1 because the processor is free to process other tasks while the timer works in the background There are other timers that are included in our microcontroller and those timers are left for you to explore We will focus on the Systick Timer in this lesson 2 Systick Timer The main component of the Systick Timer is a 24 bit down counter that can be operated with the processor clock or an input clock signal from a pin STCLK pin The general block diagram of a Systick Timer is shown in figure below The Systick Timer is intended to generate fixed O ms interrupts to support a system management software e g an OS However the timer can also be used as a general purpose timer STCALIB STRELOAD oag data STCURR private cclk 24 bit down counter a VT clock STCLK pin under count ENABLE CLKSOURCE COUNTFLAG TICK
4. XP Semiconductors 2010 Cortex M3 Technical Reference Manual ARM Limited 2010 5
5. elected for the LPC1 xx See the description of TENMS above When 0 a separate reference clock Is available When 1 a separate reference clock Is not available From Table 442 in the LPC17xx User manual NXP Semiconductors 2010 3 Example Write a C code to configure the Systick Timer interrupt that should occur every 1 ms Assume that the processor clock frequency is 100 MHz Tasks e Systick Timer Setup e ISR Question what is the name of the ISR for Systick Timer How would you declare this ISR in C include LPC17xx h Device header Systick handler declaration Define pointers to registers volatile unsigned int STCTRL_ptr unsigned int 0xE000E010 volatile unsigned int STRELOAD ptr unsigned int 0xE000E014 volatile unsigned int STCURR ptr unsigned int OxEQQ0E018 eee eee eee ees eee eee eee eee ee eae eee ee Main Initialize I mie cats ce sacs A sss ae fc fe es Tessa tc de se es ees ess es ee a E as a eee eee ty int main void Initialize Systick Timer while 1 main loop Exercise Write a C program to for the example above Use the simulator to verify Ims interrupts 1 2 3 4 5 References Joseph Yiu The Definitive Guide to ARM Cortex M3 and Cortex M4 Processors Elsevier a ed 2014 Jonathan Valvano Introduction to ARM Cortex M Microcontroller a ed 2013 ARMv7 M Architecture Reference Manual ARM Limited 2010 LPC1I7xx User manual N
6. ined System Tick counter flag This flag is set when the System Tick counter counts down to 0 and Is cleared by reading this register Reserved user software should not write ones to reserved bits The value read from a reserved bit is not defined From Table 439 in the LPC17xx User manual NXP Semiconductors 2010 Systick Reload Value Register STRELOAD OxEQOOEO14 Reset value 0 0 NA 0 NA The value in this register is loaded into the counter whenever the count reaches zero This value should be initialized before enabling the interrupt Bit Symbol 23 0 RELOAD 31 24 Description This is the value that is loaded into the System Tick counter when it counts down to 0 Reserved user software should not write ones to reserved bits The Reset value 0 NA value read from a reserved bit is not defined From Table 440 in the LPC17xx User manual NXP Semiconductors 2010 Question What is the maximum value for this register Question What is the value in the register if the recurrent interrupt occurs every Ims given the 10MHz clock source Systick Current Value Register STCURR OxEQOOEO18 Reading STCURR register returns the current count from the System Tick counter Writing to this register clears the current count Bit Symbol Description Reset value 23 0 CURRENT Reading this register returns the current value of the System Tick 0 counter Writing any value clears the System Tick counter and

Download Pdf Manuals

image

Related Search

Related Contents

Arcoplus MiniGreca  Optum ICD-10 Testing - Electronic Network Systems  Manuel Supercompact MB  Service Manual DMS - Atkinson Equipment Ltd.  SecuTronic - Burg  Samsung Galaxy Tab 4 (10.1, Wi-Fi) Bruksanvisning(LL)  COLORdash Accent Quad Quick Reference Guide Rev. 2 Multi  TRENDnet TE100-S32 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file