预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共20页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

目录 实验一单片机仿真开发系统的使用····································································2 1.1KeilC51集成开发环境介绍···································································2 1.2用Proteus仿真软件················································································6 1.3实现单片机最小系统的简单应用。···························································8 实验二显示及驱动电路设计用···········································································10 实验三简单输入/输出实验················································································12 实验四外部中断的运用····················································································14 实验五单片机内部定时/计数器实验····································································15 实验六串行口通信设计····················································································17 实验七直流电机控制·······················································································18 实验八步进马达控制·······················································································19 实验一单片机仿真开发系统的使用 1.1KeilC51集成开发环境介绍 ①、运行keilC51编辑软件,软件界面如图1-1所示 ②、建立一个新的工程项目 单击Project菜单,在弹出的下拉菜单中选中NewProject选项 ③、保存工程项目 a、选择要保存的文件路径,输入工程项目文件的名称,如保存的路径为C51文件夹, 工程项目的名称为C51,如图所示,单击保存 b、为工程项目选择单片机型号 在弹出的对话框中选择需要的单片机型号,如图所示,这里选择51核单片机中使用较多的 89S51,选定型号后,单击确定,出现如图所示的开发平台界面 ④、新建源程序文件 在下图中单击“File”菜单,选择下拉菜单中的New选项,新建文件后得到如图的界面: 程序录入区域 ⑤、保存源程序文件 单击“File”菜单,选择下拉菜单中的Save选项,在弹出的对话框中选择保存的路径及 源程序的名称,如图所示。此时光标在编辑窗口里闪烁,这时可以键入用户的应用程序了, 建议首先保存该空白的文件,单击菜单上的“File”,在下拉菜单中选中“SaveAs”选项单 击,屏幕如下图所示,在“文件名”栏右侧的编辑框中,键入欲使用的文件名,同时必须键 入正确的.扩展名。注意,如果用C语言编写程序,则扩展名为(.c);如果用汇编语言编写程 序,则扩展名必须为(.asm)。然后,单击“保存”按钮 注意扩展名 ⑥、为工程项目添加源程序文件 在编辑界面中,单击“Target”前面的“+”,再在“SourceGroup”上单击右键,得到如图 所示的对话框,选择“AddFiletoGroup’SourceGroup1’”,弹出如图所示的对话框,选 中要添加的源程序文件,单击“Add”,得到如图所示的界面,同时,在“SourceGroup1” 文件夹中多了一个添加的“Text1.c”文件。 ⑦、输入源程序源程序输入完成后保存,得到如图所示的界面。程序中的关键字以不同的 颜色提示用户加以注意,这就是事先保存待编辑的文件的好处,即Keilc51会自动识别关键 字 ⑧、编译调试源程序 在上图中,单击Pro