SlideShare a Scribd company logo
1 of 28
Microprocessors systems
Vlasov Sergey
smvlasov@itmo.ru
Kirsanova Aleksandra
ARM
Advanced RISC Machine <=> Acorn RISC Machine
• ARM7
• ARM9, ARM11
• Cortex A
• Cortex M
• Cortex-M0, Cortex-M0+, Cortex-M1
• Cortex-M3
• Cortex-M4, Cortex-M7
• Cortex-M23, Cortex-M33
RISC
reduced instruction set computer
• RISC processors use a small and limited number of
instructions
• RISC machines mostly uses hardwired control unit
• RISC processors consume less power and have high
performance
• Each instruction is very simple and consistent
• RISC processors use simple addressing modes
• RISC instruction is of uniform fixed length
• Large Number of Registers
ARM Cortex-M
• Microcontrollers
• ASIC (Application-specific integrated circuit)
• ASSP (Application-specific standard product)
• FPGA
• SoC (System-on-crystal)
ARM Cortex-M
Arm Core
Cortex
M0
Cortex
M0+
Cortex
M1
Cortex
M3
Cortex
M4
Cortex
M7
Cortex
M23
Cortex
M33
Cortex
M35P
ARM architecture ARMv6-M ARMv6-M ARMv6-M ARMv7-M ARMv7E-M ARMv7E-M
ARMv8-M
Baseline
ARMv8-M
Mainline
ARMv8-M
Mainline
Computer architecture
Von
Neuman
Von
Neumann
Von
Neumann
Harvard Harvard Harvard Von Neumann Harvard Harvard
Instruction pipeline 3 stages 2 stages 3 stages 3 stages 3 stages 6 stages 2 stages 3 stages 3 stages
Thumb-1 instructions Most Most Most Entire Entire Entire Most Entire Entire
Thumb-2 instructions Some Some Some Entire Entire Entire Some Entire Entire
Multiply instructions
32x32 = 32-bit result
Yes Yes Yes Yes Yes Yes Yes Yes Yes
Multiply instructions
32x32 = 64-bit result
No No No Yes Yes Yes No Yes Yes
Divide instructions
32/32 = 32-bit quotient
No No No Yes Yes Yes Yes Yes Yes
Saturated instructions No No No Some Yes Yes No Yes Yes
DSP instructions No No No No Yes Yes No Optional Optional
Interrupt latency
(if zero-wait state RAM)
16 cycles 15 cycles
23 for NMI
26 for IRQ
12 cycles 12 cycles 12 cycles
15 no security
ext
27 security ext
TBD TBD
ARM Cortex-M
Von Neumann (Princeton) Harvard
ARM Cortex-M
Instruction pipeline
•IF — Instruction Fetch,
•ID — Instruction Decode,
•EX — Execute,
•MEM — Memory access,
•WB — Register write back.
ARM Cortex-M
Instruction pipeline
Pipeline states:
1. Fetch
2. Decode
3. Execute
4. Write-back
ARM Cortex-M
Instruction pipeline
Pipeline states:
1. Fetch
2. Decode
3. Execute
4. Write-back
ARM Cortex-M
Processor registers
The processor has the following 32-bit registers:
• 13 general-purpose registers, r0-r12
• Stack Pointer (SP) alias of banked registers,
SP_process and SP_main
• Link Register (LR), r14
• Program Counter (PC), r15
• Special-purpose Program Status Registers,
(xPSR).
ARM Cortex-M
Processor registers
ARM Cortex-M
STM32
ARM Cortex-M – STM32
ARM Cortex-M – STM32
ARM Cortex-M
Memory
ARM Cortex-M – STM32
Power
ARM Cortex-M
Clock tree
General-purpose I/O
Main features
• Up to 16 I/Os under control
• Output states: push-pull or open drain + pull-up/down
• Output data from output data register (GPIOx_ODR)
• Speed selection for each I/O
• Input states: floating, pull-up/down, analog
• Input data to input data register (GPIOx_IDR)
• Bit set and reset register (GPIOx_BSRR) for bitwise write access to GPIOx_ODR
• Locking mechanism (GPIOx_LCKR) provided to freeze the I/O configuration
• Analog function
• Alternate function input/output selection registers (at most 16 AFs per I/O)
• Fast toggle capable of changing every two clock cycles
• Highly flexible pin multiplexing allows the use of I/O pins as GPIOs or as
one of several peripheral functions
General-purpose I/O
General-purpose I/O
Input configuration
General-purpose I/O
Output configuration
General-purpose I/O
Alternate function configuration
General-purpose I/O
Selecting an alternate function
Port
AF0
SYS
AF1
TIM1/2
Afn
…
PORTA
PA0 -
TIM2_CH1/
TIM2_ETR
…
PA1 - TIM2_CH2 …
PAn - TIM2_CH3 …
…
… … … …
General-purpose I/O
Analog configuration
ARM Cortex-M
Example. Work with registers
button = *((uint32_t *)(0x40000000U + 0x00020000 + 0x10)) & 0x1;
button = GPIOA->IDR & GPIO_IDR_ID0;
Task 1. Read button state
• PERIPH_BASE = 0x40000000
• AHB1_BASE = PERIPH_BASE + 0x00020000
• GPIOA_BASE = AHB1_BASE + 0x0000
• Input Data Reg = 0x10
ARM Cortex-M
Example. Work with registers
*((uint32_t *)(0x40000000 + 0x00020000 + 0x0C00 + 0x14)) =
*((uint32_t *)(0x40000000 + 0x00020000 + 0x0C00 + 0x14)) | 0x1000;
GPIOD->ODR = GPIOD->ODR | GPIO_ODR_OD12; <=> GPIO->ODR |= 1 << 12;
Task 2. Turn led On
• PERIPH_BASE = 0x40000000
• AHB1_BASE = PERIPH_BASE + 0x00020000
• GPIOD_BASE = AHB1_BASE + 0x0C00
• Output Data Reg = 0x14
Read -> Modify -> Write
ARM Cortex-M
Bit Banding
Address in the bit band alias region = Bit band alias base address + bit word offset
Where bit word offset = Byte offset from bit band base X32 + bit number X4
• PERIPH_BASE = 0x40000000 (PER_Base)
• GPIOD->ODR = 0x40020C14 (WORD)
• Bit Band Alias base = 0x42000000 (BBA_Base)
• PIN = 12
• BIT = BBA_Base + (WORD – PER_Base)*32 + PIN*4;
Byte offset from bit band base Bit number
Thank you for your attention
www.ifmo.ru

More Related Content

What's hot

ARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introductionARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introductionanand hd
 
4. motherboard
4.   motherboard4.   motherboard
4. motherboardjazz_306
 
SOC - system on a chip
SOC - system on a chipSOC - system on a chip
SOC - system on a chipParth Kavi
 
Msp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modesMsp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modesHarsha herle
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseFastBit Embedded Brain Academy
 
System On Chip
System On ChipSystem On Chip
System On ChipA B Shinde
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRavikumar Tiwari
 
VLSI Design-Lecture2 introduction to ic technology
VLSI Design-Lecture2 introduction to ic technologyVLSI Design-Lecture2 introduction to ic technology
VLSI Design-Lecture2 introduction to ic technologysritulasiadigopula
 
DRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write OperationsDRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write OperationsNaman Bhalla
 
Stm32 f4 first touch
Stm32 f4 first touchStm32 f4 first touch
Stm32 f4 first touchBenux Wei
 
Typical configuration of computer chapter 1
Typical configuration of computer chapter 1 Typical configuration of computer chapter 1
Typical configuration of computer chapter 1 Gopi Nath
 
Chipset PowerPointPresentation
Chipset PowerPointPresentationChipset PowerPointPresentation
Chipset PowerPointPresentationAmilma
 

What's hot (20)

System-on-Chip
System-on-ChipSystem-on-Chip
System-on-Chip
 
ARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introductionARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introduction
 
4. motherboard
4.   motherboard4.   motherboard
4. motherboard
 
SOC design
SOC design SOC design
SOC design
 
SOC - system on a chip
SOC - system on a chipSOC - system on a chip
SOC - system on a chip
 
System on Chip (SoC)
System on Chip (SoC)System on Chip (SoC)
System on Chip (SoC)
 
Msp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modesMsp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modes
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
 
System On Chip
System On ChipSystem On Chip
System On Chip
 
Bios
BiosBios
Bios
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
 
VLSI Design-Lecture2 introduction to ic technology
VLSI Design-Lecture2 introduction to ic technologyVLSI Design-Lecture2 introduction to ic technology
VLSI Design-Lecture2 introduction to ic technology
 
SRAM DRAM
SRAM DRAMSRAM DRAM
SRAM DRAM
 
DRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write OperationsDRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write Operations
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part1
 
Stm32 f4 first touch
Stm32 f4 first touchStm32 f4 first touch
Stm32 f4 first touch
 
Typical configuration of computer chapter 1
Typical configuration of computer chapter 1 Typical configuration of computer chapter 1
Typical configuration of computer chapter 1
 
Chipset PowerPointPresentation
Chipset PowerPointPresentationChipset PowerPointPresentation
Chipset PowerPointPresentation
 
Storage devices
Storage devicesStorage devices
Storage devices
 
DDR SDRAMs
DDR SDRAMsDDR SDRAMs
DDR SDRAMs
 

Similar to Guide to ARM Cortex-M Microcontrollers and Microprocessor Systems

Similar to Guide to ARM Cortex-M Microcontrollers and Microprocessor Systems (20)

LPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.pptLPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.ppt
 
Unit II Arm 7 Introduction
Unit II Arm 7 IntroductionUnit II Arm 7 Introduction
Unit II Arm 7 Introduction
 
arm_3.ppt
arm_3.pptarm_3.ppt
arm_3.ppt
 
Unit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptxUnit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptx
 
AAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's modelAAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's model
 
Arm corrected ppt
Arm corrected pptArm corrected ppt
Arm corrected ppt
 
2 introduction to arm architecture
2 introduction to arm architecture2 introduction to arm architecture
2 introduction to arm architecture
 
Arm
ArmArm
Arm
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC Machine
 
arm
armarm
arm
 
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
 
Arm processor
Arm processorArm processor
Arm processor
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
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
 
Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer model
 
ARM Versions, architecture
ARM Versions, architectureARM Versions, architecture
ARM Versions, architecture
 
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
 
ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
Arm
ArmArm
Arm
 
Arm architecture overview
Arm architecture overviewArm architecture overview
Arm architecture overview
 

More from GautamDhargalkar1

More from GautamDhargalkar1 (7)

Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptx
 
Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptx
 
Lecture 3.pptx
Lecture 3.pptxLecture 3.pptx
Lecture 3.pptx
 
Lecture 2.pptx
Lecture 2.pptxLecture 2.pptx
Lecture 2.pptx
 
Indian_Flag_Template.potx
Indian_Flag_Template.potxIndian_Flag_Template.potx
Indian_Flag_Template.potx
 
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.pptTypical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
 

Recently uploaded

CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 

Recently uploaded (20)

young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 

Guide to ARM Cortex-M Microcontrollers and Microprocessor Systems

  • 2. ARM Advanced RISC Machine <=> Acorn RISC Machine • ARM7 • ARM9, ARM11 • Cortex A • Cortex M • Cortex-M0, Cortex-M0+, Cortex-M1 • Cortex-M3 • Cortex-M4, Cortex-M7 • Cortex-M23, Cortex-M33
  • 3. RISC reduced instruction set computer • RISC processors use a small and limited number of instructions • RISC machines mostly uses hardwired control unit • RISC processors consume less power and have high performance • Each instruction is very simple and consistent • RISC processors use simple addressing modes • RISC instruction is of uniform fixed length • Large Number of Registers
  • 4. ARM Cortex-M • Microcontrollers • ASIC (Application-specific integrated circuit) • ASSP (Application-specific standard product) • FPGA • SoC (System-on-crystal)
  • 5. ARM Cortex-M Arm Core Cortex M0 Cortex M0+ Cortex M1 Cortex M3 Cortex M4 Cortex M7 Cortex M23 Cortex M33 Cortex M35P ARM architecture ARMv6-M ARMv6-M ARMv6-M ARMv7-M ARMv7E-M ARMv7E-M ARMv8-M Baseline ARMv8-M Mainline ARMv8-M Mainline Computer architecture Von Neuman Von Neumann Von Neumann Harvard Harvard Harvard Von Neumann Harvard Harvard Instruction pipeline 3 stages 2 stages 3 stages 3 stages 3 stages 6 stages 2 stages 3 stages 3 stages Thumb-1 instructions Most Most Most Entire Entire Entire Most Entire Entire Thumb-2 instructions Some Some Some Entire Entire Entire Some Entire Entire Multiply instructions 32x32 = 32-bit result Yes Yes Yes Yes Yes Yes Yes Yes Yes Multiply instructions 32x32 = 64-bit result No No No Yes Yes Yes No Yes Yes Divide instructions 32/32 = 32-bit quotient No No No Yes Yes Yes Yes Yes Yes Saturated instructions No No No Some Yes Yes No Yes Yes DSP instructions No No No No Yes Yes No Optional Optional Interrupt latency (if zero-wait state RAM) 16 cycles 15 cycles 23 for NMI 26 for IRQ 12 cycles 12 cycles 12 cycles 15 no security ext 27 security ext TBD TBD
  • 6. ARM Cortex-M Von Neumann (Princeton) Harvard
  • 7. ARM Cortex-M Instruction pipeline •IF — Instruction Fetch, •ID — Instruction Decode, •EX — Execute, •MEM — Memory access, •WB — Register write back.
  • 8. ARM Cortex-M Instruction pipeline Pipeline states: 1. Fetch 2. Decode 3. Execute 4. Write-back
  • 9. ARM Cortex-M Instruction pipeline Pipeline states: 1. Fetch 2. Decode 3. Execute 4. Write-back
  • 10. ARM Cortex-M Processor registers The processor has the following 32-bit registers: • 13 general-purpose registers, r0-r12 • Stack Pointer (SP) alias of banked registers, SP_process and SP_main • Link Register (LR), r14 • Program Counter (PC), r15 • Special-purpose Program Status Registers, (xPSR).
  • 16. ARM Cortex-M – STM32 Power
  • 18. General-purpose I/O Main features • Up to 16 I/Os under control • Output states: push-pull or open drain + pull-up/down • Output data from output data register (GPIOx_ODR) • Speed selection for each I/O • Input states: floating, pull-up/down, analog • Input data to input data register (GPIOx_IDR) • Bit set and reset register (GPIOx_BSRR) for bitwise write access to GPIOx_ODR • Locking mechanism (GPIOx_LCKR) provided to freeze the I/O configuration • Analog function • Alternate function input/output selection registers (at most 16 AFs per I/O) • Fast toggle capable of changing every two clock cycles • Highly flexible pin multiplexing allows the use of I/O pins as GPIOs or as one of several peripheral functions
  • 23. General-purpose I/O Selecting an alternate function Port AF0 SYS AF1 TIM1/2 Afn … PORTA PA0 - TIM2_CH1/ TIM2_ETR … PA1 - TIM2_CH2 … PAn - TIM2_CH3 … … … … … …
  • 25. ARM Cortex-M Example. Work with registers button = *((uint32_t *)(0x40000000U + 0x00020000 + 0x10)) & 0x1; button = GPIOA->IDR & GPIO_IDR_ID0; Task 1. Read button state • PERIPH_BASE = 0x40000000 • AHB1_BASE = PERIPH_BASE + 0x00020000 • GPIOA_BASE = AHB1_BASE + 0x0000 • Input Data Reg = 0x10
  • 26. ARM Cortex-M Example. Work with registers *((uint32_t *)(0x40000000 + 0x00020000 + 0x0C00 + 0x14)) = *((uint32_t *)(0x40000000 + 0x00020000 + 0x0C00 + 0x14)) | 0x1000; GPIOD->ODR = GPIOD->ODR | GPIO_ODR_OD12; <=> GPIO->ODR |= 1 << 12; Task 2. Turn led On • PERIPH_BASE = 0x40000000 • AHB1_BASE = PERIPH_BASE + 0x00020000 • GPIOD_BASE = AHB1_BASE + 0x0C00 • Output Data Reg = 0x14 Read -> Modify -> Write
  • 27. ARM Cortex-M Bit Banding Address in the bit band alias region = Bit band alias base address + bit word offset Where bit word offset = Byte offset from bit band base X32 + bit number X4 • PERIPH_BASE = 0x40000000 (PER_Base) • GPIOD->ODR = 0x40020C14 (WORD) • Bit Band Alias base = 0x42000000 (BBA_Base) • PIN = 12 • BIT = BBA_Base + (WORD – PER_Base)*32 + PIN*4; Byte offset from bit band base Bit number
  • 28. Thank you for your attention www.ifmo.ru