【正文】
令,一般有兩種方法來完成除法。學(xué)習(xí)并掌握應(yīng)用 TMS320C54X 來進(jìn)行浮點(diǎn)數(shù)的各種算術(shù)運(yùn)算的算法實(shí)現(xiàn)。步驟如下: setup CCS C5000,在其中設(shè)置目前需要的CCS 的工作狀態(tài)為C54xxsimulator,保存這一設(shè)置并退出。,此時就可以看見程序初始化后的情況: 以浮點(diǎn)數(shù)的格式放在內(nèi)存區(qū)0x08a0x08b 中,其值為4140h 和0000h。這是用浮點(diǎn)數(shù)格式表示的數(shù)1(=1312)。,請檢查源程序是否有誤,必要時可以在源程序中多插入斷點(diǎn)語句。本實(shí)驗(yàn)利用定時器產(chǎn)生一個 2kHz 的正弦信號。圖 41 給出了 C5402 的 IMR 寄存器的各個比特位的定義。選擇Linker Output Filename”欄中寫入輸出OUT 文件的名字,你還可以設(shè)置生成的MAP 文件名。第二篇:DSP實(shí)驗(yàn)報告實(shí)驗(yàn)0 實(shí)驗(yàn)設(shè)備安裝才CCS調(diào)試環(huán)境實(shí)驗(yàn)?zāi)康模喊凑諏?shí)驗(yàn)講義操作步驟,打開CCS軟件,熟悉軟件工作環(huán)境,了解整個工作環(huán)境內(nèi)容,有助于提高以后實(shí)驗(yàn)的操作性和正確性。一個16 位的二進(jìn)制數(shù)既可以表示一個整數(shù),也可以表示一個小數(shù)。5)實(shí)現(xiàn) 16 位定點(diǎn)小數(shù)乘法在 C54X 中,小數(shù)的乘法與整數(shù)乘法基本一致,只是由于兩個有符號的小數(shù)相乘,其結(jié)果的小數(shù)點(diǎn)的位置在次高的后面,所以必須左移一位,才能得到正確的結(jié)果。7)實(shí)現(xiàn) 16 位定點(diǎn)小數(shù)除法在 C54X 中實(shí)現(xiàn)16 位的小數(shù)除法與前面的整數(shù)除法基本一致,也是使用循環(huán)的SUBC 指令來完成。例如,如果一個 32bit 的數(shù)把小數(shù)點(diǎn)放在最高有效位(也就是符號位)之后,那么就只有分?jǐn)?shù)(絕對值小于1)才能被顯示。:在這條指令處雙擊將其點(diǎn)為紅色即可。“運(yùn)行程序”按鈕,程序停下來時就可以觀察到在存儲器窗口中表示結(jié)果的變量rlthm、rltlm、rltsign 和rltexp 的值在內(nèi)存區(qū)0x0800x083 中,其值分別為0040h、0000h、0180h 和0083h。乘法運(yùn)算的程序到此結(jié)束。通常的方法是將某個頻率的正弦/余弦值預(yù)先計算出來后制成一個表,DSP 工作時僅作查表運(yùn)算即可。設(shè)初始條件為0,求出上式的反Z 變換得:y[k]=Ay[k1]+By[k2]+Cx[k1] 2)C54X 的定時器操作C54X 的片內(nèi)定時器利用CLKOUT 時鐘計數(shù),用戶使用三個寄存器(TIM,PRD,TCR)來控制定時器,參見表41。本實(shí)驗(yàn)的初始化程序讀取中斷向量表的啟始地址,然后設(shè)置PMST 的高9 位,以便DSP 能正確響應(yīng)中斷,代碼如下:ld 0,dp ;設(shè)置DP 頁指針 ssbx intm ;關(guān)閉所有中斷 ld vector, a ;讀出中斷向(地址vector 在中斷向量表程序中定義)and 0FF80h, a ;保留高9 位(IPTR)andm 007Fh, pmst ;保留PMST 的低7 位 or pmst, a ;stlm a, pmst ;設(shè)置PMST(其中包括IPTR) 實(shí)驗(yàn)內(nèi)容本實(shí)驗(yàn)需要使用 C54X 匯編語言或C 語言實(shí)現(xiàn)數(shù)字振蕩器,并通過CCS 提供的圖形顯示窗口觀察出信號波形以及頻譜。7)用右鍵單擊圖形顯示窗口,并選擇“Proporties”項(xiàng)以便修改顯示屬性。寫實(shí)現(xiàn)程序時需要注意兩點(diǎn):(1)浮點(diǎn)數(shù)的范圍及存儲格式;(2)DSP的C語言與ANSI C語言的區(qū)別。void main(void){int i。}龍巖學(xué)院實(shí) 驗(yàn) 報 告班級07電本(1)班學(xué)號2007050344姓名 楊寶輝 同組人獨(dú)立實(shí)驗(yàn)日期2010520室溫大氣壓成 績數(shù)碼管控制實(shí)驗(yàn)一、實(shí)驗(yàn)?zāi)康?; 熟悉74HC573的使用方法。五、實(shí)驗(yàn)心得體會通過本次實(shí)驗(yàn)中,基本掌握了2812的指令系統(tǒng)的特點(diǎn),并能夠了解并熟悉74HC573的使用方法,進(jìn)一步加深了對DSP的認(rèn)識。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.//=============================龍巖學(xué)院實(shí) 驗(yàn) 報 告班級07電本(1)班學(xué)號2007050344 姓名 楊寶輝同組人 獨(dú)立實(shí)驗(yàn)日期201061室溫大氣壓成 績直流電機(jī)控制實(shí)驗(yàn)一、實(shí)驗(yàn)?zāi)康?、實(shí)驗(yàn)設(shè)備 ; ;要求學(xué)生掌握2812 PWM的使用方法; 掌握2812對直流電機(jī)的控制。// 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軟件仿真及調(diào)試有了初步的了解與認(rèn)識,因?yàn)樽鰧?shí)驗(yàn)的時候都是按照實(shí)驗(yàn)指導(dǎo)書按部就班的,與真正的理解和掌握還是有些距離的。(1)打開ccs后點(diǎn)擊菜單中的“FileNewProject”,選擇“CCS project”,然后進(jìn)入下一個頁面進(jìn)行工程的命名。然后進(jìn)行調(diào)試,設(shè)置斷點(diǎn)。六.源代碼及注釋include include “” include “” include “” void main(void){printf(“Hello World!n”)。(3)接下來是設(shè)置工程屬性,在“Device Variant”下拉欄中選擇“Generic devices Generic C64xx Device”,“Device Endianness”選擇little,其余保持默認(rèn)值。通過做實(shí)驗(yàn),把學(xué)習(xí)的知識利用起來,也對這門課程更加有興趣了。如果按F10執(zhí)行程序,則程序在mian主函數(shù)中運(yùn)行,如果按F11,則程序進(jìn)入write_buffe函數(shù)內(nèi)部的程序運(yùn)行。,不是按實(shí)驗(yàn)書上的型號選擇,而是應(yīng)該按照實(shí)驗(yàn)設(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。三、實(shí)驗(yàn)原理電機(jī)模塊的原理圖如下四、實(shí)驗(yàn)步驟;(),編譯,下載程序到DSP; ,用觀察直流電機(jī)運(yùn)行方向和速度的變化;五、實(shí)驗(yàn)心得體會通過本次實(shí)驗(yàn),認(rèn)識了PWM的使用方法,通過親身體驗(yàn),初步掌握了2812對PWM的控制使用方法,加深了對PWM的認(rèn)識。=var2。=var1。Uint16 var3。i 1000。i{Reg06=0x00。IFR = 0x0000。// Specific clock setting for this example:EALLOW。輸入引腳對應(yīng)讀操作;輸出引腳對應(yīng)寫操作。}// Set GPIO input qualifier values //============================= // No more.//=============================龍巖學(xué)院實(shí) 驗(yàn) 報 告班級07電本(1)班學(xué)號2007050344 姓名 楊寶輝同組人獨(dú)立實(shí)驗(yàn)日期20100527室溫大氣壓成 績步進(jìn)電機(jī)控制實(shí)驗(yàn)一、實(shí)驗(yàn)?zāi)康?、實(shí)驗(yàn)設(shè)備; (插上電機(jī)模塊);; 。=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)。二、實(shí)驗(yàn)設(shè)備;; 。=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