0% found this document useful (0 votes)
63 views

Lab Report # 13: "Overview and Working On DSP Stater Kit DSK C6713"

The document is a lab report that summarizes a code written for a DSP starter kit to generate an 8 point sine wave using DIP switch control. The code is explained line by line. It initializes the DSK, codec, and LED/DIP switches. An infinite loop continuously checks the state of DIP switch 0, outputs samples from a sine table if it's pressed, and resets the index when it reaches 8. This causes a 1 kHz sine wave to be generated at the LINE OUT and HEADPHONE sockets when DIP 0 is held down. To operate the DSP kit, one must load the program, run it in debug mode, and verify the 1 kHz sine wave output on an oscilloscope or

Uploaded by

danyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Lab Report # 13: "Overview and Working On DSP Stater Kit DSK C6713"

The document is a lab report that summarizes a code written for a DSP starter kit to generate an 8 point sine wave using DIP switch control. The code is explained line by line. It initializes the DSK, codec, and LED/DIP switches. An infinite loop continuously checks the state of DIP switch 0, outputs samples from a sine table if it's pressed, and resets the index when it reaches 8. This causes a 1 kHz sine wave to be generated at the LINE OUT and HEADPHONE sockets when DIP 0 is held down. To operate the DSP kit, one must load the program, run it in debug mode, and verify the 1 kHz sine wave output on an oscilloscope or

Uploaded by

danyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

EEE324 – Digital Signal Processing

Lab Report # 13
“Overview and working on DSP Stater kit DSK C6713”

Name Danyal Nasir Reg # FA19-BEE-118

Class & Section BEE-5C Semester FA-21


Performed Date 12 28 2021 Submitted Date 01 01 2022

Task:
Sketch a code for Sine Wave Generation Using Eight Points with DIP Switch Control (sine8_LED)
using Code Composer Studio (CCS) for DSK C6713 kit. Elaborate the working of each
line/segment of this code and explain that how DSP C6713 kit will be operated using this code?

Solution:
Following is the code and its explanation of code as well as working of dsp kit.
Code:
#include "dsk6713_aic23.h" //codec support
Uint32 fs = DSK6713_AIC23_FREQ_8KHZ; //set sampling rate #define
DSK6713_AIC23_INPUT_MIC 0x0015
#define DSK6713_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6713_AIC23_INPUT_MIC; //select input #define LOOPLENGTH 8
short loopindex = 0; //table index short gain = 10; //gain factor
short sine_table[LOOPLENGTH]= {0,707,1000,707,0,-707,-1000,-707}; //sine values void main()
{
comm_poll(); //init DSK,codec,McBSP DSK6713_LED_init(); //init LED from BSL
DSK6713_DIP_init(); //init DIP from BSL while(1) //infinite loop
{
if(DSK6713_DIP_get(0)==0) //if DIP #0 pressed
{
DSK6713_LED_on(); //turn LED #0 ON

1|Page Department of Electrical & Computer Engineering | CUI Wah


EEE324 – Digital Signal Processing

output_left_sample(sine_table[loopindex++]*gain); //output if (loopindex >= LOOPLENGTH)


loopindex = 0; //reset index
}
else DSK6713_LED_off(0); //else turn LED #0 OFF

} //end of while(1)
} //end of main

Explanation of code:
An array, sine table , of eight 16 -bit signed integers is declared and initialized to contain
eight samples of exactly one cycle of a sinusoid. The value of sine table[i] is equal to Within
function main() , calls to functions comm_poll() , DSK6713_LED_init() ,and DSK6713_DIP_init()
initialize the DSK, the AIC23 codec onboard the DSK,and the two multichannel buffered
serial ports (McBSPs) on the C6713 processor. Function comm_poll() is defined in the file
c6713dskinit.c , and functionsDSK6713_LED_init() and DSK6713_DIP_init() are supplied in
the board support library (BSL) fi le dsk6713bsl.lib.The program statement while(1) within
the function main() creates an infinite loop. Within that loop, the state of DIP switch #0 is
tested and if it is pressed down, LED #0 is switched on and a sample from the lookup table is
output. If DIP switch#0 is not pressed down then LED #0 is switched off. As long as DIP switch
#0 ispressed down, sample values read from the array sine table will be output and a sinusoidal
analog output waveform will be generated via the left -hand channel of the AIC23 codec and
the LINE OUT and HEADPHONE sockets. Each time a sample value is read from the array
sine_table , multiplied by the value ofthe variable gain , and written to the codec, the index,
loop index , into the arrayis incremented and when its value exceeds the allowable range for
the array( LOOPLENGTH -1 ), it is reset to zero.
Each time the function output_left_sample() , defined in source fileC6713dskinit.c , is
called to output a sample value, it waits until the codec, initializedby the function comm_poll()
to output samples at a rate of 8 kHz, is ready forthe next sample. In this way, once DIP switch
#0 has been pressed down it will betested at a rate of 8 kHz. The sampling rate at which the
codec operates is set bythe program statementUint32 fs = DSK6713_AIC23_FREQ_8KHZ;One
cycle of the sinusoidal analog output waveform corresponds to eight outputsamples and
hence the frequency of the sinusoidal analog output waveform is equal to the codec sampling
rate (8 kHz) divided by eight, that is, 1 kHz

2|Page Department of Electrical & Computer Engineering | CUI Wah


EEE324 – Digital Signal Processing

How DSP C6713 kit will be operated:


Load Program in order to load sine8_LED.out . It should bestored in the folder
c:\CCStudio_v3.1\MyProjects\sine8_LED\Debug . SelectDebug→ Run . In order to verify that a
sinusoidal output waveform with a frequency of 1 kHz is present at both the LINE OUT
and HEADPHONE sockets on the DSK, when DIP switch #0 is pressed down, use an
oscilloscope connected to the LINE OUT socket and a pair of headphones connected to the
HEADPHONE socket.

3|Page Department of Electrical & Computer Engineering | CUI Wah

You might also like