ICETEK-VC5416-C_v1

所属分类:DSP编程
开发工具:C/C++
文件大小:1562KB
下载次数:143
上传日期:2007-11-02 11:20:16
上 传 者bighigh
说明:  北京瑞泰创新公司的ICETEK-VC5416-C开发板的实验源代码,包括LED,串口通信,Flash烧写等等,对初学DSP人员很有参考价值。
(Beijing Ruitai innovative company ICETEK-VC5416-C development board experiment source code, including the LED, serial communication, Flash programmer, etc., on the beginner DSP valuable staff.)

文件列表:
ICETEK-VC5416-C v1\ICETEK-VC5416-C使用说明书.pdf (1043995, 2004-06-01)
ICETEK-VC5416-C v1\uart\cc_build_Debug.log (135, 2003-11-18)
ICETEK-VC5416-C v1\uart\Debug.lkf (238, 2003-11-16)
ICETEK-VC5416-C v1\uart\Debug.lkv (238, 2003-11-16)
ICETEK-VC5416-C v1\uart\EmulatorResetTemp.wks (797, 2003-11-05)
ICETEK-VC5416-C v1\uart\uart.c (1009, 2003-11-16)
ICETEK-VC5416-C v1\uart\uart.cmd (279, 2003-06-20)
ICETEK-VC5416-C v1\uart\uart.paf (842, 2003-11-18)
ICETEK-VC5416-C v1\uart\uart.pjt (763, 2003-11-04)
ICETEK-VC5416-C v1\uart\Debug (0, 2007-07-21)
ICETEK-VC5416-C v1\uart (0, 2007-07-21)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x.exe (79404, 2003-11-18)
ICETEK-VC5416-C v1\PCM3002_driver\ITK54x.gel (321, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\PCM3002_driver.exe (60362, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\c5416regs.h (9321, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\cc_build_Debug.log (316, 2003-11-18)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Codec_54x.c (197, 2003-11-17)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Codec_54x.cmd (455, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Codec_54x.map (4482, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Codec_54x.paf (2501, 2003-11-17)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Codec_54x.pjt (930, 2003-11-04)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\const.h (329, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Debug.lkf (473, 2003-11-18)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Debug.lkv (473, 2003-11-18)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\func.h (365, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\hex.cmd (132, 2003-09-17)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\HEXBIN.EXE (13471, 1993-08-17)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\intr.c (386, 2003-11-17)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\myApp.h (265, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\pcm3002.h (141, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Peripherals.h (21, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\util.c (2246, 2003-11-18)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\vars.h (35, 2003-08-26)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\vectors.asm (1983, 2003-08-23)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x\Debug (0, 2007-07-21)
ICETEK-VC5416-C v1\PCM3002_driver\Codec_54x (0, 2007-07-21)
ICETEK-VC5416-C v1\PCM3002_driver (0, 2007-07-21)
ICETEK-VC5416-C v1\led7-audio\c5416regs.h (9321, 2003-08-23)
ICETEK-VC5416-C v1\led7-audio\cc_build_Debug.log (802, 2003-11-19)
ICETEK-VC5416-C v1\led7-audio\Codec_54x.c (197, 2003-11-04)
... ...

TMS320VC5402 DSK CODEC EXAMPLE ============================== The codec example demonstrates a few of the TMS320C5402 DSK features with Code Composer Studio. Note that this example was run with external SRAM activated. The codec example demonstrates the use of the Handset CODEC (mic/ speaker interface) on the DSK utilizing the drivers provided in the DSK library, dsk5402.lib. This example sets up the codec with the parameters below and performs a digital loopback by polling for input samples (mic) and writing them to the codec (speaker). The example requirements are: microphone or other audio input (e.g., cd player) connected to the MIC socket, and a speaker connected to the SPKR socket on the DSK board. Codec Parameters Used: Sampling Rate: 16KHz Analog input gain: 6dB ADC mode: 15-bits Analog output gain: -6dB DAC mode: 15-bits Getting Started =============== The following instructions enable you to build and run the codec example. You do not have to create and build a project. If you prefer to see a quick demo, you can open CCS and load the file c:\ti\c5400\dsk\examples\dsp\codec\codec.out. 1.1 Creating a New Project =========================== 1) If you installed Code Composer Studio in c:\ti, create a folder called codec in the c:\ti\myprojects folder. (If you installed elsewhere, create a folder within the myprojects folder in the location where you installed.) 2) Copy two source files from the c:\ti\c5400\dsk\examples\dsp\ codec\{codec.c, codec.cmd} folder. 3) Copy three library files to your new folder. Two library files are in the c:\ti\c5400\dsk\lib\{drv5402.lib,dsk5402.lib} folder and the third library file is in c:\ti\c5400\cgtools\lib\rts.lib folder. 4) From the Windows Start menu, choose Programs->Code Composer Studio 'C5000->CCStudio. (Or, double-click the Code Composer Studio icon on your desktop.) Note: Code Composer Studio Setup If you get an error message the first time you try to start Code Composer Studio, make sure you run Code Composer Setup after installing Code Composer Studio following the Quick Start Guide. 5) Choose the Project->New menu item. 6) In the Save New Project As window, select the working folder you created and click Open. Type codec as the filename and click Save. Code Composer Studio creates a project file called codec.mak. This file stores your project settings and references the various files used by your project. 1.2 Adding Files to a Project ============================= 1) Choose Project->Add Files to Project. Select codec.c and click Open. 2) Choose Project->Add Files to Project. Select Linker Command File (*.cmd) in the Files of type box. Select codec.cmd and click Open. This file maps sections to memory. 3) Choose Project->Add Files to Project. Select Object and Library Files (*.o*, *.lib) in the files of type box. Select drv5402.lib and click Open. Repeat this procedure for dsk5402.lib and rts.lib. 4) Expand the Project list by clicking the + signs next to Project, codec.mak, Libraries, and Source. This list is called the Project View. Note: Opening Project View If you do not see the Project View, choose View->Project. Click the File icon at the bottom of the Project View if the Bookmarks icon is selected. 1.3 Changing Project Build Options ================================== 1) Choose Project->Options. Click the Compiler Tab in the Include Search Path. Type in c:\ti\c5400\dsk\include. Click 'OK'. This will enable the appropriate board.h and type.h files to be included. When building the program, Code Composer Studio finds files by searching for project files in the following path order: o The folder that contains the source file. o The folders listed in the Include Search Path for the compiler or assembler options (from left to right). o The folders listed in the definitions of the C54X_C_DIR (compiler) and C54X_A_DIR (assembler) environment variables (from left to right). The C54X_C_DIR environment variable defined by the installation points to the folder that contains the rts.lib file. 1.4 Reviewing the Code ====================== 1) Double-click on the codec.c file in the Project View. You see the source code in the right half of the window. 2) You may want to make the window larger so that you can see more of the source code at once. You can also choose a smaller font for this window by choosing Option->Font. /*****************************************************************************/ /* Codec.c */ /* */ /* Digital Loopback example */ /* */ /*****************************************************************************/ #include #include #include #include /*****************************************************************************/ /* Function Prototypes */ /*****************************************************************************/ /* This delay routine does not conflict with DSP/BIOS. It is used in this */ /* example rather than brd_delay_msec which causes DSP/BIOS conflicts just */ /* because of this. If you are not using DSP/BIOS, you can change the code */ /* to use brd_delay_msec. */ void delay(s16 period); /*****************************************************************************/ /* Global Variables */ /*****************************************************************************/ HANDLE hHandset; s16 data; /*****************************************************************************/ /* MAIN */ /*****************************************************************************/ void main() { s16 cnt=2; if (brd_init(100)) return; /* blink the leds a couple times */ while ( cnt-- ) { brd_led_toggle(BRD_LED0); /* brd_delay_msec(1000); */ delay(1000); brd_led_toggle(BRD_LED1); /* brd_delay_msec(1000); */ delay(1000); brd_led_toggle(BRD_LED2); /* brd_delay_msec(1000); */ delay(1000); } /* Open Handset Codec */ hHandset = codec_open(HANDSET_CODEC); /* Acquire handle to codec */ /* Set codec parameters */ codec_dac_mode(hHandset, CODEC_DAC_15BIT); /* DAC in 15-bit mode */ codec_adc_mode(hHandset, CODEC_ADC_15BIT); /* ADC in 15-bit mode */ codec_ain_gain(hHandset, CODEC_AIN_6dB); /* 6dB gain on analog input to ADC */ codec_aout_gain(hHandset, CODEC_AOUT_MINUS_6dB); /* -6dB gain on analog output from DAC */ codec_sample_rate(hHandset,SR_16000); /* 16KHz sampling rate */ /* Polling and digital loopback */ while (1) { /* Wait for sample from handset */ while (!MCBSP_RRDY(HANDSET_CODEC)) {}; /* Read sample from and write back to handset codec */ data = *(volatile u16*)DRR1_ADDR(HANDSET_CODEC); *(volatile u16*)DXR1_ADDR(HANDSET_CODEC) = data; } } void delay(s16 period) { int i, j; for(i=0; i>1; j++); } } 1.5 Building and Running the Program ==================================== Code Composer Studio automatically saves changes to the project setup as you make them. In case you exited from Code Composer Studio after the previous section, you can return to the point where you stopped working by restarting Code Composer Studio and using Project->Open. To build and run the program, follow these steps: 1) Choose Project->Rebuild All or click the (Rebuild All) toolbar button. Code Composer Studio recompiles, reassembles, and relinks all the files in the project. Messages about this process are shown in a frame at the bottom of the window. 2) Choose File->Load Program. Select the program you just rebuilt, codec.out, and click Open. (It should be in the c:\ti\myprojects\codec folder unless you installed Code Composer Studio elsewhere.) Code Composer Studio loads the program onto the target DSP and opens a Dis-Assembly window that shows the disassembled instructions that make up the program. (Notice that Code Composer Studio also automatically opens a tabbed area at the bottom of the window to show output the program sends to stdout.) 3) Click on assembly instruction in the Dis-Assembly window. (Click on the actual instruction, not the address of the instruction or the fields passed to the instruction.) Press the F1 key. Code Composer Studio searches for help on that instruction. This is a good way to get help on an unfamiliar assembly instruction. 4) Choose Debug->Run or click the (Run) toolbar button. Analyze results (see below). 5) Choose Debug->Halt or click the (Halt) toolbar button to end the program. 1.6 Expected Results ==================== Running your program should enable the polling from the input sample (e.g., mic) to be written back to the codec (e.g., speaker).

近期下载者

相关文件


收藏者