DSP Lab 5 Handout
DSP Lab 5 Handout
DSP Lab 5 Handout
Islamabad
Name: __________________________________________
Remarks: _________________________________________
Instructor’s Signature:_______________________________
Digital Signal Processing LAB
In this layout, the Central Processing Unit (CPU) is the basic logical structure that accomplishes instructions
given by the program. Arithmetic Logic Unit (ALU) is the logical structure that accomplishes arithmetic
operations like addition and subtraction. Memory is the structure that the data and the program are stored
in. Common microprocessors do not have very large memory space inside the chip. Therefore, the main
data and program is stored outside the microprocessor. Instruction registers are small memory blocks. They
handle processes that the CPU can execute. The program sets the instruction registers in an order to execute
each process required one at a time. The size of the instruction register defines the bit processing capability
of the microprocessor. For example if the size of the register is 32-bit, then it is a 32-bit processor. Data
registers are small memory blocks used by the CPU to store the data. Data and address busses are the
highways that the data and instructions flow over. They also connect the CPU and the external peripheral
units.
Microprocessors need regulated DC power supply in order to work. Typical processors work with 5V DC
supply. As the silicon technology improves, these devices started working with lower power ratings.
Therefore, nowadays there are processors working with 3.3V, 1.8V or lower DC voltage values.
Clock is the synchronization pulse of the processor. Instructions are executed in one or more clock pulses.
Clock also provides the synchronization between the processing units of the processor. The speed of the
processor is related to the clock pulse. The processor speeds are categorized in Million Instructions per
Second (MIPS). This means how many instructions are processed in a second.
Reset circuitry is the most important part of a microprocessor system. If the microprocessor is locked in an
unexpected infinite loop, the only way to recover the system is to apply reset to the processor. Reset brings
the processor to the initial state that is defined in the reset vector inside processor’s memory.
Microcontrollers may contain all or some of the peripherals according to their usage area. For example, to
process an audio or a video signal, the microcontroller with an Analog to Digital Converter (ADC) and
Digital to Analog Converter (DAC) is needed. Serial Peripheral Interface (SPI), RS232 Serial
Communication Interface (SCI), I2C (two wire communication protocol) or JTAG (A fast real-time
communication protocol) interfaces will be needed to communicate with another processor or computer.
The setup and usage of these peripheral devices are arranged by the control, status, and data registers. For
example, to define the sampling rate of the ADC, the necessary bits in the ADC control register are set.
After selecting operating mode CCS will restart and following window will appear.
3. Go to PROJECT and click on NEW to create a new project following window will appear.
4. Then go to PROJECT and click on ADD FILES TO THE PROJECT and select C6713dsk.cmd file
(provided with software or easily downloadable from internet).
5. Following same procedure add one more file from “C:\CCStudio_v3.3\C6000\cgtools\lib” named
rts6700.lib
6. Now add source file (programmed in C). To add source file go to FILE click on NEW and then
select SOURCE FILE from the list. Now a window will appear, write your C code in that window
and save source file (e.g. anyname.c).
7. Add this saved source file to the project following same procedure for adding files to the project.
8. Now go to PROJECT and click on BUILD. If there are no errors (warnings can be ignored) message
will appear BUILD COMPLETE.
9. This process will create file named “anyname.out” in directory where project was saved. To load
this file Go to FILE then click on LOAD PROGRAM go to DEBUG folder in project’s directory
open file with “.out” extension.
10. This process will load project on to the Simulator/Kit. Now go to DEBUG and click on RUN.
Output of the program can be seen in CCS window.
If you are working on more than one projects or running a project more than once then you should follow
following steps before running
11. Go to DEBUG click on RESET CPU then after resetting CPU go to DEBUG and click on
RESTART and then again go to DEBUG and click on GO MAIN. Now you can run it by clicking
RUN in DEBUG.
You can see the values and changes in the watch window at the bottom right of the CCS V3.3 screen.
Following these steps to run this program > Build > Load Program > Run > Following will be the
output.
You should also add the "dsk6713bsl.lib" file which is under "C:\code composer studio setup folder
\C6000\dsk6713\lib" by “Add Files to Project”
Now, we are ready to reach DIP switches and LEDs on the C6713 DSK. The following code is an
example of DIP switch and LED application.
/***********************************************************/
/* Read the status of the DIP switches and control LEDs*/
/***********************************************************/
/* All header files starting with dsk6713 belong to the board support library
*/
#include<dsk6713.h> /* General functions */
#include<dsk6713_dip.h> /* Functions for DIP */
#include<dsk6713_led.h> /* Functions for LED */
void main()
{
DSK6713_init();
DSK6713_DIP_init();/*Initialize DIP switches */
DSK6713_LED_init(); /*Initialize LEDs*/
while(1){
/*DSK6713_DIP_get(‘switch number’); Retrieve the DIP switch value */
if(DSK6713_DIP_get(1)==1){
/* DSK6713_LED_on(‘LED number’); Set the LED */
DSK6713_LED_on(1);
}else{
/* DSK6713_LED_off(‘LED number’); Clear the LED */
DSK6713_LED_off(1);
}
}
}