摘要
本设计使用12MHZ晶振与单片机AT89C51相连接,以AT89C51芯片为核心,采用动态扫描方式显示,通过使用该单片机,加之在显示电路部分使用7407驱动电路,实现在6个LED数码管上显示日期、时间、定时、闹铃,通过6个按键实现设置日期、进行调时、设定闹铃、倒计时等功能,在实现各功能时数码管进行相应显示,闹铃或定时时间到时蜂鸣器响,按下闹铃键或定时键时,声音停止。软件部分用汇编实现,分为显示、延迟、调时、闹铃、定时、调整日期等部分。通过软硬件结合达到最终目的。
关键词: 电子钟单片机动态扫描汇编语言
Abstract
This design uses a 12 MHZ crystal to connect with the machine AT89C51, takes AT89C51 chips as core. It adopts the dynamic state of the scanning method to show. Using this MCU and 7407 drive electric circuit, we are able to show date, time, fix the time, make bell on 6 LED figures tubes. We can use 6 key to constitute date, adjust time, enact the bell and set the countdown timer. When the electric carrying out each function, the figures tube show the tight function .When the alarm clock and the countdown timer were reached, the voice begins. While 3 or 4 is pressed, the voice stops. The software part is realized by assembler language. It was divided into to show, delay, adjust, make bell, in fixed time, adjust date etc. part. We get the end bining the software and the hardware.
Keywords: Electric clock MCU Dynamic state scaning assembler language
目录
1 引言 1
2 整体设计思路 3
3 主要元件的使用方法 4
AT89C51单片机: 4
7407驱动器: 5
: 6
4 电路设计 7
7
分块设计 7
输入部分 7
输出部分(显示电路) 8
晶振与复位电路: 9
5 程序设计 9
9
10
11
11
中断服务子程序: 11
主程序 13
13
闹铃程序和定时程序 14
14
6 功能仿真 15
软件介绍 15
15
15
: 16
16
17
7 实际电路的实现 18
8 日历功能的实现 20
9 电子钟设计中遇到的问题及其解决方法 23
结论 25
参考文献 26
致谢 28
附录A 整体电路图 29
附录B 完整程序 30
1 引言
单片机因将其主要组成部分集成在一个芯片上而得名,就是把中央处理器、随机存储器、只读存储器、中断系统、定时器/计数器以及I/O接口电路等部件集成在一个芯片上[1]。
单片机自20世纪70年代问世以来,以其极高的性能价格比,受到人们的重视和关注,应用很广、发展很快。单片机具有体积小、功能多、价格低廉、使用方便、系统设计灵活等优点[2]。因此,它应用广泛前景美好,它的实用性大大地提高了我对毕业设计的兴趣。
在我国,单片机的开发应用已有15年左右,已经形成一支庞大的技术开发队伍,为我国单片机应用积累了丰富的经验。随着电子技术、计算机芯片技术和微电子技术的飞速发展促进了单片机技术一日千里的变化[3]。
随着半导体技术的飞速发展,以及移动通信、网络技术、多媒体技术在嵌入式系统设计中的应用,单
单片机课程设计--基于单片机的LED显示电子钟设计 来自淘豆网m.daumloan.com转载请标明出处.