1、 单片机技术课程设计说明书单片机技术课程设计说明书 数 字 电 子 钟 院 、 部: 电气与信息工程学院 学生姓名: 指导教师: 职称 副教授 专 业: 自动化 班 级: 完成时间: I 摘 要 电子钟在生活中应用非常广泛,而一种简单方便的数字电子钟则更能受到人们 的欢迎。 所以设计一个简易数字电子钟很有必要。 本电子钟采用ATMEL公司的AT89S52 单片机为核心,使用 12MHz 晶振与单片机 AT89S52 相连接,通过软件编程的方法实 现以 24 小时为一个周期, 同时 8 位 7段 LED 数码管(两个四位一体数码管)显示小时、 分钟和秒的要求,并在计时过程中具有定时功能,当时间到
2、达提前定好的时间进行蜂 鸣报时。该电子钟设有四个按键 K1、K2、K3 和 K4 键,进行相应的操作就可实现校时、 定时、复位功能。具有时间显示、整点报时、校正等功能。走时准确、显示直观、 运行稳定等优点。具有极高的推广应用价值。 关键词 电子钟;AT89S52;硬件设计;软件设计 ABSTRACT Clock is widely used in life, and a simple digital clock is more welcomed by people. So to design a simple digital electronic clock is necessary.The
3、system use a single chip AT89S52 of ATMELs as its core to control The crystal oscillator clock,using of E-12MHZ is connected with the microcontroller AT89S52, through the software programming method to achieve a 24-hour cycle, and eight 7-segment LED digital tube (two four in one digital tube) displ
4、ays hours, minutes and seconds requirements, and in the time course of a timing function, when the time arrived ahead of scheduled time to buzz a good timekeeping. The clock has four buttons K1, K2, K3 and K4 key, and make the appropriate action can be achieved when the school, timing, reset. With a
5、 time display, alarm clock settings, timer function, corrective action. Accurate travel time, display and intuitive, precision, stability, and so on. With a high application value. Key words Electronic clock;;AT89S52;Hardware Design;Software Design II 目目 录录 1 设计课题任务、功能要求说明及方案介绍1 1.1 设计课题任务1 1.2 功能要求说明1 1.3 设计总体方案介绍及原理说明1 2 设计课题硬件系统的设计2 2.1 设计课题硬件系统各模块功能简要介绍2 2.2 设计课题电路原理图、PCB 图、元器件布局图 2 2.3 设计课题元器件清单3 3 设计课题软件系统的设计5 3.1 设计课题使用单片机资源的情况5 3.2 设计课题软件系统各模块功能简要介绍5 3.3 设计课题软件系统程序流程框图5 3.4 设计课题软件系统程序清单9 4 设计结论、仿真结果、误差分析、教学建议