1 / 11

介面設計專題實務 Object Teaching of Interface Design 實驗二 資料儲存實驗

介面設計專題實務 Object Teaching of Interface Design 實驗二 資料儲存實驗. 授課教師:任才俊. 實驗目的. (a) 掌握 TMS320F2812 程式空間的分置。 (b) 掌握 TMS320F2812 資料空間的分置。 (c) 能夠熟練運用 TMS320F2812 資料空間的指令。. 實驗說明. 本實驗程式將對 0x003F9020H 開始的 8 個位址空間,填寫入 0xAAAA 的數值,然後讀出,並儲存到 0x003f9028H 開始的 8 個位址空間。. 實驗步驟 (1).

avian
Download Presentation

介面設計專題實務 Object Teaching of Interface Design 實驗二 資料儲存實驗

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 介面設計專題實務Object Teaching of Interface Design實驗二 資料儲存實驗 授課教師:任才俊

  2. 實驗目的 • (a)掌握TMS320F2812程式空間的分置。 • (b)掌握TMS320F2812資料空間的分置。 • (c)能夠熟練運用TMS320F2812資料空間的指令。

  3. 實驗說明 • 本實驗程式將對0x003F9020H開始的8個位址空間,填寫入0xAAAA的數值,然後讀出,並儲存到0x003f9028H開始的8個位址空間。

  4. 實驗步驟(1) Step1:加入檔案於專案中,並進行編譯,接著點選File->Load Program功能表下載入Debug目錄下的檔名.out檔案。

  5. 實驗步驟(2) Step2:載入完畢後,點選View->Memory查看記憶體單元,並輸入要查看的記憶體單元位址,本實驗要查看0x003F9020H~0x3F902FH單元數值變化,輸入位址0x003F9020H,如下圖所示。

  6. 實驗步驟(3) Step3:查看0x003F9020H~0x3F902FH單元的初始值,單擊Run執行程式,也可以“單步”執行程式。

  7. 實驗步驟(4) Step4:觀察實驗結果,查看0x003F9020H~0x003F902F單元內數值的變化。

  8. //------------------頭文件-------------------------------------////------------------頭文件-------------------------------------// #include "DSP281x_Device.h" // DSP281x Headerfile Include File #include "DSP281x_Examples.h" // DSP281x Examples Include File //------------------主程序-------------------------------------// void main(void) { int i; volatile unsigned int *room = (volatile unsigned int *)0x3f9020; volatile unsigned int *room2= (volatile unsigned int *)0x3f902F; // Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks InitSysCtrl(); // Disable CPU interrupts DINT; // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0x0000; IFR = 0x0000;

  9. for(;;) { /*xf管腳置低*/ asm(" clrc xf"); for(p=0;p<10000;p++) for(q=0;q<100;q++); /*xf管腳置高*/ asm(" setc xf"); for(p=0;p<10000;p++) for(q=0;q<100;q++); } }

  10. /*將0xAAAA寫入從數據空間的地址0x3f9020開始的8個單元中*/ /*將0xAAAA寫入從數據空間的地址0x3f9020開始的8個單元中*/ for(i=0;i<8;i++) { *room=0xAAAA; room++; } /*從0x3f9020開始的8個空間讀出數據依次寫入從0x3f9028開始的8個單元中*/ for(i=0;i<8;i++) { *room2=*(room-1); room--; room2--; } }

  11. 練習題 • 試將0x003F9020H~0x003F9027單元內數值填入0~7;而在0x003F9028H~0x003F902F單元內數值分別填入F、E、D、C、B、A、9、8。

More Related