EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6748 DSP.

Slides:



Advertisements
Similar presentations
Chapter 3 Basic Input/Output
Advertisements

Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Interrupts Disclaimer: All diagrams and figures in this presentation are scanned from the book “Microprocessors and Programmed Logic” authored by Kenneth.
I/O Unit.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
68HC11 Polling and Interrupts
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
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.
Communication Lab - Interrupts 1/13 Sequential Programming  Our C++ programs are sequential ( סדרתיים), they start at the first instruction and end at.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
A look at interrupts What are interrupts and why are they needed.
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
EE 445S Real-Time Digital Signal Processing Lab Fall 2011 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6748 DSP.
The 8051 Microcontroller and Embedded Systems
INTERRUPTS PROGRAMMING
Embedded Systems 7763B Mt Druitt College of TAFE
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
UNIT 8 Keypad Interface Contact Closure Counter Exceptions (Interrupts and Reset)
Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external.
Revised: Aug 1, ECE 263 Embedded System Design Lessons 23, 24 - Exceptions - Resets and Interrupts.
MICROPROCESSOR INPUT/OUTPUT
CoE3DJ4 Digital Systems Design Chapter 6: Interrupts.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Chapter 3 Basic Input/Output. Chapter Outline Basic I/O capabilities of computers I/O device interfaces Memory-mapped I/O registers Program-controlled.
Generating Sinusoidal Signals Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin EE 445S Real-Time Digital.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
ECE 447 Fall 2009 Lecture 7: MSP430 Polling and Interrupts.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 11.
بسم الله الرحمن الرحيم MEMORY AND I/O.
EE 345S Real-Time Digital Signal Processing Lab Fall 2007 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6713 DSP.
Polled IO versus Interrupt Driven IO
Interrupt-Driven I/O There are different types of interrupts –Hardware Generated by the 8259 PIC – signals the CPU to suspend execution of the current.
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #3 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6713 DSP.
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
MICROPROCESSOR BASED SYSTEM DESIGN
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Computer Architecture
Interrupts In 8085 and 8086.
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
EE 445S Real-Time Digital Signal Processing Lab Spring 2017
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
* * * * * * * 8051 Interrupts Programming.
Generating Sinusoidal Signals
Interrupt.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013
COMPUTER PERIPHERALS AND INTERFACES
Lecture 9: TI MSP430 Interrupts & Low Power Modes
CNET 315 Microprocessor & Assembly Language
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
COMP3221: Microprocessors and Embedded Systems
EE 345S Real-Time Digital Signal Processing Lab Fall 2007
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6748 DSP Debarati Kundu

2 Outline Sine Wave Generation  Function Call  Lookup Table  Difference Equation Output Methods  Polling  Interrupts  EDMA

3 Sine Wave Generation One-sided discrete-time signal of frequency ω 0 cos(ω 0 n) u[n] One-sided continuous-time signal of frequency ω 0 cos(2 π f 0 t) u(t) Using a sampling frequency f s such that f s > 2 f 0 Substitute t=nT s =n/f s f s cos(2π (f 0 /f s ) n) u[n] ω 0 = 2π (f 0 /f s ) rad/sample

4 Sine Wave Generation Function Call: Use the C library function sin(x) whenever a sine value is needed, approximated as the ratio of 2 10 th order polynomials in x  Computation: 21 multiplications, 21 additions and 1 division  Memory Usage: 22 coefficients and 1 intermediate variable (x) and one constant (2  ) Lookup Table: Pre-compute and store one period of samples, can even store one-half or one-quarter or one-eighth period and use symmetry.  Frequency is ω 0 =2πN/L  L is the period in discrete-time  Interpolate stored values to get result at all frequencies  No computation needed, just memory reads.

5 Sine Wave Generation Difference Equation: Input x[n] and output y[n] (zero IC’s) y[n] = (2 cos  0 ) y[n-1] - y[n-2] + x[n] - (cos  0 ) x[n-1]  Results from z-transform of cos(ω 0 n)u[n]  Computation: 2 multiplications and 3 additions  Memory Usage: 2 coefficients, 2 previous values of y[n] and 1 previous value of x[n]  Drawback is the build-up of error due to feedback

Polling: CPU Poll RRDY ADC McASP DAC SR12 SR11 Poll XRDY DATA AIC3106 Audio Codec READ SR12 WRITE SR11 Poll XRDY (transmit ready) bit of the McASP(Multi-Channel Audio Serial Port) until TRUE then write to SR11 register of the McASP. If XRDY is TRUE, function returns the sample and the value 1, If XRDY is FALSE, function returns immediately without sending a sample and return the value 0. 4

7 Output Methods Drawbacks of Polling:  Most of the time in the polling method is spent in the infinite loop waiting for the RRDY/XRDY flag to get set,  DSP is doing nothing,  A more efficient approach is to let DSP run tasks in background (modulating/demodulating, coding/decoding…),  So, serial port will interrupt background tasks when sample is received and needs to be transmitted.

8 Output Methods Interrupts: are signals from hardware/software indicating the need for attention or change of execution. C6748 DSP has a vectored priority interrupt controller that can handle 16 different interrupts:  RESET interrupt has highest priority, cannot be masked,  NMI (Non-Maskable Interrupt) has the second highest priority (used to notify DSP of serious hardware errors),  2 reserved maskable interrupts come next,  12 additional maskable interrupts (INT4-INT15) have the lowest priority.

CPU Interrupts from McASP “Ready to Read” CPU CODECCODEC McASP0_INT RDATA=1 SR12XRSR SR11XRSR XDATA=1 “Ready to Write”  RCV/XMT INTs combined into one interrupt:MCASP0_INT  RDATA triggers when SR12 is filled (32 bits)  XDATA triggers when SR11 is emptied (32 bits) 7

How do Interrupts Work? 1. An interrupt occurs EDMA McASP Timer Ext’l pins 2. Interrupt Selector Sets flag in Interrupt Flag Register (IFR) … 4. Is this specific interrupt enabled? (IER) 5. Are interrupts globally enabled? (GIE/NMIE) 6. CPU Acknowledge Auto hardware sequence HWI Dispatcher (vector) Branch to ISR 7. Interrupt Service Routine (ISR) Context Save, ISR, Context Restore  User is responsible for setting up the following: #2 – Interrupt Selector (choose which 12 of 128 interrupt sources to use) #4 – Interrupt Enable Register (IER) – individually enable the proper interrupt sources #5 – Global Interrupt Enable (GIE/NMIE) – globally enable all interrupts #6 – Hardware Interrupt (HWI) Dispatcher – the vector to the ISR 12

11 Example Interrupt Service Routine interrupt void Codec_ISR() { /* add any local variables here */ if(CheckForOverrun())// overrun error occurred (i.e. halted DSP) return;// so serial port is reset to recover CodecDataIn.UINT = ReadCodecData();// get input data samples /* algorithm begins here */ phaseIncrement = 2*pi*fDesired/fs; /* calculate the phase increment */ phase += phaseIncrement; /* calculate the next phase */ if (phase >= 2*pi) phase -= 2*pi; /* modulus 2*pi operation */ CodecDataOut.Channel[ LEFT] = A*sinf(phase); /* scaled L output */ CodecDataOut.Channel[RIGHT] = A*cosf(phase); /* scaled R output */ /* algorithm ends here */ WriteCodecData(CodecDataOut.UINT);// send output data to port }