EECS 373: Design of Microprocessor-Based Systems

Slides:



Advertisements
Similar presentations
MOTION CONTROL ECE 105 Industrial Electronics Engr. Jeffrey T. Dellosa College of Engineering and Information Technology Caraga State University Ampayon,
Advertisements

EECS 373: Design of Microprocessor-Based Systems Timers, count, capture and PWM Some material from Thomas Schmid, Mark Brehob.
Introduction of Holtek HT-46 series MCU
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 8: Clocks, Counters, Timers, Capture, and Compare September.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
Motor Control of an Oscillating Pendulum Nick Myers and Chirag Patel March 9, 2004 Advised by: Dr. James Irwin and Mr. Jose Sanchez Bradley University.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Digital to Analog Converters
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
ENEE 440 Chapter Timer 8254 Register Select The 8254 timer is actually 3 timers in one. It is an upgraded version of the 8253 timer which was.
ARM Timers.
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Hybrid I/O – Pulses.
STEPPER MOTORS Name: Mr.R.Anandaraj Designation: Associate. Professor Department: Electrical and Electronics Engineering Subject code :EC 6252 Year: II.
1 Lecture on Lab 6 Lab 7 Lab 8. 2 Lab 6: Open Loop Controller As you learned in lab 5, there are two kinds of control systems: open loop and closed loop.
Time Management.  Time management is concerned with OS facilities and services which measure real time, and is essential to the operation of timesharing.
Astable Multivibrators ©Paul Godin Created February 2007 Oscillator Basics.
By Tony Hoff ECE 4220 – Real Time Embedded Computing University of Missouri - Columbia Course Instructor: Dr. Guiherme DeSouza.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CSE466 - Fall What is an Embedded System  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)  Lacks some or.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
1 4-Integrating Peripherals in Embedded Systems (cont.)
Seth Schwiethale James Crosetto James Ellison.  square pulse of ms, repeats every 20 ms  It is the same for both steering and acceleration 
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
1 4-Integrating Peripherals in Embedded Systems (cont.)
-AT91SAM7X256 – Pulse Width Modulation YoonMo Yeon
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Case Study #1 Microcontroller System. What is a microcontroller? A microcontroller can be considered a self-contained system with a processor, memory.
Application Case Study Christmas Lights Controller
MICROCONTROLLER AND INTERFACING
Application Case Study Security Camera Controller
Timers and Event Counters
LED LAMP DIMMER CIRCUIT
Chapter Objectives In this chapter, you will learn:
Networked Embedded Systems Sachin Katti
Homework Reading Machine Projects Labs
Clocks A clock is a free-running signal with a cycle time.
Timer and Interrupts.
Microcontroller Applications
Time Sources and Timing
BITS EDU. CAMPUS , VARNAMA
Embedded Systems Design
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
AVR Addressing Modes Subject: Microcontoller & Interfacing
Time Sources and Timing
ECE 3430 – Intro to Microcomputer Systems
Chapter 10 The Stack.
EECS 373 Design of Microprocessor-Based Systems Mark Brehob
Introduction to Microprocessors and Microcontrollers
Programmable Interval timer 8253 / 8254
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
asyn Driver Tutorial Measurement Computing 1608GX-2A0
Thread Implementation Issues
Programmable Interval timer 8253 / 8254
UNIT 19 PWM 로봇 SW 교육원 조용수.
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
CSCI1600: Embedded and Real Time Software
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Wireless Embedded Systems
ECE 3430 – Intro to Microcomputer Systems
Mark Bristow CENBD 452 Fall 2002
Timer/Counter Timer/Counter 0 Timer/Counter 1 Timer/Counter 2 8 bit
UNIT 11: RC-SERVOMOTOR CONTROL
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
CSCI1600: Embedded and Real Time Software
What’s the Time? Geoff Huston APNIC.
Presentation transcript:

EECS 373: Design of Microprocessor-Based Systems Timers, count, capture and PWM Some material from Thomas Schmid, Mark Brehob

Announcements HW1/Proj1 Status? Ira Glass: http://vimeo.com/24715531

Today Background on time and clocking on a processor SmartFusion clocks and features How we use timers Design of a memory-mapped Pulse-Width Modulation (PWM) circuit.

Time in Embedded Systems: Where do we need accurate time? Scheduling of computation Scheduler in operating systems Real time operating systems Signal sampling and generation Audio sampling at 44.1 kHz TV/video generation (sync, vsync) Pulse Width Modulated (PWM) signals Communication Media Access Control (MAC) protocols Modulation Navigation GPS

Fine grain motion control http://www.youtube.com/watch?v=SOESSCXGhFo

Clock generation and use Resonating element/Driver: Quartz crystal can be made to resonate due to Piezoelectric effect. Resonate frequency depends on length, thickness, and angle of cut. Issues: Very stable (<100ppm) but not all frequencies possible. MEMS Resonator Arbitrary frequency, potentially cheap, susceptible to temperature variations. Others: Inverter Ring, LC/RC circuits, Atomic clock, and many more.

Clock Driver

Timers on the SmartFusion

Timers on the SmartFusion SysTick Timer ARM requires every Cortex-M3 to have this timer Essentially a 24-bit down-counter to generate system ticks Has its own interrupt Clocked by FCLK with optional programmable divider See Actel SmartFusion MSS User Guide for register definitions

Timers on the SmartFusion http://www.actel.com/documents/SmartFusion_MSS_UG.pdf

Timers on the SmartFusion System timer “The System Timer consists of two programmable 32-bit decrementing counters that generate interrupts to the ARM® Cortex™-M3 and FPGA fabric. Each counter has two possible modes of operation: Periodic mode or One-Shot mode. The two timers can be concatenated to create a 64-bit timer with Periodic and One-Shot modes. The two 32-bit timers are identical” http://www.actel.com/documents/SmartFusion_MSS_UG.pdf

Features of Timers a.k.a. “terms you need to know” Time is kept in the hardware counter Resolution: How often the hardware counter is updated. Precision: The smallest increment the software can read the counter. Accuracy: How close we are to UTC Range: The counter reads a value of (f*t) mod 2n. Range is the biggest value we can read. UTC is Coordinated Universal Time (French is Temps Universel Coordonné). I just work here…

Who cares? There are two basic activities one wants timers for: Measure how long something takes “Capture” Have something happen every X time period. “Compare”

Example #1 -- Capture FAN Say you have a fan spinning and you want to know how fast it is spinning. One way to do that is to have it throw an interrupt every time it completes a rotation. Right idea, but might take a while to process the interrupt, heavily loaded system might see slower fan than actually exists. This could be bad. Solution? Have the timer note immediately how long it took and then generate the interrupt. Also restart timer immediately. Same issue would exist in a car when measuring speed of a wheel turning (for speedometer or anti-lock brakes).

Example #2 -- Compare Driving a DC motor via PWM. Motors turn at a speed determined by the voltage applied. Doing this in analog land can be hard. Need to get analog out of our processor Need to amplify signal in a linear way (op-amp?) Generally prefer just switching between “Max” and “Off” quickly. Average is good enough. Now don’t need linear amplifier—just “on” and “off”. (transistor) Need a signal with a certain duty cycle and frequency. That is % of time high.

Virtual timers You never have enough timers. So what are we going to do about it? How about we handle in software?

Virtual Timers Simple idea. Maybe we have 10 events we might want to generate. Just make a list of them and set the timer to go off for the first one. Do that first task, change the timer to interrupt for the next task.

Problems? Only works for “compare” timer uses. Will result in slower ISR response time May not care, could just schedule sooner…

Implementation issues Shared user-space/ISR data structure. Insertion happens at least some of the time in user code. Deletion happens in ISR. We need critical section (disable interrupt) How do we deal with our modulo counter? That is, the timer wraps around. Why is that an issue? What functionality would be nice? Generally one-shot vs. repeating events Might be other things desired though What if two events are to happen at the same time? Pick an order, do both…

Implementation issues (continued) What data structure? Data needs be sorted Inserting one thing at a time We always pop from one end But we add in sorted order.