Real Time & Embedded Systems. STM32 GPIO and Timers

Size: px
Start display at page:

Download "Real Time & Embedded Systems. STM32 GPIO and Timers"

Transcription

1 Real Time & Embedded Systems STM GPIO and Timers

2 GPIO

3 Memory Map of Cortex-M. GB xffffffff xe System NVIC, System Timer, SCB, vendor-specific memory GB External Device Such as SD card xa GB External RAM GB Off-chip memory for data. GB. GB x x Peripheral SRAM AHB & APB, such as timers, GPIO On-chip RAM, for heap, stack, & cod. GB x x Code On-chip Flash, for code & data One Byte (8 bits)

4 Memory Map of STML. GB xffffffff System xe GB External Device GB. GB. GB. GB xa x x x x External RAM Peripheral SRAM Code x x8 x8c x88 x8 x8 x GPIO D ( KB) GPIO C ( KB) GPIO B ( KB) GPIO A ( KB) One Byte (8 bits)

5 GPIO Memory Map x8 x8 x8 GPIO A ( KB) x8c x88 x8 x8 x8c x88 x8 x8 x8c x88 x8 x8 ASCR BRR AFR[] AFR[] LCKR BSRR ODR IDR PUPDR OSPEEDR OTYPER MODER 8 bytes Each register has bytes

6 GPIO Memory Map x8 Set pin A. to high x8 x8 GPIO A ( KB) x8c x88 x8 x8 x8c x88 x8 x8 x8c x88 x8 x8 ASCR BRR AFR[] AFR[] LCKR BSRR ODR IDR PUPDR OSPEEDR OTYPER MODER 8 bytes Set bit of ODR to high

7 Output Data Register (ODR) x87 x8 ODR word (i.e. bits) x87 x8 x8 x8 bytes Little Endian

8 Output Data Register (ODR) x87 x8 ODR word (i.e. bits) x87 x8 x8 x8 bytes Little Endian *((uint_t *) x8) = UL<<; Dereferencing a pointer Bitwise OR 8

9 Dereferencing a Memory Address x8c x88 x8 x8 x8c x88 x8 x8 x8c x88 x8 x8 ASCR BRR AFR[] AFR[] LCKR BSRR ODR IDR PUPDR OSPEEDR OTYPER MODER typedef struct { volatile uint_t MODER; // Mode register volatile uint_t OTYPER; // Output type register volatile uint_t OSPEEDR; // Output speed register volatile uint_t PUPDR; // Pull-up/pull-down register volatile uint_t IDR; // Input data register volatile uint_t ODR; // Output data register volatile uint_t BSRR; // Bit set/reset register volatile uint_t LCKR; // Configuration lock register volatile uint_t AFR[]; // Alternate function registers volatile uint_t BRR; // Bit Reset register volatile uint_t ASCR; // Analog switch control register } GPIO_TypeDef; // Casting memory address to a pointer #define GPIOA ((GPIO_TypeDef *) x8) GPIOA->ODR = UL<<; 9

10 General Purpose Input/Output (GPIO) 8 GPIO Ports: A, B, C, D, E, F, G, H Up to pins in each port

11 Basic Structure of an I/O Port Bit Input and Output Schmitt trigger volts=.8v

12 GPIO Input: Pull Up and Pull Down A digital input can have three states: High, Low, and High-Impedance (also called floating, tri-stated, HiZ) Pull-Up If external input is HiZ, the input is read as a valid HIGH. Pull-Down If external input is HiZ, the input is read as a valid LOW.

13 Buttons / switches

14 I/O Debouncing Example signal when a button is pressed Voltage across push button Time (microseconds)

15 Noisy analog signals V in Threshold Analog signals Noisy Rise and fall slowly (small slew rate) A button press can generate a noisy transition for up to msec if not debounced in hardware

16 produce noisy digital signals V in Threshold Simple Comparator

17 Schmitt Trigger V out V in V out V TH V TL Immunity Band V TH V in V out V TL V in V DD Schmitt Trigger V out V TL V TH V in V DD Simple Comparator Trigger Low Trigger High 7

18 Basic Structure of an I/O Port Bit: Input bit= volts=.8v Schmitt trigger Input Data Register (IDR) GPIO Pull-up/Pull-down Register (PUPDR) = No pull-up, pull-down = Pull-up = Pull-down = Reserved 8

19 TIMERS 9

20 Timer Free-run counter (independent of processor) Functions Input capture Output compare Pulse-width modulation (PWM) generation One-pulse mode output STM has many application notes (on all aspects of the STM) App note AN77 General Purpose Timer Cookbook

21 Timer: Clock Reload Value ARR Reload f CL_PSC clock PSC Prescaler f CL_CNT Timer Counter ISR Interrupt ff CCCC_CCCCCC = ff CCCC_PPPPPP PPPPPP +

22 Timer: Output Reload Value ARR Reload f CL_PSC clock PSC Prescaler f CL_CNT Timer Counter ISR Interrupt = Timer Output (OCREF) Compare & Capture Register (CCR)

23 Timer: Input Capture Reload Value ARR Reload f CL_PSC clock PSC Prescaler f CL_CNT Timer Counter ISR Interrupt Trigger event (e.g. rising edge of external signal) Compare & Capture Register (CCR)

24 Multi-Channel Outputs

25 PWM Mode (Pulse Width Modulation) Period Period = T off + T on Mode Duty Cycle = TT oooo TT oooooo +TT oooo Mode Counter < Reference Counter Reference PWM mode (Low True) PWM mode (High True) Active Low Inactive Inactive Active High

26 Edge-aligned Mode (Up-counting) ARR =, RCR = clock counter Counter overflow Counter overflow Counter overflow Counter overflow Update event (UEV) Period = ( + ARR) * Clock Period = 7 * Clock Period ARR = Auto-Reload Register UEV = Update Event RCR = Repetition Count Register

27 Edge-aligned Mode (downcounting) ARR =, RCR = Clock Counter Counter underflow Counter underflow Counter underflow Counter underflow Update event (UEV) Period = ( + ARR) * Clock Period = 7 * Clock Period 7

28 Center-aligned Mode ARR =, RCR = Clock Counter Counter overflow Counter underflow Counter overflow Counter underflow Update event (UEV) Period = ( * ARR) * Clock Period = * Clock Period 8

29 PWM Mode (Low-True) Timer Output = High if counter < CCR Low if counter CCR Upcounting mode, ARR =, CCR =, RCR = Clock Counter CCR = OCREF CCR Duty Cycle = ARR + = 7 Period = ( + ARR) * Clock Period = 7 * Clock Period 9

30 PWM Mode (High-True) Timer Output = Low if counter < CCR High if counter CCR Upcounting mode, ARR =, CCR =, RCR = Clock Counter CCR = OCREF Duty Cycle = - = 7 CCR ARR + Period = ( + ARR) * Clock Period = 7 * Clock Period

31 PWM Mode (High-True) Timer Output = Low if counter < CCR High if counter CCR Upcounting mode, ARR =, CCR =, RCR = Clock Counter CCR = OCREF Duty Cycle = - = 7 CCR ARR + Period = ( + ARR) * Clock Period = 7 * Clock Period

32 PWM Mode (High-True) Timer Output = Low if counter < CCR High if counter CCR Center-aligned mode, ARR =, CCR =, RCR = Clock Counter CCR = OCREF Duty Cycle = - CCR ARR = Period = * ARR * Clock Period = * Clock Period

33 PWM Mode (High-True) Timer Output = Low if counter < CCR High if counter CCR Center-aligned mode, ARR =, CCR =, RCR = Clock Counter CCR = OCREF Duty Cycle = - CCR ARR = Period = * ARR * Clock Period = * Clock Period

34 Auto-Reload Register (ARR) Auto-Reload Preload Enable (ARPE) bit in TIMx_CR ARPE = (Synchronous Update) Write to ARR Read from ARR Preload Register Auto-reload Register (ARR) If UDIS bit in TIMx_CR is, UEV event is disabled. Triggered by Update Event (UEV) ARPE = (Asynchronous Update) Write to ARR Read from ARR Auto-reload Register (ARR)

35 Repetition Counter Register (RCR)

36 Repetition Counter Register (RCR)

37 Repetition Counter Register (RCR) 7

38 Repetition Counter Register (PCR) 8

39 Repetition Counter Register (PCR) 9

40 PWM Output Polarity Mode Counter < CCR Counter CCR PWM mode (Low True) PWM mode (High True) Active (Low) Inactive Inactive Active (High) Output Polarity: Software can program the CCxP bit in the TIMx_CCER register Active Inactive Active High High Voltage Low Voltage Active Low Low Voltage High Voltage

41 Up-Counting: Left Edge-aligned Upcounting mode, ARR =, CCR =, RCR = Clock Counter CCR = CCR = CCR = OCREF CCR = OCREF All rising edges occur at the same time! Left-aligned PWM Period

42 PWM Mode : Right Edge-aligned Upcounting mode, ARR =, CCR =, RCR = Clock Counter CCR = CCR = OCREF CCR = OCREF CCR = All falling edges occur at the same time! Right-aligned PWM Period

43 PWM Mode : Center Aligned Timer Output = Low if counter < CCR High if counter CCR Center-aligned mode, ARR =, CCR =, RCR = Clock Counter CCR = CCR = OCREF CCR = OCREF CCR = PWM signals are center aligned! Center-aligned PWM Period

44 The devil is in the detail Timer output control Enable Timer Output MOE: Main output enable OSSI: Off-state selection for Idle mode OSSR: Off-state selection for Run mode CCxE: Enable of capture/compare output for channel x CCxNE: Enable of capture/compare complementary output for channel x

45 Input Capture Monitor both rising and falling edge

46 Input Capture Monitor only rising edges or only falling edge

47 Input Capture 7

48 Input Capture Diagram 8

49 WHY IS THE MEASUREMENT OF TIME INTERESTING??? 9

50 Bats use echolocation to map their surroundings?

51 Ultrasonic Distance Sensor DDDDDDDDDDDDDDDD = RRRRRRRRRR TTTTTTTT TTTTTTTT SSSSSSSSSS oooo SSSSSSSSSS = RRRRRRRRRR TTTTTTTT TTTTTTTT µss mm/ss = RRRRRRRRRR TTTTTTTT TTTTTTTT µss 8

52 Ultrasonic Distance Sensor The delay from triggered chirp to echo response is the round-trip time t RT. Trigger a call t RT DDDDDDDDDDDDDDDD (cccc) = RRRRRRRRRR tttttttt tttttttt (μμμμ) Echo response If t RT > is ms, no obstacle is detected.

53 Ultrasonic Distance Sensor

General Purpose Timers. Chapter 15

General Purpose Timers. Chapter 15 General Purpose Timers Chapter Timer Free-run counter (independent of processor) Functions Input capture Output compare Pulse-width modulation (PWM) generation Block Diagram Timer: Clock Reload Value ARR

More information

Digital Input and Output

Digital Input and Output 1 Digital Input and Output Module Syllabus Digital Input and Output Voltages and Logic Values GPIO Controller Using Pointer to Access GPIO Define Data Structure for Peripherals Digital IO Examples Using

More information

Using the Special Function Registers of the Digital I/O interface of STM32

Using the Special Function Registers of the Digital I/O interface of STM32 Using the Special Function Registers of the Digital I/O interface of STM32 ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it

More information

Using the Special Function Registers of the Digital I/O interface of STM32

Using the Special Function Registers of the Digital I/O interface of STM32 Using the Special Function Registers of the Digital I/O interface of STM32 ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it

More information

ELEC 3040/3050 Lab Manual Lab 2 Revised 8/20/14. LAB 2: Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller

ELEC 3040/3050 Lab Manual Lab 2 Revised 8/20/14. LAB 2: Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller LAB 2: Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller The objective of this laboratory session is to become more familiar with the process for creating, executing and

More information

The following is copied from STM32L15xxx reference manual (RM0038). Timer Register Map

The following is copied from STM32L15xxx reference manual (RM0038). Timer Register Map The following is copied from STM32L15xxx reference manual (RM0038). Timer Register Map Offset Register 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0x00 0x04 0x08

More information

12.1 TIM1 introduction

12.1 TIM1 introduction Advanced-control timer (TIM1) 12 Advanced-control timer (TIM1) TIM8 is not available in STM32F401xB/C and STM32F401xD/E. 12.1 TIM1 introduction The advanced-control timers (TIM1) consist of a 16-bit auto-reload

More information

Input/Output Programming

Input/Output Programming Input/Output Programming Chapter 3: Section 3.1, 3.2 Input and output (I/O) programming Communicating with I/O devices Busy-wait I/O Interrupt-driven I/O I/O devices Devices may include digital and non-digital

More information

Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller

Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller ELCE 3040/3050 Lab Session 2 (write-up on course web page) Important References (on course web page): Tutorial: C programming

More information

STM32F100RB processor GPIO notes rev 2

STM32F100RB processor GPIO notes rev 2 STM32F100RB processor GPIO notes rev 2 ST Microelectronics company ARM based processors are considered microcontrollers because in addition to the CPU and memory they include timer functions and extensive

More information

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an Microcontroller Basics MP2-1 week lecture topics 2 Microcontroller basics - Clock generation, PLL - Address space, addressing modes - Central Processing Unit (CPU) - General Purpose Input/Output (GPIO)

More information

ECE 271 Microcomputer Architecture and Applications University of Maine

ECE 271 Microcomputer Architecture and Applications University of Maine Goals Lab 7: Timer Input Capture in C Instructor: Prof. Yifeng Zhu Spring 2015 1. Understand the basic concept of input capture function of a timer 2. Handle different events in the interrupt service routine

More information

STM32 MICROCONTROLLER

STM32 MICROCONTROLLER STM32 MICROCONTROLLER Lecture 2 Prof. Yasser Mostafa Kadah Harvard and von Neumann Architectures Harvard Architecture a type of computer architecture where the instructions (program code) and data are

More information

EE 354 Fall 2018 Timers and timer interrupts

EE 354 Fall 2018 Timers and timer interrupts EE 354 Fall 2018 Timers and timer interrupts The STM32F446RE has 14 timers that are classified as Advanced Control Timers (2), General Purpose (4 are either 16-bit or 32-bit timers and 6 are 16-bit timers),

More information

Introduction to Embedded Systems

Introduction to Embedded Systems Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems

More information

ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview

ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview M J Brockway January 25, 2016 UM10562 All information provided in this document is subject to legal disclaimers. NXP B.V. 2014. All

More information

ELEC 3040/3050 Lab 6. Time-based interrupts (Digital stopwatch design)

ELEC 3040/3050 Lab 6. Time-based interrupts (Digital stopwatch design) ELEC 3040/3050 Lab 6 Time-based interrupts (Digital stopwatch design) Reference: STM32L100 Reference Manual, Chap. 18, General-Purpose Timers (TIM9/TIM10/TIM11) 1 Timer usage in computer systems Periodically

More information

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory Embedded Systems 3. Hardware Software Interface Lothar Thiele Computer Engineering and Networks Laboratory Do you Remember? 3 2 3 3 High Level Physical View 3 4 High Level Physical View 3 5 What you will

More information

Embedded assembly is more useful. Embedded assembly places an assembly function inside a C program and can be used with the ARM Cortex M0 processor.

Embedded assembly is more useful. Embedded assembly places an assembly function inside a C program and can be used with the ARM Cortex M0 processor. EE 354 Fall 2015 ARM Lecture 4 Assembly Language, Floating Point, PWM The ARM Cortex M0 processor supports only the thumb2 assembly language instruction set. This instruction set consists of fifty 16-bit

More information

ELC4438: Embedded System Design ARM Cortex-M Architecture II

ELC4438: Embedded System Design ARM Cortex-M Architecture II ELC4438: Embedded System Design ARM Cortex-M Architecture II Liang Dong Electrical and Computer Engineering Baylor University Memory system The memory systems in microcontrollers often contain two or more

More information

Hello, and welcome to this presentation of the STM32 general-purpose IO interface. It covers the general-purpose input and output interface and how

Hello, and welcome to this presentation of the STM32 general-purpose IO interface. It covers the general-purpose input and output interface and how Hello, and welcome to this presentation of the STM32 general-purpose IO interface. It covers the general-purpose input and output interface and how it allows connectivity to the environment around the

More information

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Microcontroller It is essentially a small computer on a chip Like any computer, it has memory,

More information

Final Exam Study Guide

Final Exam Study Guide Final Exam Study Guide Part 1 Closed book, no crib sheet Part 2 Open book, open notes, calculator (no laptops, phones, devices with screens larger than a TI-89 calculator, devices with wireless communication).

More information

ARM Microcontroller Course

ARM Microcontroller Course February 15, 2017 Please dowload the software available on https://www.scintilla.utwente.nl/docs/cursus/ourse2017 Table of ontents 1 Introduction 2 Data types Operators Events 3 The ourse Five Wednesday

More information

Hello, and welcome to this presentation of the STM32 Touch Sensing Controller (TSC) which enables the designer to simply add touch sensing

Hello, and welcome to this presentation of the STM32 Touch Sensing Controller (TSC) which enables the designer to simply add touch sensing Hello, and welcome to this presentation of the STM32 Touch Sensing Controller (TSC) which enables the designer to simply add touch sensing functionality to any application. 1 Over recent years, Touch Sensing

More information

Lab #4: GPIOs in Assembly Language Week of 18 February 2019

Lab #4: GPIOs in Assembly Language Week of 18 February 2019 ECE271: Microcomputer Architecture and Applications University of Maine Lab #4: GPIOs in Assembly Language Week of 18 February 2019 Goals 1. Learn Thumb-2 Assembly Language Pre-lab 1. Complete the pre-lab

More information

Unlocking the Potential of Your Microcontroller

Unlocking the Potential of Your Microcontroller Unlocking the Potential of Your Microcontroller Ethan Wu Storming Robots, Branchburg NJ, USA Abstract. Many useful hardware features of advanced microcontrollers are often not utilized to their fullest

More information

ARM Cortex M3 & General Purpose Input/Output (GPIO)

ARM Cortex M3 & General Purpose Input/Output (GPIO) ARM Cortex M3 & General Purpose Input/Output (GPIO) ผศ.ดร.ส ร นทร ก ตต ธรก ล และ อ.สรย ทธ กลมกล อม ภาคว ชาว ศวกรรมคอมพ วเตอร คณะว ศวกรรมศาสตร สถาบ นเทคโนโลย พระจอมเกล าเจ าค ณทหารลาดกระบ ง STM32F10x &

More information

Introduction to the MC9S12 Hardware Subsystems

Introduction to the MC9S12 Hardware Subsystems Setting and clearing bits in C Using pointers in C o Program to count the number of negative numbers in an area of memory Introduction to the MC9S12 Hardware Subsystems o The MC9S12 timer subsystem Operators

More information

ARM architecture road map. NuMicro Overview of Cortex M. Cortex M Processor Family (2/3) All binary upwards compatible

ARM architecture road map. NuMicro Overview of Cortex M. Cortex M Processor Family (2/3) All binary upwards compatible ARM architecture road map NuMicro Overview of Cortex M NuMicro@nuvoton.com 1 2 Cortex M Processor Family (1/3) Cortex M0 Cortex M0+ Cortex M3 Cortex M4 Low cost, ultra low power deeply embedded applications

More information

STG - STM32 + FreeRTOS + LwIP/EmWin

STG - STM32 + FreeRTOS + LwIP/EmWin Formation STM32 + FreeRTOS + LwIP/EmWin: This course covers the STM32 ARM-based MCU family, the FreeRTOS Real Time OS, the LWIP TCP/IP Stack and/or the EmWin GUI Stack - Processeurs ARM: ST processors

More information

May 15, 2015 EE 354 Fall 2015 Lecture 6 Timers and timer interrupts

May 15, 2015 EE 354 Fall 2015 Lecture 6 Timers and timer interrupts EE 354 Fall 2015 Lecture 6 Timers and timer interrupts The STM32F407VG has 14 timers that are classified as Advanced Control Timers (2), General Purpose (4 are either 16-bit or 32-bit timers and 6 are

More information

HC12 Built-In Hardware

HC12 Built-In Hardware HC12 Built-In Hardware The HC12 has a number of useful pieces of hardware built into the chip. Different versions of the HC12 have slightly different pieces of hardware. We are using the MC68HC912B32 chip

More information

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System EE4390 Microprocessors Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System 1 Overview 68HC12 hardware overview Subsystems Memory System 2 68HC12 Hardware Overview "Copyright of Motorola,

More information

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018 The Embedded I/O Company TPMC533 32x ADC, 16x/0x DAC and 8x Digital I/O Version 1.0 User Manual Issue 1.0.1 May 2018 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany Phone: +49 (0) 4101 4058

More information

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1 M68HC08 Microcontroller The MC68HC908GP32 Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor Design General Description The

More information

EE 308 Spring Lecture 28 March 30, 2012 Review for Exam 2. Introduction to the MC9S12 Expanded Mode

EE 308 Spring Lecture 28 March 30, 2012 Review for Exam 2. Introduction to the MC9S12 Expanded Mode Lecture 28 March 30, 2012 Review for Exam 2 Introduction to the MC9S12 Expanded Mode 1 Review for Exam 2 1. C Programming (a) Setting and clearing bits in registers PORTA = PORTA 0x02; PORTA = PORTA &

More information

The ARM Cortex-M0 Processor Architecture Part-1

The ARM Cortex-M0 Processor Architecture Part-1 The ARM Cortex-M0 Processor Architecture Part-1 1 Module Syllabus ARM Architectures and Processors What is ARM Architecture ARM Processors Families ARM Cortex-M Series Family Cortex-M0 Processor ARM Processor

More information

Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors

Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors Yifeng Zhu University of Maine ASEE Annual Conference June 2016 Install Software and Driver Each of you

More information

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers 8051 Peripherals On-Chip Memory Timers Serial Port Interrupts Computer Engineering 2 2-1 8051 Timers 8051 Timers The 8051 has 2 internal 16-bit timers named Timer 0 and Timer 1 Each timer is a 16-bit counter

More information

M2351 Security Architecture. TrustZone Technology for Armv8-M Architecture

M2351 Security Architecture. TrustZone Technology for Armv8-M Architecture Architecture TrustZone Technology for Armv8-M Architecture Outline NuMicro Architecture TrustZone for Armv8-M Processor Core, Interrupt Handling, Memory Partitioning, State Transitions. TrustZone Implementation

More information

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4 EE445M Midterm Study Guide (Spring 2017) (updated February 25, 2017): Instructions: Open book and open notes. No calculators or any electronic devices (turn cell phones off). Please be sure that your answers

More information

(Embedded) Systems Programming Overview

(Embedded) Systems Programming Overview System Programming Issues EE 357 Unit 10a (Embedded) Systems Programming Overview Embedded systems programming g have different design requirements than general purpose computers like PC s I/O Electro-mechanical

More information

ELEC 3040/3050 Lab 5. Matrix Keypad Interface Using Parallel I/O

ELEC 3040/3050 Lab 5. Matrix Keypad Interface Using Parallel I/O ELEC 3040/3050 Lab 5 Matrix Keypad Interface Using Parallel I/O Goals of this lab exercise Control a real device with the microcontroller Coordinate parallel I/O ports to control and access a device Implement

More information

AN3268 Application note

AN3268 Application note Application note STM32VLDISCOVERY firmware package Introduction The purpose of this application note is to describe the STM32VLDISCOVERY package structure and provide short descriptions of: STM32VLDISCOVERY

More information

Clock Synchronous Control Module for Serial Flash Memory Access Firmware Integration Technology

Clock Synchronous Control Module for Serial Flash Memory Access Firmware Integration Technology APPLICATION NOTE RX Family R01AN2662EJ0234 Rev.2.34 Introduction This application note explains how to control and use serial flash memory with microcontrollers manufactured by Renesas Electronics. Refer

More information

QSB Command List. Document Version /15/2017

QSB Command List. Document Version /15/2017 QSB Command List Document Version 1.25 8/15/2017 1 of 17 Terms and Conditions of License for use of gratuitous software Thank you for purchasing US Digital products. By downloading or using US Digital

More information

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang, Network Embedded Systems Sensor Networks Fall 2013 Hardware Marcus Chang, mchang@cs.jhu.edu 1 Embedded Systems Designed to do one or a few dedicated and/or specific functions Embedded as part of a complete

More information

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D The Embedded I/O Company TPMC118 6 Channel Motion Control Version 1.0 User Manual Issue 1.3 March 2003 D76118800 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek / Germany Phone: +49-(0)4101-4058-0

More information

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly.

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly. More on Programming the 9S12 in C Huang Sections 5.2 through 5.4 Introduction to the MC9S12 Hardware Subsystems Huang Sections 8.2-8.6 ECT_16B8C Block User Guide A summary of MC9S12 hardware subsystems

More information

Embedded C. ECE Rick

Embedded C. ECE Rick Embedded C ECE 362 https://engineering.purdue.edu/ee362/ Rick Reading Assignment Reading assignment: Family Reference Manual, Chapter 17, "General purpose timers (TIM2 and TIM3)", pages 377 443. Textbook,

More information

Product Technical Brief S3C2412 Rev 2.2, Apr. 2006

Product Technical Brief S3C2412 Rev 2.2, Apr. 2006 Product Technical Brief S3C2412 Rev 2.2, Apr. 2006 Overview SAMSUNG's S3C2412 is a Derivative product of S3C2410A. S3C2412 is designed to provide hand-held devices and general applications with cost-effective,

More information

AN065. AN065 Getting Started with the KXTJ3. Introduction

AN065. AN065 Getting Started with the KXTJ3. Introduction AN065 Getting Started with the KXTJ3 Introduction This application note will help developers quickly implement proof-of-concept designs using the KXTJ3 tri-axis accelerometers. Please refer to the KXTJ3

More information

AMULET2e PRELIMINARY. 32-bit Integrated Asynchronous Microprocessor. Features. Introduction

AMULET2e PRELIMINARY. 32-bit Integrated Asynchronous Microprocessor. Features. Introduction AMULET2e 32-bit Integrated Asynchronous Microprocessor Features Compatible with ARM instruction set On-chip 4Kbyte memory, configurable as cache or RAM Direct interface to static and dynamic memory devices.

More information

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1 Module 2 Embedded Processors and Memory Version 2 EE IIT, Kharagpur 1 Lesson 11 Embedded Processors - II Version 2 EE IIT, Kharagpur 2 Signals of a Typical Microcontroller In this lesson the student will

More information

Goals. Grading Rubrics (Total = 20 points) Pre-lab assignment

Goals. Grading Rubrics (Total = 20 points) Pre-lab assignment Lab : Interfacing Push-button and LED Instructor: Prof. Yifeng Zhu Spring Goals. Get familiar with the Keil uvision software development environment. Create a C project for STML discovery kit and program

More information

MICROPROCESSOR BASED SYSTEM DESIGN

MICROPROCESSOR BASED SYSTEM DESIGN MICROPROCESSOR BASED SYSTEM DESIGN Lecture 5 Xmega 128 B1: Architecture MUHAMMAD AMIR YOUSAF VON NEUMAN ARCHITECTURE CPU Memory Execution unit ALU Registers Both data and instructions at the same system

More information

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes Course Introduction Purpose: This course provides an overview of the Direct Memory Access Controller and the Interrupt Controller on the SH-2 and SH-2A families of 32-bit RISC microcontrollers, which are

More information

Product Technical Brief S3C2413 Rev 2.2, Apr. 2006

Product Technical Brief S3C2413 Rev 2.2, Apr. 2006 Product Technical Brief Rev 2.2, Apr. 2006 Overview SAMSUNG's is a Derivative product of S3C2410A. is designed to provide hand-held devices and general applications with cost-effective, low-power, and

More information

Architecture of Computers and Parallel Systems Part 6: Microcomputers

Architecture of Computers and Parallel Systems Part 6: Microcomputers Architecture of Computers and Parallel Systems Part 6: Microcomputers Ing. Petr Olivka petr.olivka@vsb.cz Department of Computer Science FEI VSB-TUO Architecture of Computers and Parallel Systems Part

More information

COMP2121: Microprocessors and Interfacing

COMP2121: Microprocessors and Interfacing Lecture 19: Interrupts II http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 1, 2006 Overview AVR Interrupts Interrupt Vector Table System Reset Watchdog Timer Timer/Counter0 Interrupt Service

More information

Chapter 2. Overview of Architecture and Microcontroller-Resources

Chapter 2. Overview of Architecture and Microcontroller-Resources Chapter 2 Overview of Architecture and Microcontroller-Resources Lesson 4 Timers, Real Time Clock Interrupts and Watchdog Timer 2 Microcontroller-resources Port P1 Port P0 Port P2 PWM Timers Internal Program

More information

Hello, and welcome to this presentation of the STM32L4 System Configuration Controller.

Hello, and welcome to this presentation of the STM32L4 System Configuration Controller. Hello, and welcome to this presentation of the STM32L4 System Configuration Controller. 1 Please note that this presentation has been written for STM32L47x/48x devices. The key differences with other devices

More information

Hello, and welcome to this presentation of the STM32 Real- Time Clock. It covers the main features of this peripheral, which is used to provide a

Hello, and welcome to this presentation of the STM32 Real- Time Clock. It covers the main features of this peripheral, which is used to provide a Hello, and welcome to this presentation of the STM32 Real- Time Clock. It covers the main features of this peripheral, which is used to provide a very accurate time base. 1 The RTC peripheral features

More information

Topic 3. ARM Cortex M3(i) Memory Management and Access. Department of Electronics Academic Year 14/15. (ver )

Topic 3. ARM Cortex M3(i) Memory Management and Access. Department of Electronics Academic Year 14/15. (ver ) Topic 3 ARM Cortex M3(i) Memory Management and Access Department of Electronics Academic Year 14/15 (ver 25-10-2014) Index 3.1. Memory maps 3.2. Memory expansion 3.3. Memory management & Data alignment

More information

Developing Reusable Device Drivers for MCU's

Developing Reusable Device Drivers for MCU's Embedded Systems Conference East 2012 Page 1 of 20 Developing Reusable Device Drivers for MCU's By Jacob Beningo www.beningo.com http://www.linkedin.com/in/jacobbeningo twitter : Jacob_Beningo EDN Blog

More information

STM32 Ecosystem workshop. T.O.M.A.S Team

STM32 Ecosystem workshop. T.O.M.A.S Team STM Ecosystem workshop T.O.M.A.S Team 2 Now it is time for some activities with STMCubeMX again Our current goal is to port provided ready project done for NUCLEO-L053R8 board (STML053R8T6 microcontroller)

More information

USB-4303 Specifications

USB-4303 Specifications Specifications Document Revision 1.0, February, 2010 Copyright 2010, Measurement Computing Corporation Typical for 25 C unless otherwise specified. Specifications in italic text are guaranteed by design.

More information

L2 - C language for Embedded MCUs

L2 - C language for Embedded MCUs Formation C language for Embedded MCUs: Learning how to program a Microcontroller (especially the Cortex-M based ones) - Programmation: Langages L2 - C language for Embedded MCUs Learning how to program

More information

ARDUINO MEGA INTRODUCTION

ARDUINO MEGA INTRODUCTION ARDUINO MEGA INTRODUCTION The Arduino MEGA 2560 is designed for projects that require more I/O llines, more sketch memory and more RAM. With 54 digital I/O pins, 16 analog inputs so it is suitable for

More information

LatticeMico32 GPIO. Version. Features

LatticeMico32 GPIO. Version. Features The LatticeMico32 GPIO is a general-purpose input/output core that provides a memory-mapped interface between a WISHBONE slave port and generalpurpose I/O ports. The I/O ports can connect to either on-chip

More information

Course Introduction. 2009, Renesas Technology America, Inc., All Rights Reserved

Course Introduction. 2009, Renesas Technology America, Inc., All Rights Reserved Course Introduction Purpose This course provides an introduction to the peripheral functions built into R8C Tiny series microcontrollers (MCUs). Objective Learn about the features and operation of the

More information

AN5181. Building a thermometer using the STM8 Nucleo-64 boards. Application note. Introduction

AN5181. Building a thermometer using the STM8 Nucleo-64 boards. Application note. Introduction Application note Building a thermometer using the STM8 Nucleo-64 boards Introduction The NUCLEO-8S208RB (built around the STM8S208RBT6 device) and the NUCLEO-8L152R8 (built around the STM8L152R8T6 device)

More information

UBC104 Embedded Systems. Review: Introduction to Microcontrollers

UBC104 Embedded Systems. Review: Introduction to Microcontrollers UBC104 Embedded Systems Review: Introduction to Microcontrollers Processors General purpose processors: 80386 Pentium Core Duo Large number of pins External memory External peripherals * Figure from Intel

More information

Systems Programming. Lecture 11 Timers

Systems Programming.   Lecture 11 Timers Systems Programming www.atomicrhubarb.com/systems Lecture 11 Timers Section Topic Where in the books Zilog PS220 (ZNEO Z16F Series Product Specification) What is a Timer (a microcontroller timer) Timers

More information

AN2585 Application note

AN2585 Application note AN2585 Application note Application examples of the STM32F101xx and STM32F103xx core and system peripherals Introduction The STM32F10xxx is built around the latest Cortex -M3 core from ARM designed for

More information

Systems Programming. Lecture 4 Z16 Architecture and Programming

Systems Programming.   Lecture 4 Z16 Architecture and Programming Systems Programming www.atomicrhubarb.com/systems Lecture 4 Z16 Architecture and Programming Section Topic Where in the books Zilog Zilog Zilog Zilog UM197 (ZNEO Z16F Series Flash Microcontroller Contest

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (Sept. 30, 2013) 1/15 538 Lecture Notes Week 5 Answers to last week's questions 1. With the diagram shown for a port (single bit), what happens if the Direction Register is read?

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (October 4, 2017) 1/18 538 Lecture Notes Week 5 Announements Midterm: Tuesday, October 25 Answers to last week's questions 1. With the diagram shown for a port (single bit), what

More information

Arduino Uno R3 INTRODUCTION

Arduino Uno R3 INTRODUCTION Arduino Uno R3 INTRODUCTION Arduino is used for building different types of electronic circuits easily using of both a physical programmable circuit board usually microcontroller and piece of code running

More information

TXZ Family Reference manual 32-bit Timer Event Counter (T32A-B)

TXZ Family Reference manual 32-bit Timer Event Counter (T32A-B) 32-bit RISC Microcontroller Reference manual (T32A-B) Revision 2.0 2018-04 2018-04-23 1 / 73 Rev. 2.0 2017-2018 Toshiba Electronic Devices & Storage Corporation Contents Preface... 6 Related Documents...

More information

A33 Nand Flash Controller Specification

A33 Nand Flash Controller Specification A33 Nand Flash Controller Specification Revision 1.0 Feb.28,2014 Copyright 2014 by Allwinner. All rights reserved Page 1 of 29 DECLARATION THIS DOCUMENTATION IS THE ORIGINAL WORK AND COPYRIGHTED PROPERTY

More information

Program SoC using C Language

Program SoC using C Language Program SoC using C Language 1 Module Overview General understanding of C, program compilation, program image, data storage, data type, and how to access peripherals using C language; Program SoC using

More information

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

EE 354 Fall 2015 Lecture 1 Architecture and Introduction EE 354 Fall 2015 Lecture 1 Architecture and Introduction Note: Much of these notes are taken from the book: The definitive Guide to ARM Cortex M3 and Cortex M4 Processors by Joseph Yiu, third edition,

More information

Table 1: Cross Reference of Applicable Products. INTERNAL PIC NUMBER Arm Cortex M0+ UT32M0R GPIO Module QS30

Table 1: Cross Reference of Applicable Products. INTERNAL PIC NUMBER Arm Cortex M0+ UT32M0R GPIO Module QS30 Standard Product Enable the GPIO Module UT32M0R500 32-bit Arm Cortex M0+ Microcontroller Application Note December 21, 2017 The most important thing we build is trust PRODUCT NAME Table 1: Cross Reference

More information

Interconnects, Memory, GPIO

Interconnects, Memory, GPIO Interconnects, Memory, GPIO Dr. Francesco Conti f.conti@unibo.it Slide contributions adapted from STMicroelectronics and from Dr. Michele Magno, others Processor vs. MCU Pipeline Harvard architecture Separate

More information

Hello, and welcome to this presentation of the STM32F7 System Configuration Controller.

Hello, and welcome to this presentation of the STM32F7 System Configuration Controller. Hello, and welcome to this presentation of the STM32F7 System Configuration Controller. 1 STM32F7 microcontrollers feature a set of configuration registers. The System Configuration Controller gives access

More information

PC87435 Enhanced IPMI Baseboard Management Controller

PC87435 Enhanced IPMI Baseboard Management Controller April 2003 Revision 1.01 PC87435 Enhanced IPMI Baseboard Management Controller General Description The PC87435 is a highlyintegrated Enhanced IPMI Baseboard Management Controller (BMC), or satellite management

More information

EIE/ENE 334 Microprocessors

EIE/ENE 334 Microprocessors EIE/ENE 334 Microprocessors Lecture 12: NuMicro NUC140 Week #12 : Dejwoot KHAWPARISUTH Adapted from http://webstaff.kmutt.ac.th/~dejwoot.kha/ NuMicro NUC140: Technical Ref. EIE/ENE 334 ARM Cortex-M0 Page

More information

AN4666 Application note

AN4666 Application note Application note Parallel synchronous transmission using GPIO and DMA Introduction The STM32 MCUs are able to emulate a parallel synchronous communication through the GPIO interface, using the embedded

More information

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX CP2130 INTERFACE SPECIFICATION 1. Introduction The Silicon Labs CP2130 USB-to-SPI bridge is a device that communicates over the Universal Serial Bus (USB) using vendor-specific control and bulk transfers

More information

Modern C++ for Embedded Systems

Modern C++ for Embedded Systems Modern C++ for Embedded Systems Part 1 Compile-Time Device Models Alexander Graf January 25th, 2019 1/27 Outline 1 Terms and Conditions :) 2 C-World Problems 3 C++ Solutions 4 Restraints in the Industry

More information

80C51 Block Diagram. CSE Overview 1

80C51 Block Diagram. CSE Overview 1 80C51 Block Diagram CSE 477 8051 Overview 1 80C51 Memory CSE 477 8051 Overview 3 8051 Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits i.e. addresses for only 256 bytes! PC is

More information

Hello, and welcome to this presentation of the STM32 I²C interface. It covers the main features of this communication interface, which is widely used

Hello, and welcome to this presentation of the STM32 I²C interface. It covers the main features of this communication interface, which is widely used Hello, and welcome to this presentation of the STM32 I²C interface. It covers the main features of this communication interface, which is widely used to connect devices such as microcontrollers, sensors,

More information

MCU: Interrupts and Timers. Ganesh Pitchiah

MCU: Interrupts and Timers. Ganesh Pitchiah MCU: Interrupts and Timers Ganesh Pitchiah What s an MCU? Frequency = 8 MHz Time Period = 1/f = 0.125 us Code for Switching LED int a; voltage while(1) { a = PINA.0; input) If (a==1) PORTA.1=1; else PORTA.1=0;

More information

TPMC Channel SSI, Incremental Encoder, Counter. Version 1.0. User Manual. Issue January 2017

TPMC Channel SSI, Incremental Encoder, Counter. Version 1.0. User Manual. Issue January 2017 The Embedded I/O Company TPMC117 6 Channel SSI, Incremental Encoder, Counter Version 1.0 User Manual Issue 1.0.5 January 2017 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany Phone: +49 (0)

More information

NuMicro Mini51 DE Series Product Brief

NuMicro Mini51 DE Series Product Brief ARM Cortex -M0 32-BIT MICROCONTROLLER NuMicro Mini51 DE Series Product Brief The information described in this document is the exclusive intellectual property of Nuvoton Technology Corporation and shall

More information

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features of this USART interface, which is widely used for serial

More information

11 General-Purpose Timers

11 General-Purpose Timers General-Purpose Timers General-Purpose Timers Programmable timers can be used to count or time external events that drive the Timer input pins. The TM4C23GH6PM General-Purpose Timer Module(GPTM) contains

More information

Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors

Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors Education of Embedded Systems Programming in C and Assembly Based on ARM s Cortex-M Microprocessors Yifeng Zhu, Libby Professor University of Maine Webinar Series October 2018 Role of Embedded Systems:

More information