29 Pages

Lab3_Notes_2009

Course: EECS 461, Winter 2008
School: Michigan
Rating:
 
 
 
 
 

Word Count: 1461

Document Preview

3: 1 Lab Queued A-D Conversion (eQADC) 2 Queued Analog-to-Digital Conversion Acquire analog input from the potentiometer and observe the result using the debugger Using an oscilloscope, measure the time required to complete one conversion by toggling GPIO Acquire a sine wave signal from the function generator and investigate aliasing Generate a square wave signal from the input sine function and observe...

Register Now

Unformatted Document Excerpt

Coursehero >> Michigan >> Michigan >> EECS 461

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
3: 1 Lab Queued A-D Conversion (eQADC) 2 Queued Analog-to-Digital Conversion Acquire analog input from the potentiometer and observe the result using the debugger Using an oscilloscope, measure the time required to complete one conversion by toggling GPIO Acquire a sine wave signal from the function generator and investigate aliasing Generate a square wave signal from the input sine function and observe output signal frequency on the digital oscilloscope Use the software oscilloscope to output the acquired signal to the serial port for display on the monitor Software Oscilloscope Display 3 Queued Analog-to-Digital Conversion Chapter 19 MPC5553-RM Two12-bit ADC (ADC0/1) Single ended, 0-5v Double ended 2.5 2.5v 40 MUXed input channels Command FIFO (CFIFO) triggers ADC Results FIFO (RFIFO) receives conversions DMA (Direct Memory Access) transfers Commands from userdefined command queue to CFIFO Results from RFIFO to used-defined results queue 4 Queued Analog-to-Digital Conversion 6 CFIFOs (EQADC_CFIFO[0-5]) 6 RFIFOs (EQADC_RFIFO[0-5]) Any CFIFO can command either ADC, and results can be sent to any RFIFO We will configure EQADC_CFIFO0 and EQACD_CFIFO1 to use ADC0 and put the results in RFIFO0 and RFIFO1 respectively Write commands to CFIFO push registers and read results from RFIFO pop registers 5 Queued Analog-to-Digital Conversion Operating Modes Single-scan mode Command Queue is scanned one time Software involvement is needed to re-arm queue after queue is scanned Continuous-scan mode Command Queue is scanned multiple times Software involvement is not needed to re-arm queue All modes may be software-triggered, edgetriggered or level-triggered We will set up 2 queues: EQADC_CFIFO0 for software-triggered single scan EQADC_CFIFO1 for software-triggered continuous scan 6 Programming the eQADC Like other peripherals, the eQADC must be configured by writing commands to special purpose registers eQADC Module Configuration Register (EQADC MCR) CFIFO Control Registers (EQADC CFCRn) Structure to access these registers is included in MPC5553.h EQADC_MCR described in Section 19.3.2.1 of the Reference Manual EQADC_CFCRn described in Section 19.3.2.6 and Tables 19-9 and 19-10 7 EQADC_MCR ESSIE: Synchronous Serial Interface enable (disable = 00) DBG: Debug mode enable (disable = 00) 8 EQADC_CFCRn SSE: Single scan enable CFINV: CFCR invalidate (CFINV = 0) MODE: Operating mode (Table 9-10) 0000: disabled 0001: software triggered single scan 1001: software triggered continuous scan 9 Programming the eQADC Unlike other peripherals, some eQADC registers are not accessible to the programmer Registers that control on-chip ADCs are programmed by sending 32-bit configuration and command messages to the CFIFO Write Configuration Command Message Sets the control registers of the on-chip ADCs. Read Configuration Command Message Reads the contents of the on-chip ADC registers which are only accessible via command messages Conversion Command Message Conversion result is returned with optional time stamp Non-memory Mapped ADC Registers 10 5 configuration registers for each ADC Control register (ADCn_CR) Enables ADC Enables external multiplexing Sets the ADC clock speed Other configuration registers enable time stamp and set calibration parameters 11 ADCn_CR ADCn_EN: Enable ADC ADCn_EMUX: Enable MUX ADCn_CLK_PS: ADC clock prescaler (see Table 19-28) R/W Configuration Command Message Format 12 EOQ: end-of-queue PAUSE: wait for trigger See Tables 19.35 and 36 EB: external buffer (0 for on-chip ADC) BN: buffer number (0 or 1) R/W: 0 = write; 1 = read command message ADC_REGISTER HIGH BYTE: value to be written into the most significant 8 bits of control/configuration register when the R/W bit is negated ADC_REGISTER LOW BYTE: value to be written into the least significant 8 bits of control/configuration register when the R/W bit is negated ADC_REG_ADDRESS: ADC register address (see Tables 19-25 and 26) Configuration Command Message Format As usual, we can use a structure or union to construct a configuration command message Access as a register or individual bit fields 13 union adc_config_msg { vuint32_t R; struct { vuint32_t header:6; vuint32_t command:26; } BB; struct { vuint32_t EOQ:1; vuint32_t PAUSE:1; vuint32_t :3; vuint32_t EB:1; vuint32_t BN:1; vuint32_t RW:1; vuint32_t HIGH_BYTE:8; vuint32_t LOW_BYTE:8; vuint32_t ADC_REG_ADDRESS:8; } B; }; Configuration Command Message Format Example: Select ACD0 and configure the ADC0_CR union adc_config_msg config; /* ADC configurations- command internal ADC register parameters config.R = 0; config.B.BN = 0; config.B.HIGH_BYTE = 0x80; config.B.LOW_BYTE = 0x05; /* Command ADC 0 /* Enable ADC module /* Use clock prescaler of 10 /* ADC0_CR address 14 config.B.ADC_REG_ADDRESS = 0x01; Conversion Command Message Command Format 15 Conversion Message Format Our conversion command structure union cfifo_msg{ vuint32_t R; struct{ vuint32_t header:6; vuint32_t command:26; } BB; struct{ vuint32_t EOQ:1; vuint32_t PAUSE:1; vuint32_t :3; vuint32_t EB:1; vuint32_t BN:1; vuint32_t CAL:1; vuint32_t MESSAGE_TAG:4; vuint32_t LST:2; vuint32_t TSR:1; vuint32_t FMT:1; vuint32_t CHANNEL_NUMBER:8; vuint32_t :8; } B; }; 16 Conversion Command Message Format Conversion command message example: union cfifo_msg cmd; cmd.R = cmd.B.EOQ = cmd.B.PAUSE = cmd.B.EB = cmd.B.BN = cmd.B.CAL = cmd.B.MESSAGE_TAG = cmd.B.LST = cmd.B.TSR = cmd.B.FMT = cmd.B.CHANNEL_NUMBER = 0; 1; /* end-of-queue */ 0; 0; 0; /* use first QADC unit */ 0; /* no calibration */ 0b0000; /* result queue 0 */ 0b10; /* sample time = 2 clks */ 0; 0; single_channel; 17 18 Conversion Result Format 12-bit conversion is stored in a 16-bit RFIFO as a signed or unsigned integer In either case, the result is stored in bits [2:13], i.e., bit shifted 2 left 19 Direct Memory Access (DMA) Recall We need to transfer ADC configuration and conversion commands from memory to CFIFO We need to transfer results from the RFIFO to memory This could take lots of time if CPU intervention is required 20 Direct Memory Access (DMA) Direct Memory Access (DMA) DMA services: peripheral requests (eQADC, for example) software initiated requests 21 Transfer Control Descriptor (TCD) used to define each channel (source and destination address, address increments, size etc..) See Chapter 9 in the Reference Manual, and Lab 3 document for description of DMA programming We have written the DMA code for Lab 3! Direct Memory Access (DMA) Function setupDMARequests continuously fills the CFIFO with commands from CONT_SCAN_QUEUE to read each ADC channel sequentially, and stores the results in CONT_SCAN_RESULTS System RAM DMA Ch0 Source Ch0 Destination Ch1 Source Ch1 Destination 22 eQADC CMD queue start: &CONT_SCAN_QUEUE[0] eQADC-A CMD queue end eQADC CMD FIFO CMD Word RSLT FIFO CMD Word eQADC Result queue start: &CONT_SCAN_RESULTS[0] eQADC Result queue end 23 Lab 3 Software As usual, you are given qadc.h with function prototypes; you will write the functions in qadc.c, plus application code in lab3.c Four functions (plus DMA) are required: qadcInit: Initialize the eQADC: Configure the conversion command queues Configure the ADC fillCCMTable: Build command conversion lists Single and continuous scan lists required qadcRead1 and qadcRead2: Read the results 24 Lab 3 Software qadcInit: configuring the conversion command queues Use the structure found in MPC553.h to access the MCR, CFIFO control registers and CFIFO push registers Clear the MCR and set up one queue for software-triggered single scan and one queue for software-triggered continuous scan Use the configuration command message structure to enable ADC0 and set the clock prescaler 25 Lab 3 ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Michigan - EECS - 461
Freescale Semiconductore200z6RM 6/2004 Rev. 0e200z6 PowerPCTM Core Reference Manual Freescale Semiconductor, Inc., 2004. All rights reserved.How to Reach Us:Home Page: www.freescale.com E-mail: support@freescale.com USA/Europe or Locations N
Brookdale - ECMM - 6010
Data & Database Management Systems (DBMS)1What is a DBMS ?Database a large, integrated collection of data Models a real-world enterpriseEntities (e.g. students, courses, instructors) Relationships (e.g. inkpen is teaching ECMM 6010) Da
Michigan - EECS - 461
1Lab 5: Interrupts, Timing, and Frequency Analysis of PWM Signals2Lab 5: Interrupts and Timing Thus far, we have not worried about time in our real-time code Almost all real-time code involves sampling (recall our discussion about sampling an
Michigan - EECS - 461
1Lab 6: Virtual Worlds with Haptic Feedback2Lab 6: Virtual Worlds We now have everything we need to build virtual systems: Input (quadrature decode using the eTPU) Output (PWM motor control using the eMIOS) Time (interrupt processing) Vir
Michigan - EECS - 461
<?xml version="1.0" encoding="UTF-8"?><Error><Code>InternalError</Code><Message>We encountered an internal error. Please try again.</Message><RequestId>6F4E8B761431FEE1</RequestId><HostId>kOFvsK7qgW38nnY2Jz0ce8LE5usX/kEav3D+DOt6m7oKmUusajCGVoNDVHqjS
Michigan - EECS - 461
1Lab 7: C t ll Area N t L b 7 Controller A Network k2Lab 7: Controller Area Network For a general description of CAN, see the document posted on the course website Lab 7 has two parts: Part 1: you will write a program that communicates with
Drake - ECON - 001
Principles of Macroeconomics (Econ 001) Drake University, Fall 2001 William M. BoalSignature: Printed name: ID number:MIDTERM EXAMINATION #3: Version B Long-Run Economic Growth and Inflation October 29, 2001INSTRUCTIONS: This exam is closed-book
Michigan - EECS - 461
EECS 461: Embedded Control Systems, Winter 2009CLASS TIME: 1:303:00 Monday and Wednesday LAB TIMES: Monday, 3:306:30; Tuesday, 1:304:30; Wednesday, 10:001:00; Thursday, 9:3012:30; Thursday, 1:304:30 PLACE: 1311 EECS (lecture), 4342 EECS Building (l
Drake - ECON - 173
Intermediate Microeconomic Analysis (Econ 173) Drake University, Spring 1997 William M. BoalSignature: Printed name: ID number:QUIZ #10: April 1, 1997INSTRUCTIONS: This quiz is closed-book, closed-notes, but calculators are permitted. Only answe
Bucknell - CHEM - 212
212-03 January 24, 2001Quiz 1Name:101) Provide a complete and correct synthesis of the molecule below using molecules containing three carbons or fewer. (5 points)(CH3)2CuLi Br 1) NaNH2 2) CH3CH2Br HBr Li/NH32) Provide the major product(s)
Bucknell - CHEM - 212
212-03 April 19, 2001Quiz 10Name:101) For the reactions below, provide the correct major product(s). Points will be deducted for repeat products. (4 points)1) NaH OO2) 3) H+HOO HOO O1) NaOCH3, CH3OH 2) H+OO2) For the rea
Bucknell - CHEM - 212
212-03 March 1, 2001Quiz 5Name:10(2 points)1) Provide the correct IUPAC name for the molecule below. 1OH Cl 3 2(S)-7-chloro-1-hepten-4-ol2) For the reactions below, provide the correct reagent(s).(4 points)Al(CH3)3,OTiCl4OnH
Michigan - EECS - 730
EECS 730K. SarabandiTheory of Wave Scattering from Rough Surfaces and Random Media EECS 730Prerequisite: EECS 530 3 credits Tuesday and Thursday 9:00-10:30 Room: EECS 3433 Instructor: Professor Kamal Sarabandi 3228 EECS Phone: 936-1575 saraband@
Michigan - EECS - 730
EECS 730Due Jan. 27, 2009Homework Set No. 1Problem 1: Prove the following vector-dyadic identities, where a and b are vectors and = = A and B are dyads. I. (a b) A= a (b A) = b (a A) II. (A a) b =A (a b) = (A b) a III. (a A) b = a (A b)
Michigan - EECS - 730
EECS 730Homework Set No. 2Problem 1: In Section 2.1 of the handout entitled "Dyadic Green's Function," complete the steps that lead to (45). Problem 2: (WKB approximation) Consider an inhomogeneous medium with permittivity function (r) = (z). a) D
Michigan - EECS - 730
EECS 730, Winter 2009Due February 12, 2009Homework No. 31. Verify the equations provided in your class notes and calculate the coefficient of scattered Bragg modes generated from a sinusoidal surface given by f (x) = 0.5 cos(x) when illuminated
Michigan - EECS - 730
EECS 730, Winter 2009Due Tuesday, March 3, 2009Homework #41. In your notes on "Statistics of Scattered Fields from Random Media," derive equations (29), (32), and (45). 2. Find the pdf of the second element of Stokes' vector |Ev |2 - |Eh |2 assu
Michigan - EECS - 730
EECS 730, Winter 2009Due Tuesday, March 10, 2009Homework #50 0 1. Using expressions for vv , and hh on pages 26 and 27 of small perturbation, derive the parameters of the pdf of phase difference between Svv and Shh . 0 0 2. Plot vv and hh in bac
Michigan - EECS - 730
EECS 730, Winter 2009Due Tuesday, March 17, 2009Homework #61. Using Born approximation derive the rst-order bistatic scattering coecient of a slab of random medium with a small permittivity uctuations above a ho2 = 0.10 , mogeneous slab. Suppos
Michigan - EECS - 730
EECS 730Due Thursday, March 26, 2009Homework Set No. 7Problems from Theory of Microwave Remote Sensing, by L. Tsang, A. J. Kong, and R.T. Shin. Problems 5.18 and 5.19, pages 419-422. 5.18 Assume a mixture of two constituents. One constituent is
Michigan - EECS - 730
EECS 730, Winter 2009K. SarabandiDyadic Analysis1In this section a brief review of dyadic analysis is presented. Dyadic operations and theorems provide an eective tool for manipulation of eld quantities. 2 Dyadic notation was rst introduced by G
Michigan - EECS - 730
EECS 730 Winter 2009c K. SarabandiDyadic Greens FunctionAs mentioned earlier the applications of dyadic analysis facilitates simple manipulation of eld vector calculations. The source of electromagnetic elds is the electric current which is a ve
Michigan - EECS - 730
EECS 730 Winter 2009c K. SarabandiDyadic Green's Function for Stratified MediaLayered dielectric media is encountered in many electromagnetic problems such as analysis of multi-layered substrate/superstrate microwave circuits and printed anten
Michigan - EECS - 730
EECS 730 Winter 2009K. SarabandiEwald-Oseen Extinction Theorem1Integral equation methods are often used to formulate the electromagnetic scattering problems for which the standard method of separation of variables is not applicable. In general f
Michigan - EECS - 730
EECS 730, Winter 2009K. SarabandiScattering from Periodic Surfaces1Periodic surfaces are encountered in many active and passive microwave remote sensing application such as evaluation of scattering and emission from plowed eld or rough water sur
Michigan - EECS - 730
EECS 730, Winter 2009K. SarabandiScattering from Two-dimensional Inhomogeneous Periodic Dielectric Layer above a Stratified Dielectric Medium 1Problem of scattering from periodic surfaces can be viewed, in the most general configuration, as the
Michigan - EECS - 730
EECS 730, Winter 2009c K. SarabandiStatistics of Scattered Fields From Random MediaFrom electromagnetic scattering point of view a random medium is referred to an inhomogeneous medium where the permittivity and/or permeability of the medium are
Michigan - EECS - 730
EECS 730, Winter 2009c K. SarabandiElectromagnetic Scattering By Random Rough SurfacesThe problem of electromagnetic scattering from random rough surfaces has been the subject of intense investigation over the past several decades for its applic
Michigan - EECS - 730
EECS 730, Winter 2009K. SarabandiScattering of Electromagnetic Waves in Random Media11 IntroductionThe problem of wave scattering from a random volume is of interest in may remote sensing problems. For example, a layer of snow above ground con
Washington - ESS - 203
Direction of water flowFigure 1. Cross BeddingVashon Till Puget Lobe Proglacial lake : Outwash Esperance Sand Lawton: Proglacial lake sediments Olympia Formation: Non-glacial sediments North SouthFigure 2. Cross-section of sediments associated
Michigan - EECS - 730
EECS 730, Winter 2009c K. SarabandiGreen's Function for Tenuous Random MediaIn the previous section we demonstrated the application of wave theory to a tenuous medium excited by a plane wave for evaluating the bistatic scattered fields. In certa