【正文】
令,一般有兩種方法來完成除法。學習并掌握應用 TMS320C54X 來進行浮點數(shù)的各種算術運算的算法實現(xiàn)。步驟如下: setup CCS C5000,在其中設置目前需要的CCS 的工作狀態(tài)為C54xxsimulator,保存這一設置并退出。,此時就可以看見程序初始化后的情況: 以浮點數(shù)的格式放在內存區(qū)0x08a0x08b 中,其值為4140h 和0000h。這是用浮點數(shù)格式表示的數(shù)1(=1312)。,請檢查源程序是否有誤,必要時可以在源程序中多插入斷點語句。本實驗利用定時器產生一個 2kHz 的正弦信號。圖 41 給出了 C5402 的 IMR 寄存器的各個比特位的定義。選擇Linker Output Filename”欄中寫入輸出OUT 文件的名字,你還可以設置生成的MAP 文件名。第二篇:DSP實驗報告實驗0 實驗設備安裝才CCS調試環(huán)境實驗目的:按照實驗講義操作步驟,打開CCS軟件,熟悉軟件工作環(huán)境,了解整個工作環(huán)境內容,有助于提高以后實驗的操作性和正確性。一個16 位的二進制數(shù)既可以表示一個整數(shù),也可以表示一個小數(shù)。5)實現(xiàn) 16 位定點小數(shù)乘法在 C54X 中,小數(shù)的乘法與整數(shù)乘法基本一致,只是由于兩個有符號的小數(shù)相乘,其結果的小數(shù)點的位置在次高的后面,所以必須左移一位,才能得到正確的結果。7)實現(xiàn) 16 位定點小數(shù)除法在 C54X 中實現(xiàn)16 位的小數(shù)除法與前面的整數(shù)除法基本一致,也是使用循環(huán)的SUBC 指令來完成。例如,如果一個 32bit 的數(shù)把小數(shù)點放在最高有效位(也就是符號位)之后,那么就只有分數(shù)(絕對值小于1)才能被顯示。:在這條指令處雙擊將其點為紅色即可?!斑\行程序”按鈕,程序停下來時就可以觀察到在存儲器窗口中表示結果的變量rlthm、rltlm、rltsign 和rltexp 的值在內存區(qū)0x0800x083 中,其值分別為0040h、0000h、0180h 和0083h。乘法運算的程序到此結束。通常的方法是將某個頻率的正弦/余弦值預先計算出來后制成一個表,DSP 工作時僅作查表運算即可。設初始條件為0,求出上式的反Z 變換得:y[k]=Ay[k1]+By[k2]+Cx[k1] 2)C54X 的定時器操作C54X 的片內定時器利用CLKOUT 時鐘計數(shù),用戶使用三個寄存器(TIM,PRD,TCR)來控制定時器,參見表41。本實驗的初始化程序讀取中斷向量表的啟始地址,然后設置PMST 的高9 位,以便DSP 能正確響應中斷,代碼如下:ld 0,dp ;設置DP 頁指針 ssbx intm ;關閉所有中斷 ld vector, a ;讀出中斷向(地址vector 在中斷向量表程序中定義)and 0FF80h, a ;保留高9 位(IPTR)andm 007Fh, pmst ;保留PMST 的低7 位 or pmst, a ;stlm a, pmst ;設置PMST(其中包括IPTR) 實驗內容本實驗需要使用 C54X 匯編語言或C 語言實現(xiàn)數(shù)字振蕩器,并通過CCS 提供的圖形顯示窗口觀察出信號波形以及頻譜。7)用右鍵單擊圖形顯示窗口,并選擇“Proporties”項以便修改顯示屬性。寫實現(xiàn)程序時需要注意兩點:(1)浮點數(shù)的范圍及存儲格式;(2)DSP的C語言與ANSI C語言的區(qū)別。void main(void){int i。}龍巖學院實 驗 報 告班級07電本(1)班學號2007050344姓名 楊寶輝 同組人獨立實驗日期2010520室溫大氣壓成 績數(shù)碼管控制實驗一、實驗目的 ; 熟悉74HC573的使用方法。五、實驗心得體會通過本次實驗中,基本掌握了2812的指令系統(tǒng)的特點,并能夠了解并熟悉74HC573的使用方法,進一步加深了對DSP的認識。EDIS。// Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines(ISR).// This will populate the entire table, even if the interrupt // is not used in this is useful for debug purposes.// The shell ISR routines are found in .// This function is found in ()。Reg03=0x00。delay_loop()。=~codetab[i]。j++)。=var1。=var2。EDIS。同時,使我掌握了DSP的IO操作使用方法。// Skipped for this example// For this example use the following configuration:Gpio_select()。// For this example, init the Xintf // Step specific code, enable interrupts:while(1){=0xdc80。delay_loop()。j 50。EALLOW。// GPIO PORTs as output// GPIO DIR select GPIOs as output=var2。=var3。為1表示是輸出引腳,否則是輸入引腳。main(){short i,j。// Initialize the PIE control registers to their default state.// The default state is all PIE interrupts disabled and flags // are cleared.// This function is found in the ()。while(1){for(j=0。}}} } void delay_loop(){shorti,j。=codetab[i]。// sets GPIO Muxs as I/Os// sets GPIO DIR as outputs// sets the Input qualifier values=var1。=var2。}// Set GPIO input qualifier values //============================= // No more.//=============================龍巖學院實 驗 報 告班級07電本(1)班學號2007050344 姓名 楊寶輝同組人 獨立實驗日期201061室溫大氣壓成 績直流電機控制實驗一、實驗目的 、實驗設備 ; ;要求學生掌握2812 PWM的使用方法; 掌握2812對直流電機的控制。// Step System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the ()。// EVB PWM 712 pinsEDIS。// For this example, init the Xintf // Step specific code, enable interrupts:init_eva()。i 1000。// Initalize EVA Timer2 = 0x0FFF。// = 0x3C00。IFR = 0x0000。// Initialize the SCI FIFOscia_loopback_init()。= 0x00FF。//asm(“ESTOP0”)。=0x0001。=0x0。,無需連接板卡和仿真器等硬件。,對TMS320F2812x DSP軟件仿真及調試有了初步的了解與認識,因為做實驗的時候都是按照實驗指導書按部就班的,與真正的理解和掌握還是有些距離的。(1)打開ccs后點擊菜單中的“FileNewProject”,選擇“CCS project”,然后進入下一個頁面進行工程的命名。然后進行調試,設置斷點。六.源代碼及注釋include include “” include “” include “” void main(void){printf(“Hello World!n”)。(3)接下來是設置工程屬性,在“Device Variant”下拉欄中選擇“Generic devices Generic C64xx Device”,“Device Endianness”選擇little,其余保持默認值。通過做實驗,把學習的知識利用起來,也對這門課程更加有興趣了。如果按F10執(zhí)行程序,則程序在mian主函數(shù)中運行,如果按F11,則程序進入write_buffe函數(shù)內部的程序運行。,不是按實驗書上的型號選擇,而是應該按照實驗設備上的型號去添加。} // Transmit a character from the SCI39。)。if(LoopCount==256){LoopCount=0。// Step Characters forever starting with 0x00 and going through // sending each, check the recieve buffer for the correct value for(。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 ()。// 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。// Timer2 pare = 0x0000。j 10。while(1){for(i=0。// Initialize the PIE control registers to their default state.// The default state is all PIE interrupts disabled and flags // are cleared.// This function is found in the ()。EDIS。三、實驗原理電機模塊的原理圖如下四、實驗步驟;(),編譯,下載程序到DSP; ,用觀察直流電機運行方向和速度的變化;五、實驗心得體會通過本次實驗,認識了PWM的使用方法,通過親身體驗,初步掌握了2812對PWM的控制使用方法,加深了對PWM的認識。=var2。=var1。Uint16 var3。i 1000。i{Reg06=0x00。IFR = 0x0000。// Specific clock setting for this example:EALLOW。輸入引腳對應讀操作;輸出引腳對應寫操作。}// Set GPIO input qualifier values //============================= // No more.//=============================龍巖學院實 驗 報 告班級07電本(1)班學號2007050344 姓名 楊寶輝同組人獨立實驗日期20100527室溫大氣壓成 績步進電機控制實驗一、實驗目的 、實驗設備; (插上電機模塊);; 。=var2。// sets GPIO Muxs as I/Os // sets GPIO DIR as outputs // sets the Input qualifier values=var1。} } void Gpio_select(void){Uint16 var1。Reg00=0x00。delay_loop()。// Initialize the PIE control registers to their default state.// The default state is all PIE interrupts disabled and flags // are cleared.// This function is found in the ()。void Gpio_select(void)。二、實驗設備;; 。=var2。=var1。Uint16 var2。=~codetab[i]。i{Reg03=0x00。Reg04=0x00。// Not required for this exampleInitXintf()。s default state.// InitGpio()。程序見附錄:include “include/”// DSP281x Headerfile Include File include “include/”// DSP281x Ex