1、 单片机技术课程设计说明书单片机技术课程设计说明书 数 字 电 子 钟 1 摘 要 电子钟在生活中应用非常广泛,而一种简单方便的数字电子钟则更能受到人们的欢迎。所以设 计一个简易数字电子钟很有必要。 本电子钟采用ATMEL公司的AT89S52单片机为核心, 使用12MHz 晶 振与单片机 AT89S52 相连接,通过软件编程的方法实现以 24 小时为一个周期, 同时 8 位 8 段 LED 数 码管(两个四位一体数码管)显示小时、分钟和秒的要求,并在计时过程中具有定时功能,当时间到 达提前定好的时间进行蜂鸣报时。该电子钟设有四个按键 S1、S2、S3 和 S4 键,进行相应的操作就 可实现校时
2、、定时、复位功能。具有时间显示、整点报时、校正等功能。走时准确、显示直观、运 行稳定等优点。具有极高的推广应用价值。 关键词 电子钟;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 system use a single chip AT89S52 of ATMELs as its core to
3、 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 8-segment LED digital tube (two four in one digital tube) displays hours, minutes and seconds requirements, and in the t
4、ime course of a timing function, when the time arrived ahead of scheduled time to buzz a good timekeeping. The clock has four buttons S1, S2, S3 and S4 key, and make the appropriate action can be achieved when the school, timing, reset. With a time display, alarm clock settings, timer function, corr
5、ective 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 目目 录录 2 1 设计课题任务、功能要求说明及方案介绍1 1.1 设计课题任务 1 1.2 功能要求说明 1 1.3 设计总体方案介绍及原理说明 1 2 设计课题硬件系统的设计 2 2.1 设计课题硬件系统各模块功能简要介绍 2 2.2 设计课题电路原理图、PCB图、元器件布局图2 2.3 设计课题元器件清单 3 3 设计课题软件系统的设计4 3.1 设计课题使用单片机资源的情况 4 3.2 设计课题软件系统各模块功能简要介绍 4 3.3 设计课题软件系统程序流程框图 5 3.4 设计课题软件系统程序清单 8 4 设计结论、仿真结果、误差分析、教学建议 19 4.1 设计课题的设计结论及使用说明19 4.2 设计课题的仿真结果19 4.3