摘要
本设计是一个基于单片机AT89S51的简易电子台历,附有复位电路,时钟电路,键盘电路。复位电路是单片机的初始化操作,除了正常的初始化外,当程序运行出错后或者操作失误使系统进入死锁状态时,为摆脱困境,也需要能够通过独立式键盘电路进行启动,调整,再运行,时钟电路采用12MHZ的晶振,作为系统的时钟源,具有较高的准确性。
在上电或者复位时数码管显示年,月,日,时,分,秒。A键用于模式调整,形成一个循环,按一次键,即对秒调整。再按一次对分调整,如此循环。B键用于按下A键之后进行加1的操作,按一次加1,C键用于减1的操作,按一次减1。能够完成从00时00分00秒到23时59分59秒的循环计时,过23时59分59秒,日期增加1,当日期达到1个月后,月进位1,满12个月后,年进位1,年的首2位保持不变,始终为20。单片机并行口的电子台历的设计在AT89S51的P0口和P2口外接由14个LED数码管(LED7~LED0)构成的显示器,用P0口作LED的段码输出口(~~dp),~(~~LED0),~,P3口外接三个按键A、B、C(~)。数码管为4位一体的共阳极的数码管,数码管采用动态扫描法,从右往左依次点亮,显示数字。
关键字:单片机、电子台历、数码管
ABSTRACT
The design is a single electrical calendar basing SCMC of AT89S51. There are restoration circuit, clock circuit and keyboard circuit. Restoration circuit is used as an original operation, besides normal start-up, when the program runs mistakenly and system loses its order ,in order to get rid of the trouble, it also need to restart ,adjust and run through keyboard. Clock circuit uses 12MHZ Crystal as the source of the calendar ,with a high accuracy.
When the system starts, the display shows year, month ,day, week and time the A keyboard is used to start and adjust, the B keyboard is used to add 1,when press it ,the date will add 1, the C keyboard is used to minus 1, when press it , the date will minus can make a cycle from 00:00 to 23:59: display includes 14 LEDS, the SCMC joins the display in the P1, P0 ports and P2 ports, the SCMC joins the keyboards in the P3 scan, lighting the LEDS from right to left , showing the numbers.
Keywords: SCMC, Calendar LED
目录
第1章前言 2
第2章电子台历方案介绍及结构图 3
方案1 介绍 3
方案2介绍 4
4
电子台历工作原理 5
实现时钟计时的基本方法 5
电子台历的显示 5
电子台历的启、停及时间调整 5
第3章硬件电路单元电路的设计 5
电源电路 5
时钟电路 6
复位电路 6
键盘/显示接口电路 6
第4章软件系统的设计 7
结论 10
参考文献 11
附录1 电子台历整机原理图 11
附录2 PCB原理图 12
第1章前言
在修完本学期的课程,经历了单片机课程设计后,为了更好地检测自己的水平,进一步巩固知识,增强应用能力,进行了此次课程设计,我们选定的课题为基于单片机的电子台历的设计。
本次设计的目的在于
基于51单片机的电子台历的设计 来自淘豆网m.daumloan.com转载请标明出处.