SlideShare a Scribd company logo
STM32 Systick
Md Rayhan Tanvir
Directory
SysTick Introduction
1
SysTick Function description
2
SysTick Basic operations
3
SysTick Introduction
SysTick Introduction
The System Tick Timer (SysTick) generates interrupt requests on a regular basis.
This allows an OS to carry out context switching to support multiple tasking.
SysTick Introduction
ARM
Cortex-M3
Timer
On-Chip
peripherals
JTAG
SWD
CPU
SysTick
NVIC
Chips from different
manufacturers
NVIC
ARM
Cortex-M3 Kernel
Nested Vector
Interrupt
Controller
SysTick is a 24-bit system clock
counter, down counting mode, it
belongs to ARM Cortex-M3 kernel
NVIC in a functional unit, often used
for operating system clock timing.
Without operating system, the Systick can
be used as a general timer/counter
JTAG & SWD
 Serial Wire Debug (SWD) is a 2-pin (SWDIO/SWCLK) electrical alternative
JTAG interface that has the same JTAG protocol on top.
SWD uses an ARM CPU standard bi-directional wire protocol.
 Joint Test Action Group (JTAG) is an
electronics industry association formed in
1985 for developing a method of verifying
designs and testing printed circuit
boards after manufacture.
NVIC (Nested Vector
Interrupt Controller)
 Asynchronous interrupts don’t wait for previous
ones to be handled - if you’re handling the last
one when a new one comes along, you either
ignore it or you have a CPU that can nest them
and handle it when you finish the current one
(or preserve the current state and handle the
new one - it depends on priority).
Downcounting
TI
Cortex-M3
NXP
Cortex-M3
TI
Cortex-M3
SysTick Introduction
Operating system code porting
Using Timers as System Clock
Can't be Carried
directly.
Can be carried
directly
µC/OS-II
Operating
NXP
Cortex-M3
µC/OS-II
Operating
Use SysTick as System Clock
SysTick Introduction
 Systick timers can be used for other purposes in
addition to operating systems: as a alarm, for
measuring time.
 Note that when the processor is called to stop
during debugging (Halt), the Systick timer will
also be suspended.
Directory
SysTick Introduction
1
SysTick Function description
2
SysTick Basic operations
3
SysTick Registers
SysTick can be configured through the 4 registers:
SysTick Structure Diagram
FLAG
RELOAD
CURRENT
0
ENABLE TICKINT
CLKSOURCE
0
1
Reload value register
Current Value Registers
Control and Status registers
Clock Interrupt
Register description
 SysTick Control and Status registers (SysTick_CSR)
COUNTFLAG CLKSOURCE TICKINT ENABLE
bit0
bit1
bit2
bit16
Counter flag bit
0: Read zeroing
1: The counting value is
reduced from 1 to 0
Clock source Selection bit
0: External reference clock-HCLK/8
1: Kernel clock-HCLK
0: No interruption
1: Allow interrupt
Interrupt Enable
bit
Counter enables bit
0: Prohibition
1: Enable
Count values from 1 to 0
triggers an Interrupt.
The bit will automatically
clear 0 after reading;
can be used for query
mode timing
SysTick Clock source
SysTick's clock
source can be
HCLK/8 or
HCLK
specifically
which can be
selected by
configuring
control and
status registers
(CTRL).
0
 Current Value Registers (SysTick_VAL)
Register description
The current value register displays the current value of the SysTick
counter. Every 1 system clock cycles, the value minus 1, when the
count is reduced to 0, can produce interrupts and load the values of
the reload value registers.
0x000003
Count Flag bit
COUNTFLAG
Interrupt
Current Value Registers
Reload Value Registers
0x000003
0x000002
0x000001
0x000000
0x000003
0x000003
1
0x000000
Any value
Write any value to zero and
cause the sign to be zeroed.
Directory
SysTick Introduction
1
SysTick Function description
2
SysTick Basic operations
3
SysTick How to Run
Select Clock Source
Set Reload values
Enable SysTick interruption
Enable SysTick counter
CTRL—>CLKSOURCE
When the count value is reduced from 1 to 0,
the interrupt is generated
Start Counter & Start Countdown
RELOAD=(SysClock * Timing time) -1
Empty Current Value Registers Automatically load reload values when the count is 0
SysTick How to Run
CURRENT
FLAG
0x000003
RELOAD
0x000000
0
ENABLE TICKINT
CLKSOURCE
0
1
Clock Interrupt
Select Kernel Clock
1 Set Reload values
2
Enable interruption
3
Enable counter
4
0x000003
0x000002
0x000000
0x000001
1
Interrupt
1 1
4 STM32's SysTick.ppt

More Related Content

What's hot

UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATION
IAEME Publication
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
Ashish Ranjan
 
Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver development
FastBit Embedded Brain Academy
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design Approach
A B Shinde
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
FastBit Embedded Brain Academy
 
Typical Embedded System
Typical Embedded SystemTypical Embedded System
Typical Embedded System
anand hd
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
Hariharan Ganesan
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI Design
Usha Mehta
 
UVM TUTORIAL;
UVM TUTORIAL;UVM TUTORIAL;
UVM TUTORIAL;
Azad Mishra
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
Mathivanan Natarajan
 
1 STM32's DMA.ppt
1 STM32's DMA.ppt1 STM32's DMA.ppt
1 STM32's DMA.ppt
MdRayhanTanvir
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
Dr M Muruganandam Masilamani
 
Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development
FastBit Embedded Brain Academy
 
Design challenges in embedded systems
Design challenges in embedded systemsDesign challenges in embedded systems
Design challenges in embedded systems
mahalakshmimalini
 
Event driven simulator
Event driven simulatorEvent driven simulator
Event driven simulator
Sahil Abrol
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC Machine
EdutechLearners
 
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC 1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
IEEE SSCS AlexSC
 
Microcontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basicsMicrocontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basics
Nilesh Bhaskarrao Bahadure
 
Hardware-Software Codesign
Hardware-Software CodesignHardware-Software Codesign
Hardware-Software Codesign
Sudhanshu Janwadkar
 

What's hot (20)

UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATION
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
 
Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver development
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design Approach
 
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWERMastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
 
Typical Embedded System
Typical Embedded SystemTypical Embedded System
Typical Embedded System
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI Design
 
UVM TUTORIAL;
UVM TUTORIAL;UVM TUTORIAL;
UVM TUTORIAL;
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
1 STM32's DMA.ppt
1 STM32's DMA.ppt1 STM32's DMA.ppt
1 STM32's DMA.ppt
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part1
 
Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development
 
Design challenges in embedded systems
Design challenges in embedded systemsDesign challenges in embedded systems
Design challenges in embedded systems
 
Event driven simulator
Event driven simulatorEvent driven simulator
Event driven simulator
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC Machine
 
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC 1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
 
Microcontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basicsMicrocontroller pic 16f877 architecture and basics
Microcontroller pic 16f877 architecture and basics
 
Hardware-Software Codesign
Hardware-Software CodesignHardware-Software Codesign
Hardware-Software Codesign
 

Similar to 4 STM32's SysTick.ppt

Lecture on PIC-1.pptx
Lecture on PIC-1.pptxLecture on PIC-1.pptx
Lecture on PIC-1.pptx
godfrey35
 
MicrocontrollersII.ppt
MicrocontrollersII.pptMicrocontrollersII.ppt
MicrocontrollersII.ppt
SatheeshMECE
 
introduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.pptintroduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.ppt
jaychoudhary37
 
embedded system introduction to microcontrollers
embedded system introduction to microcontrollersembedded system introduction to microcontrollers
embedded system introduction to microcontrollers
BarER4
 
Stm32f303 rest and Clock contol
Stm32f303 rest and Clock contolStm32f303 rest and Clock contol
Stm32f303 rest and Clock contol
Prem Sanil
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03
Premier Farnell
 
ARM stacks, subroutines, Cortex M3, LPC 214X
ARM  stacks, subroutines, Cortex M3, LPC 214XARM  stacks, subroutines, Cortex M3, LPC 214X
ARM stacks, subroutines, Cortex M3, LPC 214X
Karthik Vivek
 
Microcontrollers ii
Microcontrollers iiMicrocontrollers ii
Microcontrollers iiKumar Kumar
 
.........
..................
.........
malikovvich
 
Tank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCUTank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCU
Julio César Carrasquel
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
ANSHUL GUPTA
 
Research Inventy: International Journal of Engineering and Science
Research Inventy: International Journal of Engineering and ScienceResearch Inventy: International Journal of Engineering and Science
Research Inventy: International Journal of Engineering and Scienceresearchinventy
 
Research Inventy : International Journal of Engineering and Science is publis...
Research Inventy : International Journal of Engineering and Science is publis...Research Inventy : International Journal of Engineering and Science is publis...
Research Inventy : International Journal of Engineering and Science is publis...researchinventy
 
8-Bit CMOS Microcontrollers with nanoWatt Technology
8-Bit CMOS Microcontrollers with nanoWatt Technology8-Bit CMOS Microcontrollers with nanoWatt Technology
8-Bit CMOS Microcontrollers with nanoWatt Technology
Premier Farnell
 
04 Mcu Day Stellaris 8 12b Editado
04   Mcu Day   Stellaris 8 12b   Editado04   Mcu Day   Stellaris 8 12b   Editado
04 Mcu Day Stellaris 8 12b EditadoTexas Instruments
 
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Technogroovy
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
scmandota
 
Microprocessors and Microcontrollers.ppt
Microprocessors and Microcontrollers.pptMicroprocessors and Microcontrollers.ppt
Microprocessors and Microcontrollers.ppt
Saravanan Pazapughal
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
AlexTronciu
 
Course material msp430-for_automatic_control
Course material msp430-for_automatic_controlCourse material msp430-for_automatic_control
Course material msp430-for_automatic_control
Bhukya Mangu
 

Similar to 4 STM32's SysTick.ppt (20)

Lecture on PIC-1.pptx
Lecture on PIC-1.pptxLecture on PIC-1.pptx
Lecture on PIC-1.pptx
 
MicrocontrollersII.ppt
MicrocontrollersII.pptMicrocontrollersII.ppt
MicrocontrollersII.ppt
 
introduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.pptintroduction to Microcontrollers 8051.ppt
introduction to Microcontrollers 8051.ppt
 
embedded system introduction to microcontrollers
embedded system introduction to microcontrollersembedded system introduction to microcontrollers
embedded system introduction to microcontrollers
 
Stm32f303 rest and Clock contol
Stm32f303 rest and Clock contolStm32f303 rest and Clock contol
Stm32f303 rest and Clock contol
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03
 
ARM stacks, subroutines, Cortex M3, LPC 214X
ARM  stacks, subroutines, Cortex M3, LPC 214XARM  stacks, subroutines, Cortex M3, LPC 214X
ARM stacks, subroutines, Cortex M3, LPC 214X
 
Microcontrollers ii
Microcontrollers iiMicrocontrollers ii
Microcontrollers ii
 
.........
..................
.........
 
Tank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCUTank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCU
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
 
Research Inventy: International Journal of Engineering and Science
Research Inventy: International Journal of Engineering and ScienceResearch Inventy: International Journal of Engineering and Science
Research Inventy: International Journal of Engineering and Science
 
Research Inventy : International Journal of Engineering and Science is publis...
Research Inventy : International Journal of Engineering and Science is publis...Research Inventy : International Journal of Engineering and Science is publis...
Research Inventy : International Journal of Engineering and Science is publis...
 
8-Bit CMOS Microcontrollers with nanoWatt Technology
8-Bit CMOS Microcontrollers with nanoWatt Technology8-Bit CMOS Microcontrollers with nanoWatt Technology
8-Bit CMOS Microcontrollers with nanoWatt Technology
 
04 Mcu Day Stellaris 8 12b Editado
04   Mcu Day   Stellaris 8 12b   Editado04   Mcu Day   Stellaris 8 12b   Editado
04 Mcu Day Stellaris 8 12b Editado
 
Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,Computer Science Training,IT Training,CS Training,Computer Training Institute,
Computer Science Training,IT Training,CS Training,Computer Training Institute,
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Microprocessors and Microcontrollers.ppt
Microprocessors and Microcontrollers.pptMicroprocessors and Microcontrollers.ppt
Microprocessors and Microcontrollers.ppt
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
 
Course material msp430-for_automatic_control
Course material msp430-for_automatic_controlCourse material msp430-for_automatic_control
Course material msp430-for_automatic_control
 

More from MdRayhanTanvir

Lesson 7 Switching Power Supply (Lecture 4).ppt
Lesson 7 Switching Power Supply (Lecture 4).pptLesson 7 Switching Power Supply (Lecture 4).ppt
Lesson 7 Switching Power Supply (Lecture 4).ppt
MdRayhanTanvir
 
Lesson 4 Operational Amplifiers (Lecture 2).ppt
Lesson 4 Operational Amplifiers (Lecture 2).pptLesson 4 Operational Amplifiers (Lecture 2).ppt
Lesson 4 Operational Amplifiers (Lecture 2).ppt
MdRayhanTanvir
 
Lesson 3 Microprocessors (Lecture 2).ppt
Lesson 3 Microprocessors (Lecture 2).pptLesson 3 Microprocessors (Lecture 2).ppt
Lesson 3 Microprocessors (Lecture 2).ppt
MdRayhanTanvir
 
Lesson 11 The mobile telephone system (II) (Lecture 6).ppt
Lesson 11 The mobile telephone system (II) (Lecture 6).pptLesson 11 The mobile telephone system (II) (Lecture 6).ppt
Lesson 11 The mobile telephone system (II) (Lecture 6).ppt
MdRayhanTanvir
 
Lesson 10 The mobile telephone system (I) (Lecture 5).ppt
Lesson 10 The mobile telephone system (I) (Lecture 5).pptLesson 10 The mobile telephone system (I) (Lecture 5).ppt
Lesson 10 The mobile telephone system (I) (Lecture 5).ppt
MdRayhanTanvir
 
Lesson 28 Signal Sources (Lecture 14).ppt
Lesson 28 Signal Sources (Lecture 14).pptLesson 28 Signal Sources (Lecture 14).ppt
Lesson 28 Signal Sources (Lecture 14).ppt
MdRayhanTanvir
 
Lesson 27 Choosing a Real-Time Operating System.ppt
Lesson 27 Choosing a Real-Time Operating System.pptLesson 27 Choosing a Real-Time Operating System.ppt
Lesson 27 Choosing a Real-Time Operating System.ppt
MdRayhanTanvir
 
Lesson 6 Analog to Digital Converters (Lecture 3).ppt
Lesson 6 Analog to Digital Converters (Lecture 3).pptLesson 6 Analog to Digital Converters (Lecture 3).ppt
Lesson 6 Analog to Digital Converters (Lecture 3).ppt
MdRayhanTanvir
 
Lesson 5 Low-pass Filters (Lecture 3).ppt
Lesson 5 Low-pass Filters (Lecture 3).pptLesson 5 Low-pass Filters (Lecture 3).ppt
Lesson 5 Low-pass Filters (Lecture 3).ppt
MdRayhanTanvir
 
Lesson 2 Memory Devices.ppt
Lesson 2 Memory Devices.pptLesson 2 Memory Devices.ppt
Lesson 2 Memory Devices.ppt
MdRayhanTanvir
 
Lesson 1 VLSI Technology.ppt
Lesson 1 VLSI Technology.pptLesson 1 VLSI Technology.ppt
Lesson 1 VLSI Technology.ppt
MdRayhanTanvir
 
2 STM32's Interrupts.pptx
2 STM32's Interrupts.pptx2 STM32's Interrupts.pptx
2 STM32's Interrupts.pptx
MdRayhanTanvir
 
3 STM32's ADC.ppt
3 STM32's ADC.ppt3 STM32's ADC.ppt
3 STM32's ADC.ppt
MdRayhanTanvir
 
6 STM32's USART.ppt
6 STM32's USART.ppt6 STM32's USART.ppt
6 STM32's USART.ppt
MdRayhanTanvir
 

More from MdRayhanTanvir (14)

Lesson 7 Switching Power Supply (Lecture 4).ppt
Lesson 7 Switching Power Supply (Lecture 4).pptLesson 7 Switching Power Supply (Lecture 4).ppt
Lesson 7 Switching Power Supply (Lecture 4).ppt
 
Lesson 4 Operational Amplifiers (Lecture 2).ppt
Lesson 4 Operational Amplifiers (Lecture 2).pptLesson 4 Operational Amplifiers (Lecture 2).ppt
Lesson 4 Operational Amplifiers (Lecture 2).ppt
 
Lesson 3 Microprocessors (Lecture 2).ppt
Lesson 3 Microprocessors (Lecture 2).pptLesson 3 Microprocessors (Lecture 2).ppt
Lesson 3 Microprocessors (Lecture 2).ppt
 
Lesson 11 The mobile telephone system (II) (Lecture 6).ppt
Lesson 11 The mobile telephone system (II) (Lecture 6).pptLesson 11 The mobile telephone system (II) (Lecture 6).ppt
Lesson 11 The mobile telephone system (II) (Lecture 6).ppt
 
Lesson 10 The mobile telephone system (I) (Lecture 5).ppt
Lesson 10 The mobile telephone system (I) (Lecture 5).pptLesson 10 The mobile telephone system (I) (Lecture 5).ppt
Lesson 10 The mobile telephone system (I) (Lecture 5).ppt
 
Lesson 28 Signal Sources (Lecture 14).ppt
Lesson 28 Signal Sources (Lecture 14).pptLesson 28 Signal Sources (Lecture 14).ppt
Lesson 28 Signal Sources (Lecture 14).ppt
 
Lesson 27 Choosing a Real-Time Operating System.ppt
Lesson 27 Choosing a Real-Time Operating System.pptLesson 27 Choosing a Real-Time Operating System.ppt
Lesson 27 Choosing a Real-Time Operating System.ppt
 
Lesson 6 Analog to Digital Converters (Lecture 3).ppt
Lesson 6 Analog to Digital Converters (Lecture 3).pptLesson 6 Analog to Digital Converters (Lecture 3).ppt
Lesson 6 Analog to Digital Converters (Lecture 3).ppt
 
Lesson 5 Low-pass Filters (Lecture 3).ppt
Lesson 5 Low-pass Filters (Lecture 3).pptLesson 5 Low-pass Filters (Lecture 3).ppt
Lesson 5 Low-pass Filters (Lecture 3).ppt
 
Lesson 2 Memory Devices.ppt
Lesson 2 Memory Devices.pptLesson 2 Memory Devices.ppt
Lesson 2 Memory Devices.ppt
 
Lesson 1 VLSI Technology.ppt
Lesson 1 VLSI Technology.pptLesson 1 VLSI Technology.ppt
Lesson 1 VLSI Technology.ppt
 
2 STM32's Interrupts.pptx
2 STM32's Interrupts.pptx2 STM32's Interrupts.pptx
2 STM32's Interrupts.pptx
 
3 STM32's ADC.ppt
3 STM32's ADC.ppt3 STM32's ADC.ppt
3 STM32's ADC.ppt
 
6 STM32's USART.ppt
6 STM32's USART.ppt6 STM32's USART.ppt
6 STM32's USART.ppt
 

Recently uploaded

Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 

Recently uploaded (20)

Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 

4 STM32's SysTick.ppt

  • 2. Directory SysTick Introduction 1 SysTick Function description 2 SysTick Basic operations 3
  • 4. SysTick Introduction The System Tick Timer (SysTick) generates interrupt requests on a regular basis. This allows an OS to carry out context switching to support multiple tasking.
  • 5. SysTick Introduction ARM Cortex-M3 Timer On-Chip peripherals JTAG SWD CPU SysTick NVIC Chips from different manufacturers NVIC ARM Cortex-M3 Kernel Nested Vector Interrupt Controller SysTick is a 24-bit system clock counter, down counting mode, it belongs to ARM Cortex-M3 kernel NVIC in a functional unit, often used for operating system clock timing. Without operating system, the Systick can be used as a general timer/counter
  • 6. JTAG & SWD  Serial Wire Debug (SWD) is a 2-pin (SWDIO/SWCLK) electrical alternative JTAG interface that has the same JTAG protocol on top. SWD uses an ARM CPU standard bi-directional wire protocol.  Joint Test Action Group (JTAG) is an electronics industry association formed in 1985 for developing a method of verifying designs and testing printed circuit boards after manufacture.
  • 7. NVIC (Nested Vector Interrupt Controller)  Asynchronous interrupts don’t wait for previous ones to be handled - if you’re handling the last one when a new one comes along, you either ignore it or you have a CPU that can nest them and handle it when you finish the current one (or preserve the current state and handle the new one - it depends on priority).
  • 9. TI Cortex-M3 NXP Cortex-M3 TI Cortex-M3 SysTick Introduction Operating system code porting Using Timers as System Clock Can't be Carried directly. Can be carried directly µC/OS-II Operating NXP Cortex-M3 µC/OS-II Operating Use SysTick as System Clock
  • 10. SysTick Introduction  Systick timers can be used for other purposes in addition to operating systems: as a alarm, for measuring time.  Note that when the processor is called to stop during debugging (Halt), the Systick timer will also be suspended.
  • 11. Directory SysTick Introduction 1 SysTick Function description 2 SysTick Basic operations 3
  • 12. SysTick Registers SysTick can be configured through the 4 registers:
  • 13. SysTick Structure Diagram FLAG RELOAD CURRENT 0 ENABLE TICKINT CLKSOURCE 0 1 Reload value register Current Value Registers Control and Status registers Clock Interrupt
  • 14. Register description  SysTick Control and Status registers (SysTick_CSR) COUNTFLAG CLKSOURCE TICKINT ENABLE bit0 bit1 bit2 bit16 Counter flag bit 0: Read zeroing 1: The counting value is reduced from 1 to 0 Clock source Selection bit 0: External reference clock-HCLK/8 1: Kernel clock-HCLK 0: No interruption 1: Allow interrupt Interrupt Enable bit Counter enables bit 0: Prohibition 1: Enable Count values from 1 to 0 triggers an Interrupt. The bit will automatically clear 0 after reading; can be used for query mode timing
  • 15. SysTick Clock source SysTick's clock source can be HCLK/8 or HCLK specifically which can be selected by configuring control and status registers (CTRL).
  • 16. 0  Current Value Registers (SysTick_VAL) Register description The current value register displays the current value of the SysTick counter. Every 1 system clock cycles, the value minus 1, when the count is reduced to 0, can produce interrupts and load the values of the reload value registers. 0x000003 Count Flag bit COUNTFLAG Interrupt Current Value Registers Reload Value Registers 0x000003 0x000002 0x000001 0x000000 0x000003 0x000003 1 0x000000 Any value Write any value to zero and cause the sign to be zeroed.
  • 17. Directory SysTick Introduction 1 SysTick Function description 2 SysTick Basic operations 3
  • 18. SysTick How to Run Select Clock Source Set Reload values Enable SysTick interruption Enable SysTick counter CTRL—>CLKSOURCE When the count value is reduced from 1 to 0, the interrupt is generated Start Counter & Start Countdown RELOAD=(SysClock * Timing time) -1 Empty Current Value Registers Automatically load reload values when the count is 0
  • 19. SysTick How to Run CURRENT FLAG 0x000003 RELOAD 0x000000 0 ENABLE TICKINT CLKSOURCE 0 1 Clock Interrupt Select Kernel Clock 1 Set Reload values 2 Enable interruption 3 Enable counter 4 0x000003 0x000002 0x000000 0x000001 1 Interrupt 1 1