DOC PREVIEW
UF EEL 4744 - Lab #9: A/D & D/A Conversion

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

University of Florida EEL 4744 Department of Electrical and Computer Engineering Page 1/2 Lab #9: A/D & D/A Conversion Purpose The purpose of this lab is to become familiar with Analog to Digital and Digital to Analog conversion techniques and hardware. We will first use the 68HC12's onboard A/D converter to build a simple voltage level display with the LED bar display we added early in the semester. Next, we will add on a latch and DAC0800 device to play out waveforms stored in memory. The playback sampling rate will be controlled via an Output Compare interrupt and in essence we will be creating a simple digital sound synthesizer. Part I. Using an A/D to Create a Simple Multi-meter The first step in being prepared for this lab is to read the documentation associated with the 68HC12's onboard A/D converter in our text book and manuals. Upon completion of these readings: 1. Connect a potentiometer to any open channel other than AN0 on your 6812 as shown below. X = 1 to 7 ANx is any analog input other than AN0. 2. In software, capture the analog voltage on the center tap of the pot and convert the 8 bit binary value to a voltage. 3. Display the voltage on your LCD as a decimal or hex number and as volts as shown below: ADC = 7F V = 2.5 The voltage should have 0.1v accuracy. 4. Repeat steps #2 & #3 in a loop forever. Testing Connect a small hand held multi-meter between the ANx pin and ground. Monitor the voltage on the hand held meter with that shown on your LCD as you alter the voltage going to ANx with the pot screw. Verify they track one another reasonably closely. Part II. Interfacing a D/A Converter A DAC0800 A/D converter will now be added to our system. However because this device cannot latch data, we will first need to add a latch to our design such that the latch output will be used to drive the DAC0800 data lines. Please follow the instructions below: 1. Add a second 74HC574 latch to drive the data lines on a DAC0800. Memory Map it any open area with 2^10 images. Choose an open area that has not a duplicate of your classmates. 2. Obtain and read the DAC0800/0802 data sheet from National Semiconductor's web site. 3. Wire in the DAC0800 as shown below. Note: -9V can be -6V, generate this via a battery with the pos. terminal tied to GND and the neg. terminal as -V. 6812 ANx GND +5V Pot included in your kit of parts. Center pin is connected to 6812 ANx. D7 D6 D5 D4 D3 D2 D1 D0 VLC Comp 5 6 7 8 9 10 11 12 1 16 574 Latch Output7:0 0.1uF +V -V +Vref -Vref +Iout -Iout 13 3 14 15 4 +IOUT 2 +5V - 9V 10K 10K +5V -9VUniversity of Florida EEL 4744 Department of Electrical and Computer Engineering Page 2/2 Lab #9: A/D & D/A Conversion 4. Run the output of the DAC0800 (+IOUT) to the current to voltage converter opAmp circuit shown below. The second stage is a simple gain stage that increases the output span of the first opAmp current to voltage stage by a factor of two. Note: You can use two 10K resistors in parallel to create a 5K resistor required above. 5. Try writing out $FF to your latch. Attach a meter between "OUT" and ground and record the voltage. Now write a $0 to the latch and record the voltage value. Next, write an $80 to the latch and verify that this voltage is in-between the two earlier measurements. All voltage measurements should be between 0 to -4V. Check other digital values ($40, $C0, etc.) and verify these produce a voltage output that is linear when compared to the previous measurements. 6. Once the DAC is functioning properly, connect your speaker to the output as shown below. This is a DC blocking circuit that only passes AC frequencies to the speaker. This prevents speaker damage. 7. Write software to set up an Output Compare channel to generate an interrupt at 18K Hz. 8. Write an OC ISR to send out a sample from a table of data (20 samples deep) that corresponds to a triangle wave. Note1: You should use the assembler directives to create this table in memory. Questions: What are the 20 digital values that comprise the triangle waveform table? What is the actual frequency of the triangle wave we are generating? 9. Upon running the code, you should be able to hear the triangle wave played out of your speaker. Part III. Frequency Control via Pot & A/D The hardware section of this lab is not complete and hopefully functional. The goal now is to simply use the Pot connected to the A/D to control the frequency of the triangle waveform played out. 1. In your OC ISR read the A/D (Pot voltage). 2. Use the A/D value to set the frequency of the OC interrupt such that a maximum A/D value equates to an OC interrupt rate of 30KHz and a minimum (zero) A/D value equates to an OC interrupt of 3K Hz. All other A/D values should correspond to frequencies linearly divided in-between 3-30K Hz. 3. When you tweak the pot, you now should be able to sweep the frequency of the triangle wave being played out. This is a digital sound synthesizer and if we played notes (i.e. using the key pad) at the proper frequencies, we would have an elementary digital music synthesizer. Pre-Lab Requirements for Part I, II, and III Show your TA your error-free assembly code programs created for each of three parts. (20%) In-Lab Requirements for Parts I, II and III Demonstrate your three programs to your TA and answer your TA’s questions. (80%) Warning: If you blow up your NE5532 OpAmp, you will have to get another dual OpAmp from in town or on the web. Be careful when wiring this part. Extra Credit: Up to 15% of this lab will be added to your lab score if you can: Store 5 different songs in external SRAM memory and select/play them using your keypad. No student should have the same set of songs. + - 3 2 1 +IOUT 8 4 +5V - 9V + - 5 6 7 10K 5K OUT 10K 1uF OUT


View Full Document

UF EEL 4744 - Lab #9: A/D & D/A Conversion

Download Lab #9: A/D & D/A Conversion
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab #9: A/D & D/A Conversion and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab #9: A/D & D/A Conversion 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?