Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno
|
|
- Dulcie Greene
- 5 years ago
- Views:
Transcription
1 Microcontrollers: Lecture 3 Interrupts, Timers Michele Magno 1
2 Calendar : Power consumption; Low power States; Buses, Memory, GPIOs Serial Communications Programming STM Interrupts, Timers Exercises Programming STM ADC-DMA / Interfacing external devices (STARTING AT 11:00 sharp!) Sensors / Radios Projects presentation and exercises. 2
3 Outline Interrupts Introduction and STM32 Timers Exercises. 3
4 Interrupt Definition From Wikipedia: A hardware interrupt is an electronic alerting signal sent to the processor from an external device, either a part of the [device, such as an internal peripheral] or an external peripheral. 4
5 Waiting for an Event: Family Vacation Polling 5
6 Waiting for an Event: Family Vacation Polling Interrupts Wake me up when we get there... An engineering example... 6
7 Typical application profile 2 Tperiod Tperiod I DD Process IRQ ACTIVE IRQ ACTIVE OFF STARTUP INITIALIZATION TASKS TASKS INACTIVE INACTIVE INACTIVE Application phases: OFF power is not applied to MCU STARTUP INITIALIZATION MCU performs configuration (peripherals, clocks, ) Tperiod INACTIVE MCU is in low power mode to reduce power consumption ACTIVE MCU is in normal mode and performs tasks Time 7
8 Waiting for an Event: Button Push Polling Interrupts while(1) { // Polling GPIO button while (GPIO_getInputPinValue()==1) } GPIO_toggleOutputOnPin(); 100% CPU Load // GPIO button interrupt #Iterrupt servise routine interrupt void rx (void){ GPIO_toggleOutputOnPin(); } > 0.1% CPU Load How interrupts can affect system design 8
9 Interrupts Help Support Ultra Low Power Very little CPU effort required Keep CPU asleep (i.e. in Low Power Mode) while waiting for event Interrupt wakes up CPU when it s required Another way to look at it is that interrupts often cause a program state change Only timers are running Often, work can be done by peripherals, letting CPU stay in low power mode (e.g. Gate Lots of Time) sleep time Basic program topology... 9
10 Interrupts A way to respond to an external event (i.e., flag being set) without polling How it works: H/W senses flag being set Automatically transfers control to s/w that services the interrupt When done, H/W returns control to wherever it left off Main Prog ISR : : : : RETI Advantages: Transparent to user cleaner code μc doesn t waste time polling 10
11 Foreground / Background Scheduling main() { } //Init initgpio(); initclocks();... while(1){ background or Low Power Mode } ISR1 get data process ISR2 set a flag System Initialization The beginning part of main() is usually dedicated to setting up your system Background Most systems have an endless loop that runs forever in the background In this case, Background implies that it runs at a lower priority than Foreground In microcontrollers, the background loop often contains a Low Power Mode command this sleeps the CPU/System until an interrupt event wakes it up Foreground Interrupt Service Routine (ISR) runs in response to enabled hardware interrupt These events may change modes in Background such as waking the CPU out of low-power mode ISR s, by default, are not interruptible Some processing may be done in ISR, but it s usually best to keep them short 11
12 Foreground / Background (States) Foreground (higher priority) ISR1 ISR2 ISR2 Background main() main() (lower priority) 12
13 STM32L1x - Block Diagram 13 Presentation Title
14 Nested Vectored Interrupt Controller (NVIC) Hardware unit that coordinates among interrupts from multiple sources Define priority level of each interrupt source (NVIC_PRIx_R registers) Separate enable flag for each interrupt source (NVIC_EN0_R and NVIC_EN1_R) Interrupt does not set I bit Higher priority interrupts can interrupt lower priority ones 14
15 Nested Vector Interrupt Controller NVIC Up to 81 interrupts (depends on the STM32 device type) Programmable priority level of 0-15 A higher level corresponds to a lower priority, so level 0 is the highest interrupt priority Dynamic reprioritization of interrupts Grouping of priority values into group priority and sub-priority fields Interrupt tail-chaining An external Non-maskable interrupt (NMI) 15
16 Nested Vector Interrupt Controller NVIC 16
17 Input floating EXTI module: from pin to NVIC GPIOA_0 GPIOB_0 Channel 0 EXTI Event CORTEX M4 GPIOI_0 Wakeup GPIOA_1 GPIOB_1 Channel 1 GPIOI_1 GPIOA_15 GPIOB_15 Channel 15 ENABLE Exti_0 Exti_1 NVIC GPIOI_15 DISABLE Exti_2 Exti_3 Exti_4 PVD RTC_Alarm USB OTG FS Wkup ETH Wkup USB OTG HS Wkup RTC Tamper RTC Wkup Interrupt Exti_9-5 Exti_15-10 PVD_IRQ RTC_IRQ
18 Nested Vector Interrupt Controller NVIC Nested Interrupt: If a interrupt request (IRQ) with higher priority is raised, it is served first Tail chaining: for nested ISR does not restore all saved registers from the stack. Stack pop pre-emption: If another exception occurs during the unstacking process of an exception, the processor abandons the stack Pop 18
19 19 TIMERS Presentation Title
20 Timers Correct system timing is a fundamental requirement for the proper operation of a real-time application; If the timing is incorrect, the input data may be processed after the output was updated The timers may be driven from an internal or external clock; Usually timers include multiple independent capture and compare blocks, with interrupt capabilities; Main applications: Generate events of fixed-time period; Allow periodic wake-up from sleep; Count external signals/events; Signal generation (Pulse Width Modulation PWM); Replacing delay loops with timer calls allows the CPU to sleep between operations, thus consuming less power
21 Timer/Counter Basics Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt Input Counter Action Notes Timers are often called Timer/Counters as a counter is the essential element Timing is based on counting inputs from a known clock rate What happens on each clock input? 21
22 Timer/Counter Basics TAR Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt (TAIFG) FFFD FFFE FFFF Interrupt occurs when timer overflows back to zero Each pulse of clock input increments the counter register Notes Timers are often called Timer/Counters as a counter is the essential element Timing is based on counting inputs from a known clock rate Actions don t occur when writing value to counter Can I 'capture' a count/time value? 22
23 Frequency, Time Period, Resolution With what resolution can we determine if an event occurred here? timer interrupt timer interrupt timer interrupt Time Period Definitions Frequency: Time Period: Resolution: How many times per second Amount of time between successive events Granularity in determining system events 23
24 Capture Basics TAR 15 0 Clock Input Clock GPIO Pin Counter Register Counter Overflow Action Interrupt (TAIFG) Notes Capture time (i.e. count value) when Capture Input signal occurs Alternatively, use CCR for compare... 24
25 Capture Basics TAR 15 0 Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt (TAIFG) Capture Input signal triggers transfer: Counter Capture Capture/Compare Register (CCR n ) Notes Capture time (i.e. count value) when Capture Input signal occurs When capture is triggered, count value is placed in CCR and an interrupt is generated 25
26 Capture Basics TAR 15 0 Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt Capture Input signal triggers transfer: Counter Capture Capture Input CCInA CCInB Software Capture/Compare Register (CCR n ) Capture Actions Interrupt Signal peripheral Modify pin (TIM_OUT) Notes Capture time (i.e. count value) when Capture Input signal occurs When capture is triggered, count value is placed in CCR and an interrupt is generated Capture Overflow (COV): indicates 2 nd capture to CCR before 1 st was read 26
27 Compare Basics Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt A key feature for timers is the ability to create consistent, periodic interrupts 27
28 Compare Basics Clock Input Clock GPIO Pin (TACLK) Counter Register Counter Overflow Action Interrupt Capture/Compare Register (CCR n ) 28
29 Compare Basics Clock Input Clock GPIO Pin (TACLK) TAR Counter Register Counter Overflow Action Interrupt (TAIFG) when Counter = Compare Compare Actions can occur Capture/Compare Register (CCR n ) Compare Actions Interrupt Signal peripheral Modify pin (TIM_OUT) Notes There are usually 2 to 7 compare registers (CCR s), therefore up to 8 interrupts or signals can be generated Counter must count-to Compare value to generate action 29
30 Example Divide by 5-bits (up to 64) 16-bit Counter (TA0R) Enable (TA0IE) Interrupt (TA0IFG) CCR0 CCR1 CCR2 CCR3 CCR4 CCR5 CCR6 30
31 Timer_A7 Summary 15 0 Divide by 5-bits (up to 64) 16-bit Counter (TAR) Enable (TAIE) Interrupt (TAIFG) CAP=0 CAP=1 CM SCS COV CCR0. CCR6 CC0IE CC6IE CC0IFG TA0.0 CC6IFG TA0.6 TimerA0.0: Is the first instance (Timer0 or TA0) of Timer_A7 on the device _A7 means it has 7 Capture/Compare Registers (CCR s) CCR registers can be configured for: Compare (set when CAP=0) generates interrupt (CCnIFG) and modifies OUT signal when TAR = CCRn Capture (when CAP=1) grabs the TAR value and sets an interrupt (CCnIFG) when triggered by the selected CCIx input 31
32 Timers STM32 The general-purpose timers consist of a 16-bit (or 32bits) auto-reload counter driven by a programmable prescaler. They may be used for a variety of purposes, including measuring the pulse lengths of input signals (input capture) or generating output waveforms (output compare and PWM). Pulse lengths and waveform periods can be modulated from a few microseconds to several milliseconds using the timer prescaler and the RCC clock controller prescalers. General-purpose TIMx timer features include: - 16-bit up, down, up/down auto-reload counter bit programmable prescaler used to divide (also on the fly ) the counter clock frequency by any factor between 1 and Up to 4 independent channels for: Input capture Output compare PWM generation (Edge- and Center-aligned modes) One-pulse mode output 32
33 Timers Basic architecture STM32. CLOCKS CLOCKS / N Counter/Autro-reload Capture/compare 33
34 RCC Real Time Clock Control 34
35 Timers General-purpose timer block diagram 35
36 Timers PATH: TimerX - Channel 1 - output compare 36
37 Timers PATH: TimerX - Channel 2 - output compare 37
38 Timers PATH: TimerX - Channel 3 - output compare 38
39 Timers PATH: TimerX - Channel 4 - output compare 39
40 Timers 24MHz 40
41 Timers 41
42 Timers The counter clock can be divided by a prescaler. 42
43 Timers The main block of the programmable timer is a 16- bit counter with its related auto-reload register. The counter can count up, down or both up and down. CNT CK_CNT 43
44 Timers In upcounting mode, the counter counts from 0 to the auto-reload value (content of the TIMx_ARR register), then restarts from 0 and generates a counter overflow event. Period Autoreload Register Timer Interrupt CNT CK_CNT 44
45 Timers Output compare mode: This function is used to control an output waveform or indicating when a period of time has elapsed. Autoreload Register Timer Interrupt Compare Register CNT CH1 Interrupt OC1 CK_CNT 45
46 Timers Output compare mode: This function is used to control an output waveform or indicating when a period of time has elapsed. Used to schedule periodic events Autoreload Register Timer Interrupt Compare Register CNT CH1 Interrupt OC1 CK_CNT 46
47 PWM What is Pulse Width Modulation? Pulse width modulation (PWM) is a simple method of using a rectangular digital waveform to control an analog variable PWM delivers a variable amount of power efficiently to external hw devices PWM control is used in a variety of applications, ranging from communications to automatic control, i.e. control speed of electric motors, brightness of a LED, temperature of heating element 47
48 PWM The period is normally kept constant, and the pulse width, or on time is varied The duty cycle is the proportion of time that the pulse is on or high, and is expressed as a percentage: duty cycle = 100% * (pulse on time) / (pulse period) 48
49 PWM Whatever duty cycle a PWM stream has, there is an average value, as indicated by the dotted line If the on time is small, the average value is low; if the on time is large, the average value is high By controlling the duty cycle, we control this average value 49
50 PWM The average value can be extracted from the PWM stream with a low-pass filter In this case, and as long as PWM frequency and values of R and C are appropriately chosen, Vout becomes an analog output In practice, this sort of filtering is not always required; many physical systems have response characteristics which, in reality, act like low pass filters 50
51 Applications using PWM Devices used in robotics DC motors Servos Solenoids Closed loop control systems Communications and pulse code modulation Any device whose response to changes in current or voltage is slow compared to the frequency of the PWM signal is a candidate for being controlled via PWM. Benefits include Microprocessor control Efficient use of power Tolerance to analog noise Not susceptible to component drift 51
52 STM32 GPIO Timers for PWM The STM32 hardware timers are separate hardware blocks that can count from 0 to a given value triggering some events in between. In the PWM mode the timer controls the output of 1 or more output channels. When the counter value reaches 0, maximum or a compare value defined for each channel, the output value of the channel can be changed. Various configuration options define which events change the value and how it is changed. T; f = 1/T 52
53 STM32 GPIO Timers for PWM Up to 4 channel Edge-aligned mode Center-aligned mode Timer Type Resolution Prescaler Channels MAX INTERFACE CLOCK MAX TIMER CLOCK* TIM1, TIM8 Advanced 16bit 16bit 4 SysClk/2 SysClk 2 TIM2, TIM5 General purpose 32bit 16bit 4 SysClk/4 TIM3, TIM4 General purpose 16bit 16bit 4 SysClk/4 SysClk, SysClk/2 SysClk, SysClk/2 TIM9 General purpose 16bit 16bit 2 SysClk/2 SysClk 2 APB 1 1 TIM10, TIM11 General purpose 16bit 16bit 1 SysClk/2 SysClk 2 TIM12 General purpose 16bit 16bit 2 SysClk/4 SysClk, SysClk/2 1 TIM13, TIM14 General purpose 16bit 16bit 1 SysClk/4 SysClk, SysClk/2 1 TIM6, TIM7 Basic 16bit 16bit 0 SysClk/4 SysClk, 1 53
54 Frequency and Times Example, a 16 bit Timer fsystemclock=ftimer=8mhz As you said we have a tick in every, Ttimer=1/fSystemClock=1/ftimer=1/8MHz=0.125μs With a 16 bit Timer it means, ticksmax=(2 16-1)=65535ticks So the timer will overflow in every, toverflow=ticksmax Ttimer= μs= ms 54
55 GPIO Timer Block diagram 55
56 APB1 or APB 2? APB2 APB1 56
57 Timer Example exercises Calculate the Timer Setting for the Clock & divider values needed to create a timer interrupt every 2seconds when the CPU of the following processor is in the deep sleep mode allowed. 57
58 Timers - Exercises Low Power Sleep Low Power Model= Input Clock= 32KHz 1 32KHz Timer Clock= 32KHz / = 1/ 32KHz Time = * = 2s 16 or 32 bit? Duty Cycling 1 = * 100 / = 50% Capute compare value Duty Cycling 2 = * 100 / = 25% Capute compare value THIS IS VALID ONLY FOR TIMER IN UP-COUNTING MODE!! THERE ARE MANY MODALITIES GENERATING MANY DIFFERENT PWM 58
Lab 5 Timer Module PWM ReadMeFirst
Lab 5 Timer Module PWM ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) Interrupt Vector Table 3) Pin out Summary 4) DriverLib API 5) SineTable Overview In this lab, we are going to use the output hardware
More informationCprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones
CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones 1 Announcements HW8: Due Sunday 10/29 (midnight) Exam 2: In class Thursday 11/9 This object detection lab
More informationFor reference only Refer to the latest documents for details
STM32F3 Technical Training For reference only Refer to the latest documents for details General Purpose Timers (TIM2/3/4/5 - TIM12/13/14 - TIM15/16/17 - TIM6/7/18) TIM2/5 TIM3/4/19 TIM12 TIM15 TIM13/14
More informationTimer A. Last updated 8/7/18
Last updated 8/7/18 Advanced Timer Functions Output Compare Sets a flag and/or creates an interrupt when the counter value matches a value programmed into a separate register Input Capture Captures the
More informationELEC 3040/3050 Lab #7
ELEC 3040/3050 Lab #7 PWM Waveform Generation References: STM32L1xx Technical Reference Manual STM32L100RC Data Sheet Goals of this lab exercise Begin the primary design project for the semester Speed
More informationEIE/ENE 334 Microprocessors
EIE/ENE 334 Microprocessors Lecture 13: NuMicro NUC140 (cont.) Week #13 : Dejwoot KHAWPARISUTH Adapted from http://webstaff.kmutt.ac.th/~dejwoot.kha/ NuMicro NUC140: Technical Ref. Page 2 Week #13 NuMicro
More informationMicrocontroller: Timers, ADC
Microcontroller: Timers, ADC Amarjeet Singh February 1, 2013 Logistics Please share the JTAG and USB cables for your assignment Lecture tomorrow by Nipun 2 Revision from last class When servicing an interrupt,
More informationDesigning with STM32F3x
Designing with STM32F3x Course Description Designing with STM32F3x is a 3 days ST official course. The course provides all necessary theoretical and practical know-how for start developing platforms based
More informationAN4062 Application note
Application note STM32F0DISCOVERY peripheral firmware examples Introduction This application note describes the peripheral firmware examples provided for the STM32F0DISCOVERY Kit. These ready-to-run examples
More informationHello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some
Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some application examples. 1 The two comparators inside STM32 microcontroller
More informationTimer A (0 and 1) and PWM EE3376
Timer A (0 and 1) and PWM EE3376 General Peripheral Programming Model l l l l Each peripheral has a range of addresses in the memory map peripheral has base address (i.e. 0x00A0) each register used in
More informationSTM32L100C6 STM32L100R8 STM32L100RB
STM32L100C6 STM32L100R8 STM32L100RB Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 128KB Flash, 10KB SRAM, 2KB EEPROM, LCD, USB, ADC, DAC Features Datasheet production data Ultra-low-power platform
More informationSTM32L010F4 STM32L010K4
STM32L010F4 STM32L010K4 Value line ultra-low-power 32-bit MCU Arm -based Cortex -M0+, 16-Kbyte Flash memory, 2-Kbyte SRAM, 128-byte EEPROM, ADC Datasheet - production data Features Ultra-low-power platform
More informationSTM32L100x6/8/B-A. Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 128KB Flash, 16KB SRAM, 2KB EEPROM, LCD, USB, ADC, DAC.
STM32L100x6/8/B-A Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 128KB Flash, 16KB SRAM, 2KB EEPROM, LCD, USB, ADC, DAC Features Datasheet - production data Ultra-low-power platform 1.8 V to 3.6 V power
More informationHello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its
Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its main features and the application benefits of leveraging
More informationVORAGO Timer (TIM) subsystem application note
AN1202 VORAGO Timer (TIM) subsystem application note Feb 24, 2017, Version 1.2 VA10800/VA10820 Abstract This application note reviews the Timer (TIM) subsystem on the VA108xx family of MCUs and provides
More informationSTM32L051x6 STM32L051x8
STM32L051x6 STM32L051x8 Access line ultra-low-power 32-bit MCU ARM-based Cortex-M0+, up to 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, ADC Datasheet - preliminary data Features Ultra-low-power platform 1.65 V
More informationSTM32L100RC. Ultra-low-power 32b MCU ARM -based Cortex -M3, 256KB Flash, 16KB SRAM, 4KB EEPROM, LCD, USB, ADC, DAC, memory I/F.
Ultra-low-power 32b MCU ARM -based Cortex -M3, 256KB Flash, 16KB SRAM, 4KB EEPROM, LCD, USB, ADC, DAC, memory I/F Features Datasheet production data Ultra-low-power platform 1.65 V to 3.6 V power supply
More informationELCT 912: Advanced Embedded Systems
ELCT 912: Advanced Embedded Systems Lecture 5: PIC Peripherals on Chip Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering The PIC Family: Peripherals Different PICs have different
More informationSTM32L031x4 STM32L031x6
STM32L031x4 STM32L031x6 Access line ultra-low-power 32-bit MCU ARM -based Cortex -M0+, up to 32KB Flash, 8KB SRAM, 1KB EEPROM, ADC Datasheet - production data Features Ultra-low-power platform 1.65 V to
More informationµtasker Document µtasker Hardware Timers
Embedding it better... µtasker Document utaskerhwtimers.doc/0.07 Copyright 2016 M.J.Butcher Consulting Table of Contents 1. Introduction...3 2. Timer Control Interface...3 3. Configuring a Single-Shot
More informationLab 9. Speed Control of a D.C. motor. Sensing Motor Speed (Tachometer Frequency Method)
Lab 9. Speed Control of a D.C. motor Sensing Motor Speed (Tachometer Frequency Method) Motor Speed Control Project 1. Generate PWM waveform 2. Amplify the waveform to drive the motor 3. Measure motor speed
More informationSTM32L062K8 STM32L062T8
STM32L062K8 STM32L062T8 Ultra-low-power 32-bit MCU Arm -based Cortex -M0+, 64 KB Flash, 8 KB SRAM, 2 KB EEPROM,USB, ADC, DAC, AES Datasheet - production data Features Ultra-low-power platform 1.65 V to
More informationSTM32L151xC STM32L152xC
STM32L151xC STM32L152xC Ultralow power ARM-based 32-bit MCU with 256 KB Flash, RTC, LCD, USB, analog functions, 10 serial ports, memory I/F Features Operating conditions Operating power supply range: 1.65
More informationSTM32L063C8 STM32L063R8
STM32L063C8 STM32L063R8 Ultra-low-power 32-bit MCU ARM-based Cortex-M0+, 64KB Flash, 8KB SRAM, 2KB EEPROM, LCD, USB, ADC, DAC, AES Datasheet - preliminary data Features Ultra-low-power platform 1.65 V
More informationHello, and welcome to this presentation of the STM32 Digital Filter for Sigma-Delta modulators interface. The features of this interface, which
Hello, and welcome to this presentation of the STM32 Digital Filter for Sigma-Delta modulators interface. The features of this interface, which behaves like ADC with external analog part and configurable
More informationSTM32L051x6 STM32L051x8
STM32L051x6 STM32L051x8 Access line ultra-low-power 32-bit MCU Arm -based Cortex -M0+, up to 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, ADC Datasheet - production data Features Ultra-low-power platform 1.65
More informationSTM32L082KB STM32L082KZ STM32L082CZ
STM32L082KB STM32L082KZ STM32L082CZ Ultra-low-power 32-bit MCU Arm -based Cortex -M0+, up to 192KB Flash, 20KB SRAM, 6KB EEPROM, USB, ADC, DACs, AES Datasheet - production data Features Ultra-low-power
More informationEEL 4744C: Microprocessor Applications Lecture 8 Timer Dr. Tao Li
EEL 4744C: Microprocessor Applications Lecture 8 Timer Reading Assignment Software and Hardware Engineering (new version): Chapter 14 SHE (old version): Chapter 10 HC12 Data Sheet: Chapters 12, 13, 11,
More informationSTM32L051x6 STM32L051x8
STM32L051x6 STM32L051x8 Access line ultra-low-power 32-bit MCU ARM -based Cortex -M0+, up to 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, ADC Datasheet - production data Features Ultra-low-power platform 1.65
More informationReading Assignment. Timer. Introduction. Timer Overview. Programming HC12 Timer. An Overview of HC12 Timer. EEL 4744C: Microprocessor Applications
Reading Assignment EEL 4744C: Microprocessor Applications Lecture 8 Timer Software and Hardware Engineering (new version): Chapter 4 SHE (old version): Chapter 0 HC Data Sheet: Chapters,,, 0 Introduction
More informationPractical Exercise. STM32F4 Discovery. Alessandro Palla
Practical Exercise STM32F4 Discovery Alessandro Palla alessandro.palla@for.unipi.it Outline STM32F4 Discovery Application: USB Mouse with accelerometer Hardware Configuration o o o o o Requirements Peripherals
More informationChapter 6 PROGRAMMING THE TIMERS
Chapter 6 PROGRAMMING THE TIMERS Force Outputs on Outcompare Input Captures Programmabl e Prescaling Prescaling Internal clock inputs Timer-counter Device Free Running Outcompares Lesson 2 Free Running
More informationSTM32L051x6 STM32L051x8
STM32L051x6 STM32L051x8 Access line ultra-low-power 32-bit MCU ARM -based Cortex -M0+, up to 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, ADC Datasheet - production data Features Ultra-low-power platform 1.65
More informationSTM32L052x6 STM32L052x8
STM32L052x6 STM32L052x8 Ultra-low-power 32-bit MCU ARM-based Cortex-M0+, up to 64 KB Flash, 8 KB SRAM, 2 KB EEPROM, USB, ADC, DAC Datasheet - preliminary data Features Ultra-low-power platform 1.65 V to
More informationSTM32L053C6 STM32L053C8 STM32L053R6 STM32L053R8
STM32L053C6 STM32L053C8 STM32L053R6 STM32L053R8 Ultra-low-power 32-bit MCU Arm -based Cortex -M0+, up to 64KB Flash, 8KB SRAM, 2KB EEPROM, LCD, USB, ADC, DAC Datasheet - production data Features Ultra-low-power
More informationGrundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss
Grundlagen Microcontroller Counter/Timer Günther Gridling Bettina Weiss 1 Counter/Timer Lecture Overview Counter Timer Prescaler Input Capture Output Compare PWM 2 important feature of microcontroller
More informationHello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.
Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs. 1 The purpose of this course is to provide an introduction to the RL78 timer Architecture.
More informationAN3252 Application note
Application note Building a wave generator using STM8L-DISCOVERY Application overview This application note provides a short description of how to use the STM8L-DISCOVERY as a basic wave generator for
More informationUsing the Z8 Encore! XP Timer
Application Note Using the Z8 Encore! XP Timer AN013104-1207 Abstract Zilog s Z8 Encore! XP microcontroller consists of four 16-bit reloadable timers that can be used for timing, event counting or for
More informationSTM32L031x4 STM32L031x6
STM32L031x4 STM32L031x6 Access line ultra-low-power 32-bit MCU ARM -based Cortex -M0+, up to 32KB Flash, 8KB SRAM, 1KB EEPROM, ADC Datasheet - production data Features Ultra-low-power platform 1.65 V to
More informationAN4507 Application note
Application note PWM resolution enhancement through a dithering technique for STM32 advanced-configuration, general-purpose and lite timers Introduction Nowadays power-switching electronics exhibit remarkable
More informationUtilizing the Trigger Routing Unit for System Level Synchronization
Engineer-to-Engineer Note EE-360 Technical notes on using Analog Devices DSPs, processors and development tools Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors
More informationSTM32L151xE STM32L152xE
STM32L151xE STM32L152xE Ultra-low-power 32-bit MCU ARM -based Cortex -M3 with 512KB Flash, 80KB SRAM, 16KB EEPROM, LCD, USB, ADC, DAC Features Datasheet - production data Ultra-low-power platform 1.65
More informationMicroprocessor & Interfacing Lecture Programmable Interval Timer
Microprocessor & Interfacing Lecture 30 8254 Programmable Interval Timer P A R U L B A N S A L A S S T P R O F E S S O R E C S D E P A R T M E N T D R O N A C H A R Y A C O L L E G E O F E N G I N E E
More informationUltra-low-power 32-bit MCU Arm -based Cortex -M0+, up to 192KB Flash, 20KB SRAM, 6KB EEPROM, LCD, USB, ADC, DACs. UFBGA100 7x7 mm.
STM32L073x8 STM32L073xB STM32L073xZ Ultra-low-power 32-bit MCU Arm -based Cortex -M0+, up to 192KB Flash, 20KB SRAM, 6KB EEPROM, LCD, USB, ADC, DACs Datasheet - production data Features Ultra-low-power
More informationHello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages
Hello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages which can interface with the external world. 1 The STM32G0
More informationThis section describes the basic functions of a the general purpose 16-bit Timer_A in MSP430 based system.
MSP43 Family _A _A This section describes the basic functions of a the general purpose 6-bit _A in MSP43 based system. Topic Page. Operation of _A -3. Registers of _A -7.3 _A in Applications -8.4 _A special
More informationUnit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION
M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION Microcomputer system design requires
More informationStellaris ARM Cortex -M4F Training. Peripheral Overview
Stellaris ARM Cortex -M4F Training Peripheral Overview 1 Agenda Stellaris LM4F General Specifications Features of ARM Cortex -M4F Other System Features Low Power Features Watchdog Timers Timers and GPIOs
More informationCourse Introduction. Content 20 pages 3 questions. Learning Time 30 minutes
Purpose The intent of this course is to provide you with information about the main features of the S08 Timer/PWM (TPM) interface module and how to configure and use it in common applications. Objectives
More informationHardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff
Hardware Flags and the RTI system 1 Need for hardware flag Often a microcontroller needs to test whether some event has occurred, and then take an action For example A sensor outputs a pulse when a model
More informationINSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing
UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática Architectures for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 23
More informationPSoC 4 Timer Counter Pulse Width Modulator (TCPWM)
2.10 Features 16-bit fixed-function implementation Timer/Counter functional mode Quadrature Decoder functional mode Pulse Width Modulation (PWM) mode PWM with configurable dead time insertion Pseudo random
More informationHigh Resolution Pulse Generation
High Resolution Pulse Generation An Application Note for the NS9360 Processor www.digi.com 90001138 2009 Digi International Inc. All Rights Reserved. Digi, Digi International, and the Digi logo are trademarks
More informationSTM32L151xx STM32L152xx
STM32L151xx STM32L152xx Ultralow power ARM-based 32-bit MCU with up to 128 KB Flash, RTC, LCD, USB, USART, I2C, SPI, timers, ADC, DAC, comparators Features Preliminary data Operating conditions Operating
More informationExercise 5: PWM and Control Theory
Exercise 5: PWM and Control Theory Overview In the previous sessions, we have seen how to use the input capture functionality of a microcontroller to capture external events. This functionality can also
More information32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers
-bit ARM Cortex-, Cortex- and Cortex-MF microcontrollers Energy, gas, water and smart metering Alarm and security systems Health and fitness applications Industrial and home automation Smart accessories
More informationUM2068 User manual. Examples kit for STLUX and STNRG digital controllers. Introduction
User manual Examples kit for STLUX and STNRG digital controllers Introduction This user manual provides complete information for SW developers about a set of guide examples useful to get familiar developing
More informationARM-based 32-bit MCU, up to 128 KB Flash, crystal-less USB FS 2.0, CAN, 12 timers, ADC, DAC & comm. interfaces, V.
ARM-based 32-bit MCU, up to 128 KB Flash, crystal-less USB FS 2.0, CAN, 12 timers, ADC, DAC & comm. interfaces, 2.0-3.6 V Features Datasheet - production data Core: ARM 32-bit Cortex -M0 CPU, frequency
More informationHello, and welcome to this presentation of the STM32 Infrared Timer. Features of this interface allowing the generation of various IR remote control
Hello, and welcome to this presentation of the STM32 Infrared Timer. Features of this interface allowing the generation of various IR remote control protocols will be presented. 1 The Infrared Timer peripheral
More informationUltra-low-power 32-bit MCU ARM-based Cortex -M3, 128KB Flash, 16KB SRAM, 4KB EEPROM, LCD, USB, ADC, DAC. STM32L151x6/8/B. STM32L152x6/.
STM32L15xx6/8/B Ultra-low-power 32-bit MCU ARM-based Cortex -M3, 128KB Flash, 16KB SRAM, 4KB EEPROM, LCD, USB, ADC, DAC Features Datasheet - production data Ultra-low-power platform 1.65 V to 3.6 V power
More informationEmbedded Robotics. Software Development & Education Center
Software Development & Education Center Embedded Robotics Robotics Development with ARM µp INTRODUCTION TO ROBOTICS Types of robots Legged robots Mobile robots Autonomous robots Manual robots Robotic arm
More informationJTAG pins do not have internal pull-ups enabled at power-on reset. JTAG INTEST instruction does not work
STELLARIS ERRATA Stellaris LM3S2110 RevA2 Errata This document contains known errata at the time of publication for the Stellaris LM3S2110 microcontroller. The table below summarizes the errata and lists
More informationPIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232
PIC Functionality General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232 General I/O Logic Output light LEDs Trigger solenoids Transfer data Logic Input Monitor
More informationMICROCONTROLLER TUTORIAL II TIMERS
MICROCONTROLLER TUTORIAL II TIMERS WHAT IS A TIMER? We use timers every day - the simplest one can be found on your wrist A simple clock will time the seconds, minutes and hours elapsed in a given day
More informationSTM32L162VC STM32L162RC
STM32L162VC STM32L162RC Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 256KB Flash, 32KB SRAM, 8KB EEPROM, LCD, USB, ADC, DAC, AES Datasheet - production data Features Ultra-low-power platform 1.65
More informationSTM32F091xB STM32F091xC
ARM -based 32-bit MCU, up to 256 KB Flash, CAN, 12 timers, ADC, DAC & comm. interfaces, 2.0-3.6V Datasheet - production data Features Core: ARM 32-bit Cortex -M0 CPU, frequency up to 48 MHz Memories 128
More informationIV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -3 1 UNIT 3
IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -3 1 UNIT 3 Timers of MSP430 3.1. Basic Timer1 3.2. Timer_A 3.3. Edge aligned PWM output 3.4. Measurement in Capture mode ( Time period, duration, frequency)
More informationMotor Control using NXP s LPC2900
Motor Control using NXP s LPC2900 Agenda LPC2900 Overview and Development tools Control of BLDC Motors using the LPC2900 CPU Load of BLDCM and PMSM Enhancing performance LPC2900 Demo BLDC motor 2 LPC2900
More informationGUJARAT TECHNOLOGICAL UNIVERSITY
Type of course: Engineering (Elective) GUJARAT TECHNOLOGICAL UNIVERSITY ELECTRICAL ENGINEERING (09) ADVANCE MICROCONTROLLERS SUBJECT CODE: 260909 B.E. 6 th SEMESTER Prerequisite: Analog and Digital Electronics,
More informationSTM32F318C8 STM32F318K8
STM32F318C8 STM32F318K8 ARM -based Cortex -M4 32-bit MCU+FPU, 64 KB Flash, 16 KB SRAM, ADC, DAC, 3 COMP, Op-Amp, 1.8 V Datasheet - production data Features Core: ARM 32-bit Cortex -M4 CPU with FPU (72
More informationExercise 3: Sound volume robot
ETH Course 40-048-00L: Electronics for Physicists II (Digital) 1: Setup uc tools, introduction : Solder SMD Arduino Nano board 3: Build application around ATmega38P 4: Design your own PCB schematic 5:
More informationSTM32F042x4 STM32F042x6
STM32F042x4 STM32F042x6 Features ARM -based 32-bit MCU, up to 32 KB Flash, crystal-less USB FS 2.0, CAN, 9 timers, ADC & comm. interfaces, 2.0-3.6 V Datasheet - production data Core: ARM 32-bit Cortex
More informationSTM32F051x4 STM32F051x6 STM32F051x8
4 STM32F051x6 STM32F051x8 Low- and medium-density advanced ARM -based 32-bit MCU with 16 to 64 Kbytes Flash, timers, ADC, DAC and comm. interfaces Features Datasheet production data Operating conditions:
More informationLow Power Microphone Acquisition and Processing for Always-on Applications Based on Microcontrollers
Low Power Microphone Acquisition and Processing for Always-on Applications Based on Microcontrollers Architecture I: standalone µc Microphone Microcontroller User Output Microcontroller used to implement
More informationSTELLARIS ERRATA. Stellaris LM3S8962 RevA2 Errata
STELLARIS ERRATA Stellaris LM3S8962 RevA2 Errata This document contains known errata at the time of publication for the Stellaris LM3S8962 microcontroller. The table below summarizes the errata and lists
More informationPWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff
PWM System 1 Pulse Width Modulation (PWM) Pulses are continuously generated which have different widths but the same period between leading edges Duty cycle (% high) controls the average analog voltage
More informationProject Final Report: Directional Remote Control
Project Final Report: by Luca Zappaterra xxxx@gwu.edu CS 297 Embedded Systems The George Washington University April 25, 2010 Project Abstract In the project, a prototype of TV remote control which reacts
More informationXC800 Peripheral Highlights
XC800 Peripheral Highlights 8-bit microcontrollers July 2008 Industrial and Multimarket Microcontroller AIM MC IMM Agenda Realtime Applications Example Switched Mode Power Supply CC6 Example Current Measurement
More informationECE251: Tuesday October 3 0
ECE251: Tuesday October 3 0 Timer Module Continued Review Pulse Input Characterization Output Pulses Pulse Count Capture Homework #6 due Thursday Lab 7 (Maskable Interrupts/ SysTick Timer) this week. Significant
More informationSTM32F071x8 STM32F071xB
STM32F071x8 STM32F071xB ARM -based 32-bit MCU, up to 128 KB Flash, 12 timers, ADC, DAC and communication interfaces, 2.0-3.6 V Datasheet - production data Features Core: ARM 32-bit Cortex -M0 CPU, frequency
More informationSTM32F302x6 STM32F302x8
STM32F302x6 STM32F302x8 ARM Cortex -M4 32-bit MCU+FPU, up to 64 KB Flash, 16 KB SRAM, ADC, DAC, USB, CAN, COMP, Op-Amp, 2.0-3.6 V Features Datasheet - production data Core: ARM 32-bit Cortex -M4 CPU with
More informationSTM32L151x6/8/B-A STM32L152x6/8/B-A
STM32L151x6/8/B-A STM32L152x6/8/B-A Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 128KB Flash, 32KB SRAM, 4KB EEPROM, LCD, USB, ADC, DAC Features Datasheet - production data Ultra-low-power platform
More informationTable 1: Cross Reference of Applicable Products. INTERNAL PIC NUMBER Arm Cortex M0+ UT32M0R PWM Module QS30
Standard Product Enable the PWM 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 informationSTM32L15xCC STM32L15xRC STM32L15xUC STM32L15xVC
STM32L15xCC STM32L15xRC STM32L15xUC STM32L15xVC Ultra-low-power 32-bit MCU ARM -based Cortex -M3, 256KB Flash, 32KB SRAM, 8KB EEPROM, LCD, USB, ADC, DAC Features Datasheet - production data Ultra-low-power
More informationSTM32F301x6 STM32F301x8
STM32F301x6 STM32F301x8 ARM Cortex -M4 32-bit MCU+FPU, up to 64 KB Flash, 16 KB SRAM, ADC, DAC, COMP, Op-Amp, 2.0 3.6 V Datasheet - production data Features Core: ARM 32-bit Cortex -M4 CPU with FPU (72
More information8-bit Microcontroller with 512/1024 Bytes In-System Programmable Flash. ATtiny4/5/9/10
Features High Performance, Low Power AVR 8-Bit Microcontroller Advanced RISC Architecture 54 Powerful Instructions Most Single Clock Cycle Execution 16 x 8 General Purpose Working Registers Fully Static
More informationLM4: The timer unit of the MC9S12DP256B/C
Objectives - To explore the Enhanced Capture Timer unit (ECT) of the MC9S12DP256B/C - To program a real-time clock signal with a fixed period and display it using the onboard LEDs (flashing light) - To
More informationEE445L Fall 2014 Quiz 2A Page 1 of 5
EE445L Fall 2014 Quiz 2A Page 1 of 5 Jonathan W. Valvano First: Last: November 21, 2014, 10:00-10:50am. Open book, open notes, calculator (no laptops, phones, devices with screens larger than a TI-89 calculator,
More informationATmega16A Microcontroller
ATmega16A Microcontroller Timers 1 Timers Timer 0,1,2 8 bits or 16 bits Clock sources: Internal clock, Internal clock with prescaler, External clock (timer 2), Special input pin 2 Features The choice of
More informationνµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ
θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ υιοπασδφγηϕκλζξχϖβνµθωερτψυιοπασδ φγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκλζ ξχϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµ EE 331 Design Project Final Report θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ
More informationSTM32F401xD STM32F401xE
STM32F401xD STM32F401xE ARM Cortex -M4 32b MCU+FPU, 105 DMIPS, 512KB Flash/96KB RAM, 11 TIMs, 1 ADC, 11 comm. interfaces Features Datasheet - production data Core: ARM 32-bit Cortex -M4 CPU with FPU, Adaptive
More informationUNIVERSITY OF VICTORIA FACULTY OF ENGINEERING. SENG 466 Software for Embedded and Mechatronic Systems. Project 1 Report. May 25, 2006.
UNIVERSITY OF VICTORIA FACULTY OF ENGINEERING SENG 466 Software for Embedded and Mechatronic Systems Project 1 Report May 25, 2006 Group 3 Carl Spani Abe Friesen Lianne Cheng 03-24523 01-27747 01-28963
More informationUniversity of Texas at El Paso Electrical and Computer Engineering Department
University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 05 Pulse Width Modulation Goals: Bonus: Pre Lab Questions: Use Port
More informationElectronics Design Laboratory Lecture #9. ECEN 2270 Electronics Design Laboratory
Electronics Design Laboratory Lecture #9 Electronics Design Laboratory 1 Notes Finishing Lab 4 this week Demo requires position control using interrupts and two actions Rotate a given angle Move forward
More informationHardware Platforms and Sensors
Hardware Platforms and Sensors Tom Spink Including material adapted from Bjoern Franke and Michael O Boyle Hardware Platform A hardware platform describes the physical components that go to make up a particular
More informationLab 5: Control and Feedback. Lab 5: Controls and feedback. Lab 5: Controls and Feedback
Lab : Control and Feedback Lab : Controls and feedback K K You may need a resistor other than exactly K for better sensitivity This embedded system uses the Photo sensor to detect the light intensity of
More informationChapter 5 Timer Functions ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 5.1 The Timer System 5.2 Programming the Timer System 5.3 Examples and Applications The
More informationUM1763 User manual. Description of STLUX385A examples kit. Introduction. Reference documents
User manual Description of STLUX385A examples kit Introduction This user manual provides complete information for SW developers about a set of guide examples useful to get familiar developing applications
More information