【正文】
/ Initalize EVA Timer2 = 0x0FFF。// Timer2 period = 0x03C0。// Timer2 pare = 0x0000。// Timer2 counter// TMODE = continuous up/down// Timer enable// Timer pare enable = 0x1042。// Setup T1PWM and T2PWM// Drive T1/T2 PWM by pare logic = 1。// Polarity of GP Timer 1 Compare = Active low = 1。// Polarity of GP Timer 2 Compare = Active high = 2。// Enable pare for PWM1PWM6// = 0x0C00。// = 0x3C00。 = 0xFC00。// Compare action that takes place// on a cmpare event// output pin 1 CMPR1active low// output pin 3 CMPR2active low// output pin 5 CMPR3active low = 0x0666。 = 0x0000。// Disable deadband = 0xA600。}void init_evb(){ // EVB Configure T3PWM, T4PWM and PWM7PWM12 // Step 1active high// output pin 2 CMPR4active high// output pin 4 CMPR5active high// output pin 6 CMPR6x000 0000 0011 0000EDIS。// Step PIE vector table:// The PIE vector table is initialized with pointers to shell Interrupt// Service Routines(ISR).The shell routines are found in .// Insert user specific ISR code in the appropriate shell ISR routine in// the file.// Disable and clear all CPU interrupts:DINT。IER = 0x0000。IFR = 0x0000。// Initialize Pie Control Registers To Default State:// This function is found in the file.// InitPieCtrl()。PIE is not used for this example// Initialize the PIE Vector Table To a Known State:// This function is found in .// This function populates the PIE vector table with pointers// to the shell ISR functions found in ()。// Enable CPU and PIE interrupts// This example function is found in the ()。// Step all the Device Peripherals to a known state:// This function is found in // InitPeripherals()。skip this for SCI tests// Step specific functions, Reassign vectors(optional), Enable Interrupts:LoopCount = 0。ErrorCount = 0。scia_fifo_init()。// Initialize the SCI FIFOscia_loopback_init()。// Initalize SCI for digital loop back// Note: Autobaud lock is not required for this example// Send a character starting with 0SendChar = 0。// Step Characters forever starting with 0x00 and going through // sending each, check the recieve buffer for the correct value for(。){ scia_xmit(SendChar)。while(!=1){ } // wait for XRDY =1 for empty state// Check received characterReceivedChar = 。if(ReceivedChar!= SendChar)error(1)。// Move to the next character and repeat the testSendChar++。// Limit the character to 8bitsSendChar amp。= 0x00FF。LoopCount++。if(LoopCount==256){LoopCount=0。 =0。// Disable loop back =0x0023。// Relinquish SCI from Reset while((ReceivedChar = )!=0x0d)。scia_loopback_init()。// Initalize SCI for digital loop back}} }// Step all local Interrupt Service Routines(ISRs)and functions here: void error(int ErrorFlag){ErrorCount++。//asm(“ESTOP0”)。// Unment to stop the test here //for(。)。} // Test 1,SCIA DLB, 8bit word, baud rate 0x000F, default, 1 STOP bit, no parity void scia_loopback_init(){// Note: Clocks were turned on to the SCIA peripheral// in the InitSysCtrl()function =0x0007。// 1 stop bit, No loopback// No parity,8 char bits,// async mode, idleline protocol =0x0003。// enable TX, RX, internal SCICLK,// Disable RX ERR, SLEEP, TXWAKE =0x0003。 =1。 =1。=0x0001。=0x00e7。} // Transmit a character from the SCI39。 void scia_xmit(int a){=a。}// Initalize the SCI FIFO void scia_fifo_init() =1。// Enable loop back =0x0023。// Relinquish SCI from Reset{=0xE040。=0x204f。=0x0。}//============================= // No more.//=============================第四篇:dsp實驗報告心得體會TMS320F2812x DSP原理及應用技術實驗心得體會,根據(jù)實驗的需要設置,這次實驗只是軟件仿真,可以不設置硬件,但是要為日后的實驗做準備,還是要學習和熟悉硬件設置的過程。,不是按實驗書上的型號選擇,而是應該按照實驗設備上的型號去添加。,都應該將之前設置好的刪去,重新添加。設置好的配置中只能有一項。,就是由軟件在PC機內(nèi)存中構(gòu)造一個虛擬的DSP環(huán)境,可以調(diào)試、運行程序。但是一般無法構(gòu)造DSP中的外設,所以軟件仿真通常用于調(diào)試純軟件算法和進行效率分析等。,不需要打開電源箱的電源。,無需連接板卡和仿真器等硬件。如果按F10執(zhí)行程序,則程序在mian主函數(shù)中運行,如果按F11,則程序進入write_buffe函數(shù)內(nèi)部的程序運行。,點擊變量左邊的“+”,觀察窗口可以展開結(jié)構(gòu)變量,就可以看到結(jié)構(gòu)體變量中的每個元素了。,顯示圖形出現(xiàn)問題,不能顯示,后來在Graph Title 把Input的大寫改為input,在對volume進行編譯執(zhí)行后,就可以看到顯示的正弦波圖形了。,要重新編譯、連接執(zhí)行程序。如果不重新加載,那么修改執(zhí)行程序后,其結(jié)果將不會改變。,可將data和data1的窗口同時打開,這樣可以便于比較,觀察結(jié)果。,對TMS320F2812x DSP軟件仿真及調(diào)試有了初步的了解與認識,因為做實驗的時候都是按照實驗指導書按部就班的,與真正的理解和掌握還是有些距離的。但是這也為我們?nèi)蘸筮\用這些知識打下了基礎,我覺得實驗中遇到的問題,不要急于問老師或者同學,先自己想辦法分析原因,想辦法解決,這樣對自身的提高更多吧。通過做實驗,把學習的知識利用起來,也對這門課程更加有興趣了。組員:葉孝璐 馮煥芬 鄭瑋儀 龐露露2012年4月10號第五篇:DSP第一次實驗報告信息與通信工程學院信號與信息處理綜合實驗(DSP部分)實驗報告班級: 2012211127名: 劉燦姓學日號: 2012210732 期: 一.實驗題目Hello World和LED 二.實驗目的熟悉平DSK6416開發(fā)臺,掌握CCS軟件的基本操作流程,達到熟練操作軟、硬件系統(tǒng)開發(fā)、調(diào)試的目的。三.實驗任務及要求(1)在控制臺中顯示Hello World運行程序后,在控制臺顯示Hello World(2)控制LED燈閃爍FTP給出一個LED的程序模板,可以控制LED 0的閃爍?;谠撃0?,需要完成:(a)修改閃爍的頻率;(b)通過寫8bit數(shù)值到CPLD寄存器來控制LED,使得4個LED以200ms的頻率同時打開和關閉。(1)實現(xiàn)基本功能且不出現(xiàn)任何錯誤(2)基于原理實現(xiàn)多功能的擴展四.組內(nèi)分工劉杰程序代碼的編寫與調(diào)試劉燦建立工程以及目標系統(tǒng)的配置五.實驗內(nèi)容及流程這次實驗內(nèi)容是顯示hello world和控制LED燈的閃爍。由于是dsp的第一次實驗,內(nèi)容比較簡單,主要還是在于熟悉ccs這個軟件在進行dsp開發(fā)時的具體建立工程、配置文件、導入實驗板和程序燒寫調(diào)試的過程和步驟。(1)打開ccs后點擊菜單中的“FileNewProject”,選擇“CCS project”,然后進入下一個頁面進行工程的命名。(2)命名完成之后是選擇工程的硬件平臺,我們實驗室所使用的實驗板是DSK6416,它的芯片為C6000系列的TMS320C6416,所以在“Project Type”下拉框中選擇“C6000”,其余選項默認即可。(3)接下來是設置工程屬性,在“Device Variant”下拉欄中選擇“Generic devices Generic C64xx Device”,“Device Endianness”選擇little,其余保持默認值。(4)然后工程模板選擇“hello world”,就完成了工程的新建。(1)添加源代碼(2)配置CSL庫將C6000的CSL庫,存在本地PC機硬盤上,我們hello world工程的代碼路徑為C:ticsl。在pll_led工程圖標上單擊右鍵,選擇“Show Build Settings…”來設置編譯屬性,設置include options,單擊新建,在對話框中輸入“C:ticslinclude”(3)定義芯片型號:在“predefine symbols”選項中輸入芯片型號CHIP_6416(4)指定鏈接庫:在工程屬性的“C6000 Linker”的“File Search Path”選項中需要添加DSK6416和CSL6416這兩個庫,其路徑分別為“c:”和“c:”(5)添加cmd文件:在工程路徑下新建一個文本文件,名稱可隨便修改,并且在文本文件中寫入下列內(nèi)容:stack 0x400heap 0x400 保存并編譯工程,生成“.out”文件。在工程中運行“NewTarget Configuration File”新建配置文件。命名完后在配置文件Basic中Connection選擇Spectrum digital DSKEVMeZdsp onboard USB Emulator,Device選擇DSK6416,保存。然后進行調(diào)試,設置斷點。最后將程序燒錄到實驗板中,檢查實驗結(jié)果。六.源代碼及注釋include include “” include “” include “” void main(void){printf(“Hello World!n”)。//控制臺顯示“hello world”DSK6416_init()。//初始化LED和DIPDSK6