嵌入式-work1解析_第1頁
嵌入式-work1解析_第2頁
嵌入式-work1解析_第3頁
嵌入式-work1解析_第4頁
嵌入式-work1解析_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、實驗報告課程名稱嵌入式系統(tǒng)設(shè)計實驗儀器清華同方辰源嵌入式系統(tǒng)實驗箱實驗名稱實驗一:人機交互接口 -顯示實驗系別一一計算機學(xué)院_專業(yè)計算機科學(xué)與技術(shù)班級/學(xué)號 1402/2014011150學(xué)生姓名蔡晨實驗日期2016-9-21成 績 指導(dǎo)教師朱敏玲-顯示實驗一、實驗問題回答( 1)介紹以下四個函數(shù)的作用、參數(shù)涵義及使用方法。答: RIT128x96x4StringDraw/ 輸出字符串RIT128x96x4ImageDraw/ 輸出點RIT128x96x4Clear/ 清屏RIT128x96x4Init/ 初始化屏幕( 2)實驗平臺OLED 顯示屏的最大寬度和高度,超出范圍會怎么樣(自己測試)

2、答:超出范圍不顯示( 3)比較Keil uVision4 上開發(fā)嵌入式C 程序與 Visual C+ 中開發(fā) C 程序的異同。答:本質(zhì)都一樣,都是生成CPU 可執(zhí)行的二進制文件。 VC 一般是生成PC 機可執(zhí)行的文件,而keil 是生成 keil 能支持的那些 MCU 可執(zhí)行的二進制文件,在 VC 上變成一般不用考慮內(nèi)存大小, ROM 大小。字長等因素,而在keil 上變成必須考慮這些,不能使用超過MVU 所能提供的資源。( 4)描述一下你的項目從開始創(chuàng)建到下載的整個流程答:( 1)新建一個project( 2) CPU 選 Luminary LM3S 8962( 3)加載庫文件( 4)項目相

3、關(guān)配置項修改( 5)加載必要程序( 6)新建主函數(shù)程序,并加載到項目中( 7)開發(fā)主函數(shù),完成基本顯示功能(信息提示與直線)( 8) 開發(fā)主函數(shù),完成拼接字符顯示功能( 9)編譯、連接,生成可執(zhí)行程序文件( 10) 反復(fù)( 3) -( 4)步驟,直到完成( 11)硬件連接( 12)聯(lián)調(diào)( 5)每個像素是怎么表示的?答: 0x00 表示暗像素點 0xff 表示亮像素點( 6)畫線時,為什么要定義數(shù)組?答: 確定像素點的亮度與暗度。( 7)如何使顯示的字符變亮?變暗?答:用十六進制從0-f,通過改變字符顯示函數(shù)的第二個參數(shù)來改變亮度和暗度。(8)如何使顯示的圖形變亮?變暗?答:用十六進制從0-f,

4、通過改變字符顯示函數(shù)的第二個參數(shù)來改變亮度和暗度(9)如何使顯示的圖形變寬?變窄?變高?變矮?答:通過改變顯示圖形函數(shù) RIT128x96x4ImageDraw(buf, 18, 84, 162, 1)中的第 三個數(shù),可變寬變窄,最后一個數(shù),改變高瘦。(10)漢字如何顯示?答:可用顯示圖形的方法進行字符拼接。二、實驗?zāi)康暮托Ч?效果即是否達到實驗?zāi)康?,達到的程度如何)目的:(1)初步學(xué)習(xí)、理解、掌握 OLED字符顯示方法(2)初步學(xué)習(xí)、理解、掌握 OLED圖形顯示方法效果:(1)在OLED屏幕上分行顯示自己的學(xué)號、姓名、項目序號、時間,(2) 在OLED屏幕上顯示一條橫線和豎線。(3)在OLE

5、D屏幕上顯示三個5*7比例的字符圖形(大、中、小各一個),每位同學(xué)根據(jù)附錄1分配表查找自己應(yīng)該顯示的字符,每個字符顯示效果見附錄2。(4)擴展:在OLED屏幕上畫一個型圖案。(5)擴展:在OLED屏幕上畫出自己的“姓”或“名”圖案。三、實驗內(nèi)容和步驟(重點闡述自己的思路及遇到的問題)(一)建立項目(1)首先新建一個project(2)選擇 CPU 本實驗選 Luminary LM3S 8962(3)加載庫文件(4)項目相關(guān)配置項修改(二)嵌入式C 程序開發(fā)(1)加載必要程序:本次實驗提供了幾個源程序 rit128x96x4.h , rit128x96x4.c ,startup.s 并且將這幾個

6、文件復(fù)制到項目工作目錄中。( 2)新建主函數(shù)程序,并加載到項目中( 3)開發(fā)主函數(shù),完成基本顯示功能(信息提示與直線)頭文件有以下三個#include #include #include rit128x96x4.h( 4)開發(fā)主函數(shù),完成拼接字符顯示功能( 5)編譯、連接,生成可執(zhí)行程序文件( 6)反復(fù)(3) -( 4)步驟,直到完成(三)硬件連接( 1) 接上電源線, 先關(guān)閉開關(guān)( 2) 用藍色 USB 線接上仿真器, 仿真器另一JTAG端接 LM3S8962 CPU 板(左下較大子板), USB 線接電腦( 3)確認連接無誤后,打開電源開關(guān)(四)聯(lián)調(diào)( 1)在 Keil uVision4

7、中執(zhí)行下載,( Flash 菜單 -Download ),即可通過仿真器將(一)步編譯鏈接好的執(zhí)行程序下載到 LM3S8962 芯片內(nèi)的 Flash 中。(2)按下實驗箱上LM3s8962子板屏幕上方的白色按鈕Reset鍵,即可查看程序執(zhí)行效果。若有問題,返回第一步繼續(xù)修改程序,編譯、鏈接、下載,一直到顯示出滿意的效果。實驗代碼: 1)#include #include #include rit128x96x4.hunsigned char buf1 = 0x00,0x00, 0xff,0xff, 0xff,0xff, 0xff,0xff, 0x00,0x00, ;unsigned char

8、buf2 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf3 =0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf4 = 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, ;unsigned char buf5 = 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff ;unsigned char bu

9、f6 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf7 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf15 =0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf16 =0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf1

10、7 =0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf18 =0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf19 =0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf22 =0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,;unsigned char buf33 =0xff,0xff

11、,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf44 = 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,;unsigned char buf55 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, ;unsigned char buf66 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, ;unsigned char buf77 = 0xff,0x

12、ff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, ;unsigned char buf111 = 0x00,0x00, 0xff,0xff, 0xff,0xff, 0x00,0x00,;unsigned char buf222 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf333 =0xff,0xff, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf444 = 0xff,0xff, 0xff,0xff, 0xff

13、,0xff, 0xff,0xff, ;unsigned char buf555 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf666 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf777 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf1111 = 0x00,0x00, 0xff,0xff, 0xff,0xff, 0xff,0xff, 0x00,0x00

14、, ;unsigned char buf2222 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf3333 =0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf4444 = 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, ;unsigned char buf5555 = 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x0

15、0,0xff,0xff ;unsigned char buf6666 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf7777 = 0xff,0xff, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf11111 = 0x00,0x00,0xff,0xff,0xff,0xff, 0x00,0x00,0xff,0xff,0xff,0xff, 0x00,0x00,;unsigned char buf11112 = 0xff

16、,0xff,0x00,0x00,0x00,0x00, 0xff,0xff,0x00,0x00, 0x00,0x00, 0xff,0xff, ;unsigned char buf11113 = 0x00,0x00, 0xff,0xff,0x00,0x00, 0x00,0x00, 0x00,0x00,0xff,0xff, 0x00,0x00, ;unsigned char buf11114 = 0x00,0x00, 0x00,0x00,0xff,0xff, 0x00,0x00, 0xff,0xff,0x00,0x00, 0x00,0x00, ;unsigned char buf11115 = 0x

17、00,0x00, 0x00,0x00, 0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, 0x00,0x00, ;int main()SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);RIT128x96x4Init(1000000);RIT128x96x4Clear();while(1)RIT128x96x4StringDraw(2014011150, 0, 6, 15);RIT128x96x4StringDraw(caichen, 0, 1

18、8, 15);RIT128x96x4StringDraw(work1, 0, 30, 15);RIT128x96x4StringDraw(2016-9-21, 0, 42, 15);RIT128x96x4ImageDraw(buf1, 50, 64, 20, 1);RIT128x96x4ImageDraw(buf2, 50, 67, 20, 1);RIT128x96x4ImageDraw(buf3, 50, 70, 20, 1);RIT128x96x4ImageDraw(buf4, 50, 73, 20, 1);RIT128x96x4ImageDraw(buf5, 50, 76, 20, 1)

19、;RIT128x96x4ImageDraw(buf6, 50, 79, 20, 1);RIT128x96x4ImageDraw(buf7, 50, 81, 20, 1);RIT128x96x4ImageDraw(buf15, 2,69, 2, 1);RIT128x96x4ImageDraw(buf16, 2,69, 2, 1);RIT128x96x4ImageDraw(buf17, 2, 70, 2, 1);RIT128x96x4ImageDraw(buf18, 2, 71, 2, 1);RIT128x96x4ImageDraw(buf19, 2, 72, 2, 1);RIT128x96x4I

20、mageDraw(buf22, 2, 73, 20, 1);RIT128x96x4ImageDraw(buf33, 2, 74, 2, 1);RIT128x96x4ImageDraw(buf44, 2, 75, 2, 1);RIT128x96x4ImageDraw(buf55, 2, 76, 2, 1);RIT128x96x4ImageDraw(buf66, 2, 77, 2, 1);RIT128x96x4ImageDraw(buf77, 2, 78, 2, 1);RIT128x96x4ImageDraw(buf111, 30, 64, 16, 1);RIT128x96x4ImageDraw(

21、buf222, 30, 68, 16, 1);RIT128x96x4ImageDraw(buf333, 30, 72, 16, 1);RIT128x96x4ImageDraw(buf444, 30, 76, 16, 1);RIT128x96x4ImageDraw(buf555, 30, 80, 16, 1);RIT128x96x4ImageDraw(buf666, 30, 84, 16, 1);RIT128x96x4ImageDraw(buf777, 30, 88, 16, 1);RIT128x96x4ImageDraw(buf1111, 80, 64, 20, 1);RIT128x96x4I

22、mageDraw(buf2222, 80, 66, 20, 1);RIT128x96x4ImageDraw(buf3333, 80, 68, 20, 1);RIT128x96x4ImageDraw(buf4444, 80, 70, 20, 1);RIT128x96x4ImageDraw(buf5555, 80, 72, 20, 1);RIT128x96x4ImageDraw(buf6666, 80, 74, 20, 1);RIT128x96x4ImageDraw(buf7777, 80, 76, 20, 1);RIT128x96x4ImageDraw(buf11111, 70, 10, 28,

23、 1);RIT128x96x4ImageDraw(buf11112, 70, 14, 28, 1);RIT128x96x4ImageDraw(buf11113, 70, 18, 28, 1);RIT128x96x4ImageDraw(buf11114, 70, 22, 28, 1);RIT128x96x4ImageDraw(buf11115, 70, 26, 28, 1);return 0; 2) 2)#include #include #include rit128x96x4.hunsigned char buf1 = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0

24、x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00, ;unsigned char buf11 = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, ;unsigned char buf2 = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0xff,0xff,0x

25、ff,0xff,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, ;unsigned char buf12 = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 0x00,0x00,0x00,0x00, ;unsigned char buf3 =0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x0

26、0,0x00,0x00, ;unsigned char buf4 = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, ;unsigned char buf5 = 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, ;unsigned

27、 char buf6 = 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00, ; unsigned char buf7 = 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0x00,0x00, ;unsigned char buf8 = 0x00,0x00,0x00,0x00,0x00,0x0

28、0,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00, 0xff,0xff, ;unsigned char buf9 = 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, 0xff,0xff,0x00,0x00, ;unsigned char buf10 = 0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xff,0xff, ;int main()SysCtlClockSet(

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論