Professional Documents
Culture Documents
Session 2
Air University
Todays Agenda
Structure of Code Composer Studio Building a Project in CCS Some useful information on CCS
Structure of Code Composer The most important components of CCS are Studio
Editor Compiler Assembler Linker Debugger Config tool Analyze and Tune Tool
When you build a project, CCS compiles your source code files written in C and generates corresponding ASM files. Then Assembler generates object files. Finally Linker generates a single executable file. During these operations, in addition to the source code files, CCS may require the following files.
Library Files (e.g. rts6700.lib) Header files (e.g. stdio.h) Interrupt vectors table file (vectors.asm) Linker command file (e.g. Lab1.CMD)
/* Memory Map 0 - the default */ MEMORY { PMEM: o = 00000000h l = 00010000h BMEM: o = 00010000h l = 00030000h } SECTIONS { .text > PMEM .csldata > PMEM .stack > PMEM .far > PMEM .switch > BMEM
Some useful information on You can CCS configure CCS to load the executable file
automatically after a successful build. Select Option:Customize menu item. Navigate to the Program/Project Load options tab and click Load Program After Build. Click OK.
Some useful information on Working with multiple projects CCS open multiple projects, only one of them will be active. If you
When you invoke the build operation, the active project will be compiled, linked, loaded and run.
Build Configurations
Primarily you have two build configurations available; DEBUG and RELEASE. DEBUG option allows you to debug your program from within CCS but it reduces speed and increases code size. RELEASE option eliminates any debug information from the generated code, increases speed and reduces code size.
Help on CCS
For online help select Help : Contents menu item and you will see a list of help material including User manuals, Tutorials, DSP knowledge base, etc. If you have access to internet, you can visit DSP knowledge base on TIs website. This knowledge base answers many of your problems regarding DSP, CCS, etc. In the knowledge base search window, enter your query and you will see a list of possible answers. If you dont find the solution of your problem, you may send an email to TI.
McBSP on C6713
Most of TI DSPs have built-in mult-channel buffered serial port (McBSP). It is similar to a computer serial port, with some additional features. In C6713, McBSP has two serial channels called McBSP0 and McBSP1. On DSK6713, McBSP1 is connected to a codec (coder-decoder). The codec has an Analog-to-Digital Coveter (ADC) and a Digitalto-Analog Converter (DAC). With this McBSP1 to codec connection, DSP can send/receive digital data to/from codec. In todays lab, we will use DAC portion of codec, therefore we will send digital data to codec.
Codec TLV320AIC23
This is a 16-bit audio codec that converts an analog signal to digital data and vice versa at sampling rates ranging from 8 kHz to 96 kHz. When used as a DAC, it receives a 16-bit digital sample from DSP thru McBSP1 and generates equivalent analog value. If the sampling rate is 8 kHz, it will receive 8000 digital samples per second and generate their equivalent analog values. In this case any two consecutive samples will be 125 us apart. After every 125 us, it generates an interrupt for DSP. In response the DSP sends next digital sample and so on.
C6713
Codec
Analog
Hardware Interrupts
An interrupt generated by a hardware module may be termed as hardware interrupt (HWI). In CCS, for each HWI, an interrupt service routine (ISR) is defined. ISR is a function written in a source code file, which executes at the occurrence of the corresponding HWI.
16 interrupt sources (timers, serial ports, ) 12 interrupt events (INT4 to INT15) are available to user INT0 to INT3 are reserved Interrupt events must be mapped to interrupt sources Interrupt vectors must be set up. An interrupt vector is a special pointer to the start of the interrupt service routine (ISR). There are 12 interrupt vectors. Timer0 interrupt Timer1 interrupt McbSP0 interrupt . ......... DMA interrupt
Interrupt sources
1 2 3 16
Codec
ISR
Interrupt
Digital value sent to codec must be 16-bit long. The 16-bit word can take values -32768 to 32767. Each value sent to codec converts into a voltage level in the range +Vmax and Vmax.