嵌入式-work1解析_第1页
嵌入式-work1解析_第2页
嵌入式-work1解析_第3页
嵌入式-work1解析_第4页
嵌入式-work1解析_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、实验报告课程名称嵌入式系统设计实验仪器清华同方辰源嵌入式系统实验箱实验名称实验一:人机交互接口 -显示实验系别一一计算机学院_专业计算机科学与技术班级/学号 1402/2014011150学生姓名蔡晨实验日期2016-9-21成 绩 指导教师朱敏玲-显示实验一、实验问题回答( 1)介绍以下四个函数的作用、参数涵义及使用方法。答: RIT128x96x4StringDraw/ 输出字符串RIT128x96x4ImageDraw/ 输出点RIT128x96x4Clear/ 清屏RIT128x96x4Init/ 初始化屏幕( 2)实验平台OLED 显示屏的最大宽度和高度,超出范围会怎么样(自己测试)

2、答:超出范围不显示( 3)比较Keil uVision4 上开发嵌入式C 程序与 Visual C+ 中开发 C 程序的异同。答:本质都一样,都是生成CPU 可执行的二进制文件。 VC 一般是生成PC 机可执行的文件,而keil 是生成 keil 能支持的那些 MCU 可执行的二进制文件,在 VC 上变成一般不用考虑内存大小, ROM 大小。字长等因素,而在keil 上变成必须考虑这些,不能使用超过MVU 所能提供的资源。( 4)描述一下你的项目从开始创建到下载的整个流程答:( 1)新建一个project( 2) CPU 选 Luminary LM3S 8962( 3)加载库文件( 4)项目相

3、关配置项修改( 5)加载必要程序( 6)新建主函数程序,并加载到项目中( 7)开发主函数,完成基本显示功能(信息提示与直线)( 8) 开发主函数,完成拼接字符显示功能( 9)编译、连接,生成可执行程序文件( 10) 反复( 3) -( 4)步骤,直到完成( 11)硬件连接( 12)联调( 5)每个像素是怎么表示的?答: 0x00 表示暗像素点 0xff 表示亮像素点( 6)画线时,为什么要定义数组?答: 确定像素点的亮度与暗度。( 7)如何使显示的字符变亮?变暗?答:用十六进制从0-f,通过改变字符显示函数的第二个参数来改变亮度和暗度。(8)如何使显示的图形变亮?变暗?答:用十六进制从0-f,

4、通过改变字符显示函数的第二个参数来改变亮度和暗度(9)如何使显示的图形变宽?变窄?变高?变矮?答:通过改变显示图形函数 RIT128x96x4ImageDraw(buf, 18, 84, 162, 1)中的第 三个数,可变宽变窄,最后一个数,改变高瘦。(10)汉字如何显示?答:可用显示图形的方法进行字符拼接。二、实验目的和效果(效果即是否达到实验目的,达到的程度如何)目的:(1)初步学习、理解、掌握 OLED字符显示方法(2)初步学习、理解、掌握 OLED图形显示方法效果:(1)在OLED屏幕上分行显示自己的学号、姓名、项目序号、时间,(2) 在OLED屏幕上显示一条横线和竖线。(3)在OLE

5、D屏幕上显示三个5*7比例的字符图形(大、中、小各一个),每位同学根据附录1分配表查找自己应该显示的字符,每个字符显示效果见附录2。(4)扩展:在OLED屏幕上画一个型图案。(5)扩展:在OLED屏幕上画出自己的“姓”或“名”图案。三、实验内容和步骤(重点阐述自己的思路及遇到的问题)(一)建立项目(1)首先新建一个project(2)选择 CPU 本实验选 Luminary LM3S 8962(3)加载库文件(4)项目相关配置项修改(二)嵌入式C 程序开发(1)加载必要程序:本次实验提供了几个源程序 rit128x96x4.h , rit128x96x4.c ,startup.s 并且将这几个

6、文件复制到项目工作目录中。( 2)新建主函数程序,并加载到项目中( 3)开发主函数,完成基本显示功能(信息提示与直线)头文件有以下三个#include #include #include rit128x96x4.h( 4)开发主函数,完成拼接字符显示功能( 5)编译、连接,生成可执行程序文件( 6)反复(3) -( 4)步骤,直到完成(三)硬件连接( 1) 接上电源线, 先关闭开关( 2) 用蓝色 USB 线接上仿真器, 仿真器另一JTAG端接 LM3S8962 CPU 板(左下较大子板), USB 线接电脑( 3)确认连接无误后,打开电源开关(四)联调( 1)在 Keil uVision4

7、中执行下载,( Flash 菜单 -Download ),即可通过仿真器将(一)步编译链接好的执行程序下载到 LM3S8962 芯片内的 Flash 中。(2)按下实验箱上LM3s8962子板屏幕上方的白色按钮Reset键,即可查看程序执行效果。若有问题,返回第一步继续修改程序,编译、链接、下载,一直到显示出满意的效果。实验代码: 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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论