资源描述:
《基于PROTEUS 的单片机系统设计与仿真实例 教学课件 作者 蒋辉平 周国雄 第4章(1).ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、09DQ4第4章 AT89C51单片机的外围09DQ4第4章 AT89C51单片机的外围09DQ4第4章 AT89C51单片机的外围4.1 点阵LED显示的应用4.1.1 点阵LED简介4.1.2 汇编语言源程序4.1.3 C语言源程序4.1.4 点阵LED显示的应用仿真效果图4.2 LCD1602的应用4.2.1 LCD1602简介4.2.2 汇编语言源程序4.2.3 C语言源程序4.2.4 LCD1602的应用仿真效果图4.3 8255A可编程并行I/O口的应用4.3.1 8255A简介4.3.2 8255A输入口的应用09DQ4第4章 AT89C51单
2、片机的外围4.3.3 8255A输出口的应用4.4 ADC0808A/D转换器的应用4.4.1 ADC0808简介4.4.2 汇编语言源程序09DQ44.1 点阵LED显示的应用4.1.1 点阵LED简介4.1.2 汇编语言源程序4.1.3 C语言源程序4.1.4 点阵LED显示的应用仿真效果图09DQ44.1.1 点阵LED简介图4-1 共阳LED阵列结构09DQ44.1.2 汇编语言源程序图4-2 程序流程图09DQ44.1.3 C语言源程序#include<reg51.h>unsigned char code tab[]={0x01,0x02,0x04
3、,0x08,0x10,0x20,0x40,0x80};unsigned char code digittab[16][8]={{0x1C,0x22,0x22,0x22,0x22,0x22,0x22,0x1C},∥0{0x08,0x0C,0x08,0x08,0x08,0x08,0x08,0x1C},∥1{0x1C,0x22,0x22,0x10,0x08,0x04,0x02,0x3E},∥2{0x1C,0x22,0x20,0x18,0x20,0x20,0x22,0x1C},∥3{0x10,0x18,0x14,0x14,0x12,0x3C,0x10,0x38},∥
4、4{0x3E,0x02,0x02,0x1E,0x20,0x20,0x20,0x1C},∥5{0x1C,0x22,0x02,0x1E,0x22,0x22,0x22,0x1C},∥6{0x3E,0x12,0x10,0x08,0x08,0x08,0x08,0x08},∥7{0x1C,0x22,0x22,0x1C,0x22,0x22,0x22,0x1C},∥8{0x1C,0x22,0x22,0x22,0x3C,0x20,0x22,0x1C},∥9{0x08,0x08,0x18,0x14,0x14,0x3C,0x24,0x66},∥A{0x1E,0x24,0x24,0
5、x1C,0x24,0x24,0x24,0x1E},∥B{0x3C,0x22,0x02,0x02,0x02,0x02,0x22,0x1C},∥C{0x1E,0x24,0x24,0x24,0x24,0x24,0x24,0x1E},∥D{0x3E,0x24,0x14,0x1C,0x14,0x04,0x24,0x3E},∥E{0x3E,0x24,0x14,0x1C,0x14,0x04,0x04,0x0E},∥F};09DQ44.1.3 C语言源程序unsigned char times;unsigned char col;unsigned char num;unsi
6、gned char tag;void delay(unsigned int i)∥延时程序{unsigned int j;for(j=0;j<i;j++);}void main(void){for(num=0;num<16;num++){for(times=0;times<200;times++){for(col=0;col<8;col++)}}}}09DQ44.1.4 点阵LED显示的应用仿真效果图图4-3 点阵LED显示的应用仿真效果图09DQ44.2 LCD1602的应用4.2.1 LCD1602简介4.2.2 汇编语言源程序4.2.3 C语言源程序4
7、.2.4 LCD1602的应用仿真效果图09DQ44.2.1 LCD1602简介1.LCD1602的引脚2.LCD1602的应用09DQ44.2.1 LCD1602简介图4-4 LCD字符型显示器外形和引脚排列、名称09DQ41.LCD1602的引脚1)GND——供电电源地。2)VCC——供电电源正输入端(+5V)。3)Vo——液晶显示器对比度调整。4)RS——寄存器选择输入。5)R/——读写信号线。6)E——命令使能端。7)DB0~DB7(或D0~D7)——8位双向数据线。8)BL1和BL2——背光板工作电压的输入端。09DQ42.LCD1602的应用表4
8、-1 LCD字符型显示器模块的指令集表4-2 DDR