【正文】
沒有一個完好的計劃,做事情就會沒有一個好的順序,做事情會比較亂,很難成功。 //寫保護}5 安裝調試 硬件組裝前首先要仔細核對硬件系統(tǒng)設計原理的正確性,包括參數(shù)選用的正確性和原理的正確性,對沒有把握的電路可以通過在通用實驗板上直接焊接實際電路來進行實物調試和驗證,調試分為斷電調試和通電調試。 while (n) { *p++ = DS1302_ReadData(addr)。}/**************************************寫入初始時間**************************************/void DS1302_SetTime(unsigned char *p){ unsigned char addr = 0x80。 SCLK = 0。 Delay()。 //送出到端口 SCLK = 1。 //延時等待 } return dat。 for (i=0。x0。 while(ms) { for(i = 0。 delay(5)。 write_date(0x30+shi)。LCD_wr=0。sbit LCD_EN = P1^5。 //sbit RST = P1^2。由于蜂鳴器的工作電流一般比較大,以致于單片機的I/O 口是無法直接驅動的,所以要利用放大電路來驅動,一般使用三極管來放大電流就可以了。 在單片機應用的設計上,很多方案都會用到蜂鳴器,大部分都是使用蜂鳴器來做提示或報警,比如按鍵按下、開始工作、工作結束或是故障等等。 TTL/CMOS數(shù)據(jù)從T1IN、T2IN輸入轉換成RS232數(shù)據(jù)從T1OUT、T2OUT送到電腦DB9插頭;DB9插頭的RS232數(shù)據(jù)從R1IN、R2IN輸入轉換成TTL/CMOS數(shù)據(jù)后從R1OUT、R2OUT輸出。圖33 LCD1602液晶顯示模塊MAX232芯片是美信公司專門為電腦的RS232標準串口設計的單電源電平轉換芯片,使用+5V單電源供電。圖32 復位電路與晶振電路液晶顯示器各種圖形的顯示原理:線段的顯示,點陣圖形式液晶由MN個顯示單元組成,假設LCD顯示屏有64行,每行有128列,每8列對應1字節(jié)的8位,即每行由16字節(jié),共168=128個點組成,屏上6416個顯示單元與顯示RAM區(qū)1024字節(jié)相對應,每一字節(jié)的內容和顯示屏上相應位置的亮暗對應。在對EFROM編程和程序驗證期間,它接收高8位地址。 STC12C5A16S2是一種帶4K字節(jié)存儲器的低電壓、高性能CMOS 8位微處理器,俗稱單片機.圖31 STC12C5A16S2管腳圖—(39—32)P0口是一個漏極開路型準雙向I/O口。 2 電子時鐘的設計流程在一個完整的鬧鐘系統(tǒng)的設計中,我們采用的是自頂向下的設計思想,整個系統(tǒng)由若干個模塊組合來實現(xiàn),包括計數(shù)模塊、控制模塊、譯碼模塊、動態(tài)掃描輸出模塊、鬧鐘控制模塊?!笆謩诱{整”可利用手動的節(jié)拍調準顯示時間。[關鍵詞] 定時鬧鐘 STC12C5A16S2 LCD16021共 2 頁 第 1 頁Time clock[Abstract] The regular alarm clock designers design, by the microcontroller STC12C5A16S2 chip and LCD1602 display、 DS18B20 , bined with the necessary circuitry to form a singlechip timer alarm clock. Clock can be digital circuit, the microcontroller can also be used to plete. LCD display when, sub, LED flash to do the second count, regular time to be able to sound an alarm or start relay to control the electrical start and stop. Now is the era of highly developed automation, especially electronic products are relying on the internal control circuitry to achieve control of the product to achieve the purpose of automatic operation, which requires us to do the design of electrical ponents and circuits to support . In this design it is mainly used to carry out regular AT89S51, but also bined with other auxiliary circuit implementation of the control, in time, when you click a control button on the hour plus one hour。LCD顯示“時”,“分”,LED閃動來做秒計數(shù),定時時間到能發(fā)出警報聲或者啟動繼電器,從而控制電器的啟停。隨著微電子技術的迅速發(fā)展,單片機功能也越來越強大,本設計基于STC單片機的電子時鐘技術,以STC12C5A16S2為核心,構成數(shù)字鐘,首先應選擇一個脈沖源——能自動地產(chǎn)生穩(wěn)定的標準時間脈沖信號?!±脤嶒為_發(fā)板上的液晶顯示屏,設計帶有鬧鐘及日期顯示功能的數(shù)字時鐘?!?3 系統(tǒng)硬件設計 STC12C5A16S2單片機教學用電子打鈴器主要由S