【正文】
題目:基于單片機的電子鐘設(shè)計 摘要隨著科技的發(fā)展,單片機的應(yīng)用正在不斷深入,涉及到日常生活的方方面面。本設(shè)計是基于單片機AT89S51為控制核心,以液晶為顯示的數(shù)字時鐘。本數(shù)字時鐘設(shè)計的原理相對簡單,所以硬件電路也相對簡單,難點和重點主要放在C語言的編程上,使用到定時器的子程序、延時程序、時分秒的控制程序、液晶模塊和單片機模塊的初始化程序、液晶顯示的程序等,各個函數(shù)交叉調(diào)用,配合主程序的運行。關(guān)鍵字:LCD1602 AT89S51 定時器 AbstractWith the development of technology, SCM applications are deepening, involving all aspects of daily life. The design is based on the MCU AT89S52 for the control of the core, the liquid crystal display digital clock. The digital clock design principle is relatively simple, the hardware circuit is relatively simple, difficult, and focused mainly on the C programming language, use the timer subroutine, delay procedures, minutes and seconds of the control program, the LCD module and microcontroller module initialization procedures, procedures for liquid crystal display, crosseach function call, with the main program to run.Keywords: LCD1602 AT89S51 timer 目錄1 實驗任務(wù) 12 設(shè)計方案 1 硬件設(shè)計 1 1 控制模塊 1 顯示模塊 3 5 軟件設(shè)計 5 5 53 仿真與調(diào)試結(jié)果 54 心得體會 6附錄 7 附錄1 實物圖及說明 7 附錄2 程序流程圖 9 附錄3 程序清單 9 1 實驗任務(wù) 設(shè)計一個多功能LCD電子鐘。要求(1)能顯示年、月、日、星期、時、分、秒;(2)能對年、月、日、星期、時、分、秒進行預(yù)置;2 設(shè)計方案2.1 硬件設(shè)計 AT89S52單片機按鍵模塊LCD液晶顯示模塊復(fù)位電路晶振電路 控制模塊 a. LCD液晶屏顯示電路 顯示模塊 1602LCD主要技術(shù)參數(shù):顯示容量:162個字符芯片工作電壓:—工作電流:()模塊最佳工作電壓:字符尺寸:(WH)mm引腳功能說明:1602LCD采用標(biāo)準(zhǔn)的14腳(無背光)或16腳(帶背光)接口,各引腳接口說明如下表所示: 編號 符號 引腳說明 編號 符號 引腳說明 1 VSS 電源地 9 D2 數(shù)據(jù) 2 VDD 電源正極 10 D3 數(shù)據(jù) 3 VL 液晶顯示偏壓 11 D4 數(shù)據(jù) 4 RS 數(shù)據(jù)/命令選擇 12 D5 數(shù)據(jù) 5 R/W 讀/寫選擇 13 D6 數(shù)據(jù) 6 E 使能信號 14 D7 數(shù)據(jù) 7 D0 數(shù)據(jù) 15 BLA 背光源正極 8 D1 數(shù)據(jù) 16 BLK 背光源負(fù)極第1腳:VSS為地電源。第2腳:VDD接5V正電源。第3腳:VL為液晶顯示器對比度調(diào)整