欢迎来到天天文库
浏览记录
ID:47238574
大小:777.38 KB
页数:13页
时间:2019-08-29
《100以内加法计算器》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、、实习目的增加学生对基本电子器件、单片机的感性认识,锻炼学生电路板布局、布线、电路组装、单片机程序编制、焊接与调试的动手能力,培养学生对电子的兴趣。二、实习任务1.硬件焊接(a)根据所给原理图完成单片机最小系统的焊接:单片机最小系统(供电,串口程序下载,晶振,复位电路)(b)将一下电路布线焊接,与单片机最小系统连接(1)4*4矩阵按键(2)双位数码管(3)8个LED灯(4)蜂鸣器2.程序软件设计三、电路板所实现的具体功能1•最小系统(1)4LED跑马灯:4个LED依次点亮,同时数码管显示对应LED灯的号码(动态显示00-01-02-03-04
2、),当第四号灯熄灭第一号灯亮起时,蜂鸣器响;(2)任意选取2个按键(矩阵按键扫描方式)按键1号按下跑马灯暂停,再次按下继续2号按键复位:按下按键使跑马灯从一号灯开始亮2.100以内加法计算器10按键代表数字0-9,1按键加,1按键减,一按键等号,一按键清除2位数码管显示当前输入数字,初始为00,按下数字按键输入一个0-99的数字按下加或减按键继续输入数字按下等号,数码管显示计算结果结果超过100,蜂鸣器响数码管和led显示溢出错误图样结果为负数,蜂鸣器响数码管和led显示负数错误图样四、电路板布局图布局图正面00009;00=282OOOOO
3、OOOQCOQCC4-w・000000000000004AOOOOOOOOOQOOQO->OOQQQJ*■oooo•OOOQC4.0:OOOQO:•:OOOOOA";00000&・*c000000-utlu」丿;>2700001$丿ooooerooooooooe、J:"oo•oo?•••比圧七C8ss2X5«5s®saMMBuMMs・4、ccoO0O2I2C工・6ooooDooo00^0©»b9eooQe^eee•■•:0e・f0=OQ・oo¥-00000^0oe^deooo■•OQb❻qqqqqo00^000❷OO6Con^-••oovoo^:•ioOQ•・oooe”"y^eeetooQoooo^^00000000CC^OQ005^.0PO^OQQOOPOOOOOC^MQQ^CCOO^ooc^o044怛q5、o・x传oooooooQcn•・❺。4K•o*o:・s浮$©000000000•coco・ofao^6、ovoooodoVOOOO&・」?g)v)ooowc6Q6"68e6•实足5o222ooqoocoooooooooooooooooo亍^^^o^o^no^odolwo^lfowoo7gsgggoqoocooooooooooooooooooYi«ie•:?^oooooooooooo•ooooopoo^©e^1“螯h一布局图背面五、电路板布线图©JDrawnBv1tua03nvixcivix曜£園9£日fa辰【£圄2d自一£0XM.D20x0OO一<•)r。八-CC*X<•1rv・■Cr-"、J££仁、£rjtL9oZ£ryLTL5cZzrjlr7、三a;Io-Ir-g<1222六、所有程序的程序流程图1・跑马灯路程图键盘扫描2•计算器流程图七、所有程序的代码1.跑马灯程序^include#defineunintunsignedint#defineuncharunsignedcharunchara,i,k,t,time,d=O,b=10,c,cnt=O,num=O,key1;sbitDl=P3A5;//!蜂鸣器sbitD2=P3A6;//数码管段选sbitD3=P3A7;sbitsl=PlA4;unsignedcharcodeled[]={0xfe,0xfd,0x8、fb,0xf7};unsignedcharcodeshuma[]={0xf3,0xa4,0xa2,0x63};〃延时50MS/tuncharkey;〃定义头文件vo
4、ccoO0O2I2C工・6ooooDooo00^0©»b9eooQe^eee•■•:0e・f0=OQ・oo¥-00000^0oe^deooo■•OQb❻qqqqqo00^000❷OO6Con^-••oovoo^:•ioOQ•・oooe”"y^eeetooQoooo^^00000000CC^OQ005^.0PO^OQQOOPOOOOOC^MQQ^CCOO^ooc^o044怛q
5、o・x传oooooooQcn•・❺。4K•o*o:・s浮$©000000000•coco・ofao^6、ovoooodoVOOOO&・」?g)v)ooowc6Q6"68e6•实足5o222ooqoocoooooooooooooooooo亍^^^o^o^no^odolwo^lfowoo7gsgggoqoocooooooooooooooooooYi«ie•:?^oooooooooooo•ooooopoo^©e^1“螯h一布局图背面五、电路板布线图©JDrawnBv1tua03nvixcivix曜£園9£日fa辰【£圄2d自一£0XM.D20x0OO一<•)r。八-CC*X<•1rv・■Cr-"、J££仁、£rjtL9oZ£ryLTL5cZzrjlr7、三a;Io-Ir-g<1222六、所有程序的程序流程图1・跑马灯路程图键盘扫描2•计算器流程图七、所有程序的代码1.跑马灯程序^include#defineunintunsignedint#defineuncharunsignedcharunchara,i,k,t,time,d=O,b=10,c,cnt=O,num=O,key1;sbitDl=P3A5;//!蜂鸣器sbitD2=P3A6;//数码管段选sbitD3=P3A7;sbitsl=PlA4;unsignedcharcodeled[]={0xfe,0xfd,0x8、fb,0xf7};unsignedcharcodeshuma[]={0xf3,0xa4,0xa2,0x63};〃延时50MS/tuncharkey;〃定义头文件vo
6、ovoooodoVOOOO&・」?g)v)ooowc6Q6"68e6•实足5o222ooqoocoooooooooooooooooo亍^^^o^o^no^odolwo^lfowoo7gsgggoqoocooooooooooooooooooYi«ie•:?^oooooooooooo•ooooopoo^©e^1“螯h一布局图背面五、电路板布线图©JDrawnBv1tua03nvixcivix曜£園9£日fa辰【£圄2d自一£0XM.D20x0OO一<•)r。八-CC*X<•1rv・■Cr-"、J££仁、£rjtL9oZ£ryLTL5cZzrjlr
7、三a;Io-Ir-g<1222六、所有程序的程序流程图1・跑马灯路程图键盘扫描2•计算器流程图七、所有程序的代码1.跑马灯程序^include#defineunintunsignedint#defineuncharunsignedcharunchara,i,k,t,time,d=O,b=10,c,cnt=O,num=O,key1;sbitDl=P3A5;//!蜂鸣器sbitD2=P3A6;//数码管段选sbitD3=P3A7;sbitsl=PlA4;unsignedcharcodeled[]={0xfe,0xfd,0x
8、fb,0xf7};unsignedcharcodeshuma[]={0xf3,0xa4,0xa2,0x63};〃延时50MS/tuncharkey;〃定义头文件vo
此文档下载收益归作者所有