Lab 5 Timer Module PWM ReadMeFirst

Size: px
Start display at page:

Download "Lab 5 Timer Module PWM ReadMeFirst"

Transcription

1 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 of Timer A to implement a useful application: Pulse Width Modulation (PWM). On some microcontrollers and DSPs (Digital Signal Processors), Pulse Width Modulation is already built in as a peripheral in its own, but that is rare. Therefore it is important to know how PWM is produced on a typical MCU using a timer. In this document, we are going to start with an introduction to Pulse Width Modulation, PWM, and Timer A s output mode before we start the experiments. Pulse Width Modulation (PWM) Pulse Width Modulation modulates a signal by producing constant amplitude digital pulses whose pulse width (duty cycle, duration) is proportional to the signal s amplitude at a given sample time. PWM is used in communications and generating control signals among many other applications.

2 Two main parameters are associated with PWM: resolution and sampling period. Resolution is the number of distinct output pulse widths you can have. Each output pulse width corresponds to a signal value/amplitude. Therefore resolution is the number of distinct signal values you can modulate. Sampling time Ts gives the time interval between sampling points. In Fig. 1 sampling time is denoted as Ts. At every Ts, PWM produces a pulse width proportional to the signal (sine wave in the figure) value. Output Modes In the previous experiments we toggled a pin in timer interrupt routines to generate waveforms with various frequencies. In this part we are going to explore the output module of Timer A to generate pulses at fixed intervals and varying widths to produce PWM waves. In Timer_A each Capture/compare Block contains an output unit which can be used to generate output signals such as Pulse Width Modulation (PWM). We include part of the schematics below:

3 As you can see the output mode is handled by hardware. This means that you can generate signals at the output without the need to use ISRs to toggle pins and waste CPU computing cycles when you use this mode. Output pins of Timer_A output module are called TAx.y. x is the Timer number. In the MSP430F5529 we have three Timer_As (Timer_A0, Timer_A1 and Timer_A2) so x can be 0, 1 or 2. y is the Capture Compare Register. For Timer_A0 there are 5 Capture Compare Registers, therefore, y can be 0, 1, 2, 3 or 4. Each output unit has eight operating modes: Output, Set, Toggle/Reset, Set/Reset, Toggle, Reset, Toggle/Set, and Reset/Set. A list of available output modes and their description are summarized in the table below: Notice that there are two types of output modes, one only depends on the Capture Compare Register selected (CCR0, CCR1, CCR2, CCR3, CCR4) like modes 0, 1, 4 and 5. When the timer counts up to the selected CCR register value the corresponding output pin is set, reset or toggled. Name of these modes simply follows the operation: Output, Set, Toggle and Reset. The other type of output mode is related to the selected Capture Compare Register (CCRx where x is not equal to 0) and the special CCR0 register. The output changes when the

4 timer reaches the selected CCRx register and change again when it reaches the CCR0 value. Examples are modes 2, 3, 6 and 7. In the table you can also see the names of these modes: Toggle/Reset, Set/Reset, Toggle/Set and Reset/Set. In these modes we use the output modules of CCRx (x is not equal to 0), it is not useful to use the output mode of CCR0. OUTMOD Illustration in Up Mode The following illustration provide a more straight forward way to understand the operation of different output modes. In this case Timer_A is configured in Up Mode, meaning that the counter counts up to the value of compare register TAxCCR0 and restarts counting from zero when it reaches TAxCCR0. It should be noted that when it is in the Up Mode, Capture Compare Block 0 is used for special purpose (defining the period) and all other CCR blocks can be used normally.

5 PWM Generation The figure below illustrates how to generate PWM using Timer A and Reset/Set output mode for CCR1. In this illustration we set the timer to Up Mode. In Up Mode TAR continues to increment at each Timer_A clock tick until it reaches the value stored in TACCR0 and goes back to 0 again. Here we are using TACCR1 to store the signal value at the sample points. In this figure the output is set to 1 when TAR reaches TACCR0 and the output is reset to 0 when TAR reaches the current value stored in TACCR1. From the table we can see that the corresponding behavior is obtained when the output mode is set to 7, i.e., the Reset/Set mode. Therefore, in this case we should set the output mode to 7 for TA0 Capture Compare Block 1 The corresponding output pin is TA0.1 (on Pin 1.2 according to the Pin out Summary). The signal value is stored in TA0CCR1 and is updated every Ts. The update of TA0CCR1 can be done in either CCR0 or TAR interrupt. Note that it takes CPU clock cycles to update the TA0CCR1 value in the interrupt service routine. Therefore if the signal value is very small then we may miss the signal value while modulating. This problem can be solved by offsetting the signal or using the up down mode.

6 More methods are available based on the signal source and additional hardware attached to them. With an understanding of how PWM signals are generated in the Up Mode we can understand how resolution and sampling period are setup: 1) Resolution value is stored in TACCR0. 2) Sampling period Ts is the Timer A count period = TACCR0*T TACLK (T TACLK is the Timer A Clock) Sampling rate fs (PWM frequency) is 1/Ts. Ts/ T TACLK = TACCR0, f TACLK/fs = TACCR0 As an example, if you are given a design requirement to generate a 12 khz PWM (fs = 1/Ts) of a signal with 4096 (2^12 bits) resolution, you must have a 50 MHz clock (T TACLK ). However the G2553 microcontroller does not have such a high frequency clock, therefore we must compromise and either decrease the sampling frequency 1/Ts to keep the resolution or decrease the resolution to keep the sampling frequency. This example should give you a feel for the constraints required to generate PWM. DriverLib API Select Counting Mode for Timer A Timer_A_initUpMode() Compare Mode Timer_A_initCompareMode() Timer_A_setCompareValue() Output Mode Timer_A_setOutputMode() Timer_A_setOutputForOutputModeOutBitValue() Timer_A_getOutputForOutputModeOutBitValue()

7 Experiments Experiment 1 Compare Mode: Frequency Generation In this experiment, we will start with generating a 50/50 duty cycle square wave with a specific frequency. This would be helpful later in generating a PWM with a specific sampling period. Recall that in our last Lab s Experiment 1, we generated a square wave using Continuous Mode where the pin s output was toggled when an Overflow Interrupt was generated (i.e. the Timer counted to its max value 2^16 1). The operation of Continuous Mode is shown below: Figure. Continuous Mode Up Mode is used if the timer period must be different from 0xFFFF counts. The timer repeatedly counts up to the value in the compare register TAxCCR0, which defines the period as in the following figure. The number of timer counts in the period is TAxCCR0+1. When the timer value equals TAxCCR0, the timer restarts counting from zero. In this mode, the Capture Compare Block 0 works differently from other four Capture Compare Blocks since the value stored in its compare register TAxCCR0 is used to defined the period. Figure. Up Mode Thus we can easily use Up Mode to generate a square wave with any frequency by specifying the max value the timer counts up to. In this experiment, we will generate a frequency of 100Hz in Up Mode using Capture Compare Module 0 (CCR0) in Timer_A0.

8 1) Pin Configuration Configure P3.0 as a digital output pin Configure P2.2 as the output of SMCLK for debugging purposes 2) Clock Configuration Setup SMCLK to run at 1MHz o Measure your actual SMCLK frequency. Take a screenshot 3) Timer Setup Configure Timer_A0 to be sourced from SMCLK and set it in Up Mode Set the compare value of CCR0 o According to your actual SMCLK frequency, theoretically what value should be stored in TA0CCR0 register to generate a 100Hz square wave at P3.0? Show your reasoning in the lab report. Note: If you use structure, please make sure you initialize all members values 4) Interrupt Enable Enable TA0 s Capture Compare Interrupt 0 (CCIFG0) In your main function, enable General Interrupt (GIE) 5) Interrupt Service Routine Toggle P3.0 when an interrupt is generated o What Interrupt Vector should be used? o There is no need to clear the interrupt flag, why? o Use the oscilloscope to measure the output waveform at P3.0. Take a screenshot Experiment 2 DC Pulse Width Modulation In this experiment we are going to test the output module configuration by first generating pulse width modulation of a DC signal on output TA0.1 (on Pin 1.2) which is circled in red in the table below.

9 Table. TA0 Signal Connections The timer is set to count in Up Mode, the output mode that we are going to use here is the Reset/Set Mode as shown below. In this mode two Capture Compare Modules are used: the output hardware will set the output signal to 1 when the timer hits the value stored in TAxCCR0 and reset it to 0 when it hits the value stored in TAxCCR1. Remember that each Capture Compare Module comes with its own output hardware and we are using CCR1 s output hardware here. Include the following parts in your program: 1) Pin Configuration Configure P1.2 as a peripheral module function output pin (TA0.1) 2) Clock Configuration Setup SMCLK to run at 1MHz

10 o Measure your actual SMCLK frequency. Take a screenshot 3) Timer Setup Configure Timer_A0 to be sourced from SMCLK with a divider of 8 and set it in Up Mode Set resolution to be 2^10 = 1024 by setting the compare value of CCR0 to 1024 Set the compare value of CCR1 to 50 Configure CCR1 s output mode as Reset/Set mode Note: If you use structure, please make sure you initialize all members values Connect TA0.1 pin out to LED1 on the launchpad using a jumper wire and observe the result via the intensity of the LED. Our eyes will behave like a low pass filter when we see the lighting of LED. Change the value in TA0CCR1 to 900. o What difference did you observe on the LED? o Based on the values stored in CCR0 and CCR1 registers what are the duty cycles of the generated square wave in both cases? Duty cycle = width of a pulse / period of the square wave Bonus Experiment (2pt) The following experiment is NOT required for your lab report. Please ask lab monitors to confirm your results on completion. Experiment 3 Sine Wave PWM Generation In this experiment we are going to generate Pulse Width Modulation from an array of data stored in memory on output TA0.1 (P1.2). We will connect TA0.1 pin to LED1 using a jumper wire and observe the result via the intensity of the LED. For the signal to modulate we will use a table consisting of half a period of a sine wave. As a result we expect to see the brightness of the LED light to vary from dim to bright and then back to dim in the behavior of a half period of a sine wave. The sine wave table will be inserted in the memory of the microcontroller by loading a.dat file into the memory space. The data file (as well as the MATLAB file that generated it) will be provided to you. Based on your code from Experiment 2, follow the instructions below: Add an array[256] of uint16_t Select Timer_A0 s clock source divider of 16 Add an Interrupt Subroutine to update TA0CCR1 value when timer reaches TACCR0 value: use TACCR0 interrupt to update value

11 Interrupt Enable Download the SineTable zipped file from the website. Unzip the file and save it to your local directory. In debugger, open the memory browser, search for the array name. Right click and select Load Memory, browse to the unzipped.dat file and click Next. Set the Start Address as the starting address of the array and set the length to 0x100 (256 in decimal). Click Finish. As shown in the screenshot below, the array named array starts with the address 0x Set the starting address as the starting address of the array: o Observe your output on oscilloscope. o Once a signal is converted to PWM, it can be converted back to the original signal by using an analog filter. What type of filter (low pass, high pass or band pass) would be needed for this conversion, explain. What cutoff frequency should you filter have?

Timer A (0 and 1) and PWM EE3376

Timer 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 information

Timer A. Last updated 8/7/18

Timer 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 information

ME 461 Laboratory #2 Timers and Pulse-Width Modulation

ME 461 Laboratory #2 Timers and Pulse-Width Modulation ME 461 Laboratory #2 Timers and Pulse-Width Modulation Goals: 1. Understand how to use timers to control the frequency at which events occur. 2. Generate PWM signals using Timer A. 3. Explore the frequency

More information

Analog to Digital Conversion

Analog to Digital Conversion Analog to Digital Conversion The MSP in the name of our microcontroller MSP430G2554 is abbreviation for Mixed Signal Processor. This means that our microcontroller can be used to handle both analog and

More information

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno Microcontrollers: Lecture 3 Interrupts, Timers Michele Magno 1 Calendar 07.04.2017: Power consumption; Low power States; Buses, Memory, GPIOs 20.04.2017 Serial Communications 21.04.2017 Programming STM32

More information

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

Course 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 information

Generating DTMF Tones Using Z8 Encore! MCU

Generating DTMF Tones Using Z8 Encore! MCU Application Note Generating DTMF Tones Using Z8 Encore! MCU AN024802-0608 Abstract This Application Note describes how Zilog s Z8 Encore! MCU is used as a Dual-Tone Multi- (DTMF) signal encoder to generate

More information

IV 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 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 information

LM4: The timer unit of the MC9S12DP256B/C

LM4: 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 information

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

Grundlagen 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 information

University of Texas at El Paso Electrical and Computer Engineering Department

University 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 information

Hello 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. 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 information

RC Filters and Basic Timer Functionality

RC Filters and Basic Timer Functionality RC-1 Learning Objectives: RC Filters and Basic Timer Functionality The student who successfully completes this lab will be able to: Build circuits using passive components (resistors and capacitors) from

More information

CprE 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 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 information

VORAGO Timer (TIM) subsystem application note

VORAGO 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 information

ECE2049: Embedded Systems in Engineering Design Lab Exercise #4 C Term 2018

ECE2049: Embedded Systems in Engineering Design Lab Exercise #4 C Term 2018 ECE2049: Embedded Systems in Engineering Design Lab Exercise #4 C Term 2018 Who's Watching the Watchers? Which is better, the SPI Digital-to-Analog Converter or the Built-in Analog-to-Digital Converter

More information

Lazy Clock Electronics and Software

Lazy Clock Electronics and Software Lazy Clock Electronics and Software Introduction The Lazy Clock is a wood gear mechanical clock driven by a low-power solenoid that fires only once per minute. An MSP430 microcontroller, clocked with a

More information

MICROCONTROLLER TUTORIAL II TIMERS

MICROCONTROLLER 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 information

Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Hardware 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 information

This section describes the basic functions of a the general purpose 16-bit Timer_A in MSP430 based system.

This 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 information

Chapter 6 PROGRAMMING THE TIMERS

Chapter 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 information

Lab 5. Binary Counter

Lab 5. Binary Counter Lab. Binary Counter Overview of this Session In this laboratory, you will learn: Continue to use the scope to characterize frequencies How to count in binary How to use an MC counter Introduction The TA

More information

CSCI1600 Lab 4: Sound

CSCI1600 Lab 4: Sound CSCI1600 Lab 4: Sound November 1, 2017 1 Objectives By the end of this lab, you will: Connect a speaker and play a tone Use the speaker to play a simple melody Materials: We will be providing the parts

More information

Lab 6. Binary Counter

Lab 6. Binary Counter Lab 6. Binary Counter Overview of this Session In this laboratory, you will learn: Continue to use the scope to characterize frequencies How to count in binary How to use an MC14161 or CD40161BE counter

More information

Measuring Distance Using Sound

Measuring Distance Using Sound Measuring Distance Using Sound Distance can be measured in various ways: directly, using a ruler or measuring tape, or indirectly, using radio or sound waves. The indirect method measures another variable

More information

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair Overview For this assignment, you will be controlling the light emitted from and received by an LED/phototransistor pair. There are many

More information

Lab 6 - MCU CODEC IIR Filter ReadMeFirst

Lab 6 - MCU CODEC IIR Filter ReadMeFirst Lab 6 - MCU CODEC IIR Filter ReadMeFirst Lab Summary In this lab you will use a microcontroller and an audio CODEC to design a 2nd order low pass digital IIR filter. Use this filter to remove the noise

More information

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK Team Members: Andrew Blanford Matthew Drummond Krishnaveni Das Dheeraj Reddy 1 Abstract: The goal of the project was to build an interactive and mobile

More information

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System Introduction CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System The purpose of this lab is to introduce you to digital control systems. The most basic function of a control system is to

More information

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

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 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 information

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen

More information

MSP430 Interfacing Programs

MSP430 Interfacing Programs IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -5 1 MSP430 Interfacing Programs 1. Blinking LED 2. LED control using switch 3. GPIO interrupt 4. ADC & PWM application speed control of dc motor 5.

More information

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab The purpose of this lab is to learn about sensors and use the ADC module to digitize the sensor signals. You will use the digitized signals

More information

UNIVERSITY 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. 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 information

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

ME 461 Laboratory #5 Characterization and Control of PMDC Motors ME 461 Laboratory #5 Characterization and Control of PMDC Motors Goals: 1. Build an op-amp circuit and use it to scale and shift an analog voltage. 2. Calibrate a tachometer and use it to determine motor

More information

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by A MORON'S GUIDE TO TIMER/COUNTERS v2.2 by RetroDan@GMail.com TABLE OF CONTENTS: 1. THE PAUSE ROUTINE 2. WAIT-FOR-TIMER "NORMAL" MODE 3. WAIT-FOR-TIMER "NORMAL" MODE (Modified) 4. THE TIMER-COMPARE METHOD

More information

Using the Z8 Encore! XP Timer

Using 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 information

CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER

CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER 65 CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER 4.1 INTRODUCTION Many control strategies are available for the control of IMs. The Direct Torque Control (DTC) is one of the most

More information

OBSTACLE EVADING ULTRASONIC ROBOT. Aaron Hunter Eric Whitestone Joel Chenette Anne-Marie Cressin

OBSTACLE EVADING ULTRASONIC ROBOT. Aaron Hunter Eric Whitestone Joel Chenette Anne-Marie Cressin OBSTACLE EVADING ULTRASONIC ROBOT Aaron Hunter Eric Whitestone Joel Chenette Anne-Marie Cressin ECE 511 - Fall 2011 1 Abstract The purpose of this project is to demonstrate how simple algorithms can produce

More information

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ υιοπασδφγηϕκλζξχϖβνµθωερτψυιοπασδ φγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκλζ ξχϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµ EE 331 Design Project Final Report θωερτψυιοπασδφγηϕκλζξχϖβνµθωερτψ

More information

Lecture 6: More on Timers and PWM

Lecture 6: More on Timers and PWM ECE342 Digital II Lecture 6: More on Timers and PWM Ying Tang Electrical and Computer Engineering Rowan University 1 Timer in Capture Mode What Does a Timer Really Do? Capture a selected input from either

More information

Timer 0 Modes of Operation. Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode

Timer 0 Modes of Operation. Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode Timer 0 Modes of Operation Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode PWM - Introduction Recall: PWM = Pulse Width Modulation We will mostly use it for controlling

More information

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES Faculty of Engineering INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES Lab 1 Prepared by Kevin Premrl & Pavel Shering ID # 20517153 20523043 3a Mechatronics Engineering June 8, 2016 1 Phase

More information

Graphical Control Panel User Manual

Graphical Control Panel User Manual Graphical Control Panel User Manual DS-MPE-DAQ0804 PCIe Minicard Data Acquisition Module For Universal Driver Version 7.0.0 and later Revision A.0 March 2015 Revision Date Comment A.0 3/18/2015 Initial

More information

Using the CODEC ReadMeFirst

Using the CODEC ReadMeFirst Using the CODEC ReadMeFirst Lab Summary This lab covers the use of the CODEC that is necessary in nearly all of the future labs. This lab is divided into three parts. In the first part, you will work with

More information

ArbStudio Training Guide

ArbStudio Training Guide ArbStudio Training Guide Summary This guide provides step by step instructions explaining how to create waveforms, use the waveform sequencer, modulate waveforms and generate digital patterns. The exercises

More information

Module: Arduino as Signal Generator

Module: Arduino as Signal Generator Name/NetID: Teammate/NetID: Module: Laboratory Outline In our continuing quest to access the development and debugging capabilities of the equipment on your bench at home Arduino/RedBoard as signal generator.

More information

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

PWM 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 information

Analog-to-Digital Converter. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Analog-to-Digital Converter. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name MPSD A/D Lab Exercise Analog-to-Digital Converter Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name Notes: You must work on this assignment with your partner. Hand in a

More information

ATmega16A Microcontroller

ATmega16A 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

PIC 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 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 information

AN4062 Application note

AN4062 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 information

EE477 Digital Signal Processing Laboratory Exercise #13

EE477 Digital Signal Processing Laboratory Exercise #13 EE477 Digital Signal Processing Laboratory Exercise #13 Real time FIR filtering Spring 2004 The object of this lab is to implement a C language FIR filter on the SHARC evaluation board. We will filter

More information

ENGR 1110: Introduction to Engineering Lab 7 Pulse Width Modulation (PWM)

ENGR 1110: Introduction to Engineering Lab 7 Pulse Width Modulation (PWM) ENGR 1110: Introduction to Engineering Lab 7 Pulse Width Modulation (PWM) Supplies Needed Motor control board, Transmitter (with good batteries), Receiver Equipment Used Oscilloscope, Function Generator,

More information

Hello, 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 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 information

For reference only Refer to the latest documents for details

For 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 information

Microcontroller: Timers, ADC

Microcontroller: 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 information

Input/Output Control Using Interrupt Service Routines to Establish a Time base

Input/Output Control Using Interrupt Service Routines to Establish a Time base CSUS EEE174 Lab Input/Output Control Using Interrupt Service Routines to Establish a Time base 599 Menlo Drive, Suite 100 Rocklin, California 95765, USA Office/Tech Support: (916) 624-8333 Fax: (916) 624-8003

More information

Application Report. Bhargavi Nisarga, Kripasagar Venkat... MSP430 Applications

Application Report. Bhargavi Nisarga, Kripasagar Venkat... MSP430 Applications Application Report SLAA389 February 2008 A Robust Glass-Breakage Detector Using the MSP430 Bhargavi Nisarga, Kripasagar Venkat... MSP430 Applications ABSTRACT This application report describes the working

More information

EE 308 Lab Spring 2009

EE 308 Lab Spring 2009 9S12 Subsystems: Pulse Width Modulation, A/D Converter, and Synchronous Serial Interface In this sequence of three labs you will learn to use three of the MC9S12's hardware subsystems. WEEK 1 Pulse Width

More information

Physics 335 Lab 7 - Microcontroller PWM Waveform Generation

Physics 335 Lab 7 - Microcontroller PWM Waveform Generation Physics 335 Lab 7 - Microcontroller PWM Waveform Generation In the previous lab you learned how to setup the PWM module and create a pulse-width modulated digital signal with a specific period and duty

More information

COSC 3215 Embedded Systems Laboratory

COSC 3215 Embedded Systems Laboratory Introduction COSC 3215 Embedded Systems Laboratory Lab 5 Temperature Controller Your task will be to design a temperature controller using the Dragon12 board that will maintain the temperature of an object

More information

ELEC 3040/3050 Lab #7

ELEC 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 information

Laboratory Exercise #1

Laboratory Exercise #1 ECEN4002/5002 Spring 2004 Digital Signal Processing Laboratory Laboratory Exercise #1 Introduction The goals of this first exercise are to (1) get acquainted with the code development system and (2) to

More information

EEL 4744C: Microprocessor Applications Lecture 8 Timer Dr. Tao Li

EEL 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 information

Reading Assignment. Timer. Introduction. Timer Overview. Programming HC12 Timer. An Overview of HC12 Timer. EEL 4744C: Microprocessor Applications

Reading 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 information

Microprocessor & Interfacing Lecture Programmable Interval Timer

Microprocessor & 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 information

Real Analog - Circuits 1 Chapter 11: Lab Projects

Real Analog - Circuits 1 Chapter 11: Lab Projects Real Analog - Circuits 1 Chapter 11: Lab Projects 11.2.1: Signals with Multiple Frequency Components Overview: In this lab project, we will calculate the magnitude response of an electrical circuit and

More information

ME 461 Laboratory #3 Analog-to-Digital Conversion

ME 461 Laboratory #3 Analog-to-Digital Conversion ME 461 Laboratory #3 Analog-to-Digital Conversion Goals: 1. Learn how to configure and use the MSP430 s 10-bit SAR ADC. 2. Measure the output voltage of your home-made DAC and compare it to the expected

More information

Lecture 12 Timer Functions

Lecture 12 Timer Functions CPE 390: Microprocessor Systems Spring 2018 Lecture 12 Timer Functions Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 Adapted from HCS12/9S12

More information

ELCT 912: Advanced Embedded Systems

ELCT 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 information

AN2581 Application note

AN2581 Application note AN2581 Application note STM32F10xxx TIM application examples Introduction This application note is intended to provide practical application examples of the STM32F10xxx TIMx peripheral use. This document,

More information

Course Introduction. Purpose: Objectives: Content: 24 pages 3 questions. Learning Time: 35 minutes

Course Introduction. Purpose: Objectives: Content: 24 pages 3 questions. Learning Time: 35 minutes Course Introduction Purpose: This course provides an overview of the timer peripherals built into popular SH-2 and SH-2A families of 32-bit RISC microcontrollers, which are members of the SuperH series

More information

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE 9S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE In this sequence of three labs you will learn to use the 9S12 S hardware sybsystem. WEEK 1 PULSE WIDTH MODULATION

More information

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15 INTRODUCTION The Diligent Analog Discovery (DAD) allows you to design and test both analog and digital circuits. It can produce, measure and

More information

AC Induction Motor (ACIM) Control using a Digital Signal Controller (DSC)

AC Induction Motor (ACIM) Control using a Digital Signal Controller (DSC) Research Journal of Applied Sciences, Engineering and Technology 4(19): 3740-3745, 2012 ISSN: 2040-7467 Maxwell Scientific Organization, 2012 Submitted: March 07, 2012 Accepted: March 30, 2012 Published:

More information

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives Electrical and Computer Engineering E E 452. Electric Machines and Power Electronic Drives Laboratory #5 Buck Converter Embedded Code Generation Summary In this lab, you will design the control application

More information

PWM Demonstration System Document

PWM Demonstration System Document PWM Demonstration System Document Texas Instruments Table of contents 1 System Overview...2 2 Software structure...3 2.1 Directory structure...3 2.2 Software Flowchart...3 2.3 Software configuration options...4

More information

Embedded Systems and Software

Embedded Systems and Software Embedded Systems and Software Notes on Lab 2 Embedded Systems in Vehicles Lecture 2-4, Slide 1 Lab 02 In this lab students implement an interval timer using a pushbutton switch, ATtiny45, an LED driver,

More information

Design with Microprocessors

Design with Microprocessors Design with Microprocessors Year III Computer Science 1-st Semester Lecture 5: AVR timers Timers AVR timers 8 bit timers/counters 16 bit timers/counters Characteristics Input clock prescaler Read / write

More information

Exercise 3: Sound volume robot

Exercise 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 information

Part (A) Using the Potentiometer and the ADC* Part (B) LEDs and Stepper Motors with Interrupts* Part (D) Breadboard PIC Running a Stepper Motor

Part (A) Using the Potentiometer and the ADC* Part (B) LEDs and Stepper Motors with Interrupts* Part (D) Breadboard PIC Running a Stepper Motor Name Name (Most parts are team so maintain only 1 sheet per team) ME430 Mechatronic Systems: Lab 5: ADC, Interrupts, Steppers, and Servos The lab team has demonstrated the following tasks: Part (A) Using

More information

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter EE283 Electrical Measurement Laboratory Laboratory Exercise #7: al Counter Objectives: 1. To familiarize students with sequential digital circuits. 2. To show how digital devices can be used for measurement

More information

Agilent N7509A Waveform Generation Toolbox Application Program

Agilent N7509A Waveform Generation Toolbox Application Program Agilent N7509A Waveform Generation Toolbox Application Program User s Guide Second edition, April 2005 Agilent Technologies Notices Agilent Technologies, Inc. 2005 No part of this manual may be reproduced

More information

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board IXDP610 Digital PWM Controller IC Evaluation Board General Description The IXDP610 Digital Pulse Width Modulator (DPWM) is a programmable CMOS LSI device, which accepts digital pulse width data from a

More information

µtasker Document µtasker Hardware Timers

µ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 information

PWMLib PWM Library. Jim Schimpf. Document Number: PAN Revision Number: April Pandora Products. 215 Uschak Road Derry, PA 15627

PWMLib PWM Library. Jim Schimpf. Document Number: PAN Revision Number: April Pandora Products. 215 Uschak Road Derry, PA 15627 PWMLib Jim Schimpf Document Number: Revision Number: 0.8 Pandora Products. 215 Uschak Road Derry, PA 15627 Creative Commons Attribution 4.0 International License 2015 Pandora Products. All other product

More information

Houngninou 2. Abstract

Houngninou 2. Abstract Houngninou 2 Abstract The project consists of designing and building a system that monitors the phase of two pulses A and B. Three colored LEDs are used to identify the phase comparison. When the rising

More information

Fixed-function (FF) implementation for PSoC 3 and PSoC 5 devices

Fixed-function (FF) implementation for PSoC 3 and PSoC 5 devices 2.40 Features 8- or 16-bit resolution Multiple pulse width output modes Configurable trigger Configurable capture Configurable hardware/software enable Configurable dead band Multiple configurable kill

More information

Enhancing Analog Signal Generation by Digital Channel Using Pulse-Width Modulation

Enhancing Analog Signal Generation by Digital Channel Using Pulse-Width Modulation Enhancing Analog Signal Generation by Digital Channel Using Pulse-Width Modulation Angelo Zucchetti Advantest angelo.zucchetti@advantest.com Introduction Presented in this article is a technique for generating

More information

tinyavr 1-series Training

tinyavr 1-series Training Getting Started with the tinyavr 1-series Prerequisites Hardware Prerequisites Microchip ATtiny817 Xplained Pro board Micro-USB cable (Type-A/Micro-B) One female-to-female wire Internet connection Software

More information

EE445L Fall 2014 Quiz 2A Page 1 of 5

EE445L 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 information

ECE251: Tuesday October 3 0

ECE251: 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 information

Experiment 1.A. Working with Lab Equipment. ECEN 2270 Electronics Design Laboratory 1

Experiment 1.A. Working with Lab Equipment. ECEN 2270 Electronics Design Laboratory 1 .A Working with Lab Equipment Electronics Design Laboratory 1 1.A.0 1.A.1 3 1.A.4 Procedures Turn in your Pre Lab before doing anything else Setup the lab waveform generator to output desired test waveforms,

More information

AN0026.0: EFM32 and EZR32 Wireless MCU Series 0 Low Energy Timer

AN0026.0: EFM32 and EZR32 Wireless MCU Series 0 Low Energy Timer AN0026.0: EFM32 and EZR32 Wireless MCU Series 0 Low Energy Timer This application note gives an overview of the Low Energy Timer (LETIMER) and demonstrates how to use it on the EFM32 and EZR32 wireless

More information

Lab 4: Using the CODEC

Lab 4: Using the CODEC Lab 4: Using the CODEC ECE 2060 Spring, 2016 Haocheng Zhu Gregory Ochs Monday 12:40 15:40 Date of Experiment: 03/28/16 Date of Submission: 04/08/16 Abstract This lab covers the use of the CODEC that is

More information

EIE/ENE 334 Microprocessors

EIE/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 information

Temperature Monitoring and Fan Control with Platform Manager 2

Temperature Monitoring and Fan Control with Platform Manager 2 August 2013 Introduction Technical Note TN1278 The Platform Manager 2 is a fast-reacting, programmable logic based hardware management controller. Platform Manager 2 is an integrated solution combining

More information

Brian Hanna Meteor IP 2007 Microcontroller

Brian Hanna Meteor IP 2007 Microcontroller MSP430 Overview: The purpose of the microcontroller is to execute a series of commands in a loop while waiting for commands from ground control to do otherwise. While it has not received a command it populates

More information

Chapter 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 information