Unformatted text preview:

EE451L Fall 2009 ______________________________________________________________________________ EE 451 – LAB 2 Data Acquisition This laboratory will introduce you to the I/O capabilities of the DKS board: • Learn how to input and output signals through the AIC23. Introduction The DSK board includes a C6713 floating-point digital signal processor and a 16-bit stereo codec (coding of analog waveforms as digital signals and decoding of digital signals as analog waveforms) TLV320AIC23 (AIC23) for analog input and output. The onboard codec AIC23 provides analog-to digital conversion (ADC) and digital-to-analog conversion (DAC) functions. It uses a 12-MHz system clock and its sampling rate can be selected from a wide range of settings from 8 – 96 kHz (48 kHz is the default sampling frequency). The coder converts analog signals into a sequence of sample values (16-bit signed integers), and the decoder reconstructs an analog signal from a sequence of samples values (16-bit signed integers). Communication with the AIC23 is carried over two multichannel buffered serial ports (MCBSPs): the MCBSP0 is used as unidirectional channel to send a 16-bit control word to the AIC23, the MCBSP1 is used a bidirectional channel to send and receive audio data. Four connectors on the board provide input and output capabilities: • MIC IN for microphone input. • LINE IN for line input. • LINE OUT for line output. • HEADPHONE for headphone output (multiplexed with line output). In addition, four user DIP switches on the DSK board can be read from within a program running to provide the user with a feedback control interface. Also, the states of four LEDs can be controlled from within a program running on the DSP. The maximum allowable input signal level at the LINE IN is 1 Vrms. However, the C6713 has a potential divider circuit with a gain of 0.5 which allows for a maximum of 2 Vrms. Above this level, input signals will be distorted.EE451L Fall 2009 ______________________________________________________________________________ The Lab Create a program that accepts a signal through the LINE IN of the AIC23 codec, and outputs it through the LINE OUT. Part 1 1. Start CCS and begin a new project. You may use the same program template you used in the previous laboratory to read in and write out a signal. 2. Set the function generator to output a sinusoidal signal with amplitude of 500 mV and frequency of 1 kHz. Then connect the function generator to the LINE IN of the board. 3. Set the sampling frequency to 48 kHz (DSK6713_AIC23_FREQ_48KHZ). 4. Connect an oscilloscope to the LINE OUT of the board. 5. Record and plot the magnitude of the output signal as you vary the frequency from 1 kHz to 48 kHz. Explain what you are recording. 6. Now change the sampling frequency to 8 kHz. Vary the frequency and record your observations. Part 2 1. The MCBSP_read( ) function performs a direct 32–bit read of the data receive register DRR (two channels 16-bits long are read at the same time). The first channel corresponds to the left channel and the second to the right one. The MCBSP_write() writes the first 16-bits (left channel). 2. Change the sampling frequency to 48 kHz and modify your code to output only every 4th sample. Vary the frequency and record your observations. What process are you simulating with this change in your program? 3. Modify your code to read the signal from the function generator and output this signal to both channels. Hint: You may use the HEADPHONE output. Figure 1 depicts a template which can be used for Lab 2. A description of the audio connectors can be found in the TMS320C6713 DSK Technical Reference. Figure 2 briefly describes the four audio connectors which can be used with this board.EE451L Fall 2009 ______________________________________________________________________________ //========= Lab2.c ========= // This program patches through a signal from the LINE IN input // #include "dsk6713.h" #include "dsk6713_aic23.h" // codec support #include "dsk6713config.h" #include <stdio.h> Uint32 fs = DSK6713_AIC23_FREQ_48KHZ; // set sampling rate #define DSK6713_AIC23_INPUT_MIC 0x0015 #define DSK6713_AIC23_INPUT_LINE 0x0011 Uint16 inputsource=DSK6713_AIC23_INPUT_LINE; // select LINE IN input int i; void main() { DSK6713_init(); // call BSL to init DSK-EMIF,PLL) hAIC23_handle=DSK6713_AIC23_openCodec(0, &config); // handle(pointer) to codec DSK6713_AIC23_setFreq(hAIC23_handle, fs); // set sample rate DSK6713_AIC23_rset(hAIC23_handle, 0x0004, inputsource); // choose mic or line in MCBSP_config(DSK6713_AIC23_DATAHANDLE,&AIC23CfgData); // interface 32 bits to AIC23 MCBSP_start(DSK6713_AIC23_DATAHANDLE, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); // start data channel while(1) //infinite loop { while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to receive Read data =MCBSP_read(DSK6713_AIC23_DATAHANDLE); //read into left channel while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE)); // wait for ready to transmit MCBSP_write(DSK6713_AIC23_DATAHANDLE, Output data); // output left channel } } Figure 1. Program template for Lab 2. Figure 2. The C6713 audio


View Full Document

NMT EE 451L - EE 451 – LAB 2

Download EE 451 – LAB 2
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 EE 451 – LAB 2 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 EE 451 – LAB 2 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?