【正文】
SCLK 為低電平時(shí),才能將 RST 置為高電平。如果在傳送過程中 RST 置為低電平,則會(huì)終止此次數(shù)據(jù)傳送, I/O 引腳變?yōu)楦咦钁B(tài)。 RST 輸入有兩種功能:首先, RST接通控制邏輯,允許地址 /命令序列送入移位寄存器;其次, RST 提供終止單字節(jié)或多字節(jié)數(shù)據(jù)的傳送手段。 X1 和 X2是振蕩源,外接 晶振。當(dāng) Vcc2大于 Vcc1+ 時(shí), Vcc2 給 DS1302 供電。在主電源關(guān)閉的情況下, 也能保持時(shí)鐘的連續(xù)運(yùn)行。 DS1302是 DS1202 的升級(jí)產(chǎn)品,與 DS1202 兼容,但增加 了主電源 /后背電源雙電源引腳,同時(shí)提供了對(duì)后背電源進(jìn)行涓細(xì)電流充電的能力。采用三線接口與 CPU 進(jìn)行同步通信,并可采用突發(fā)方式一次傳送多個(gè)字節(jié)的時(shí)鐘信號(hào)或 RAM 數(shù)據(jù)。時(shí)鐘芯片的接口電路如圖 。系統(tǒng)結(jié)構(gòu)如圖 所示: 圖 系統(tǒng)框圖 時(shí)間 設(shè)置 電路 (按鍵) 時(shí)間) 單 片 機(jī) AT89C51 兩個(gè)六位八段數(shù)碼管 時(shí) 鐘 芯 片 DS1302 電 源 電 路 第二章 系統(tǒng)的硬件設(shè)計(jì) 時(shí)鐘接口電路設(shè)計(jì) 本電子萬年歷系統(tǒng)的重要部分在于時(shí)鐘模塊,這里選用串行日歷時(shí)鐘芯片 DS1302。整個(gè)系統(tǒng)的電源由 5V電池提供,以便于攜帶。 系統(tǒng)概述 系統(tǒng)由單片機(jī) AT89C51 為主控制器,單片機(jī)不斷讀取實(shí)時(shí)鐘 DS1302 提供的時(shí)間,送數(shù)碼管顯示。鍵盤輸入模塊采用獨(dú)立式按鍵電路:每個(gè)鍵單獨(dú)占有一根 I/O接口線,每個(gè) I/O口的工作狀態(tài)互不影響,此類鍵盤采用端口直接掃描方式,但是當(dāng)按鍵較多時(shí)占用單片機(jī)的 I/O數(shù)目較多。 完成對(duì)單片機(jī)送來的時(shí)間和日期進(jìn)行顯示。 設(shè)計(jì)方案 按照設(shè)計(jì)要求,整個(gè)系統(tǒng)可劃分為以下幾個(gè)模塊: 采用單片機(jī),對(duì)系統(tǒng)進(jìn)行初始化,主要完成對(duì)鍵盤的響應(yīng)、數(shù)碼管顯示等功能的控制,起到總控和協(xié)調(diào)各模塊之間工作的作用。 。在軟件上,采用 keil c51 軟件系統(tǒng),控制單元采用 匯編 語言編程;另外,從硬件和軟件上采取了多種措施提高系統(tǒng)的可靠性。 實(shí)用電子時(shí)鐘是一個(gè)時(shí)間控制系統(tǒng),既能作為一般的時(shí)間顯示器,同時(shí)可以根據(jù)需要擴(kuò)展其功能,擴(kuò)展為可顯示時(shí)間和日歷的電子萬年歷。 由于數(shù)字集成電路技術(shù)的發(fā)展和采用了先進(jìn)的石英技術(shù),使電子鐘具有走時(shí)準(zhǔn)確、性能穩(wěn)定、攜帶方便等優(yōu)點(diǎn),它還用于計(jì)時(shí)、自動(dòng)報(bào)時(shí)及自動(dòng)控制等各個(gè)領(lǐng)域。輸出設(shè)備顯示器可以用液晶顯示技術(shù)和數(shù)碼管顯示技術(shù)。但是卻很少知道它的內(nèi)部結(jié)構(gòu)以及工作 原理。多功能數(shù)字鐘不管在性能還是在樣式上都發(fā)生了質(zhì)的變化,有電子鬧鐘、數(shù)字鬧鐘等等。由于單片機(jī)具有靈活性強(qiáng)、成本低、功耗低、保密性好等特點(diǎn),所以電子日歷時(shí)鐘一般都以 DS1302 為核心,外加一些外圍設(shè)備來實(shí)現(xiàn)。在這快速發(fā)展的年代,時(shí)間對(duì)人們來說是越來越寶貴,在快節(jié)奏的生活時(shí),人們往往忘記了時(shí)間,一旦遇到重要的事情而忘記了時(shí)間,這將會(huì)帶來很大的損失 。 1 基于 DS1302 的電子萬年歷設(shè)計(jì) 專業(yè)班級(jí): 06 級(jí)通信 1 班 學(xué)生姓名: 指導(dǎo)教師: 職 稱:講師 摘 要: 現(xiàn)在是一個(gè)知識(shí)爆炸的新時(shí)代,新產(chǎn)品、新技術(shù)層出不窮,電子技術(shù)的發(fā)展更是日新月異??梢院敛豢鋸埖恼f,電子技術(shù)的應(yīng)用無處不在,電子技術(shù)正在不斷地改變我們的生活,改變著我們的世界。因此我們需要一個(gè)定時(shí)系統(tǒng)來提醒這些忙碌的人,而數(shù)字化的鐘表給人們帶來了極大的方便。 近些年,隨著科技的發(fā)展和社會(huì)的進(jìn)步,人們對(duì)數(shù)字鐘的要求也越來越高,傳統(tǒng)的時(shí)鐘已不能滿足人們的需求。單片機(jī)在多功能數(shù)字鐘中的應(yīng)用已是非常普遍的,人們對(duì)數(shù)字鐘的功能及工作順序都非常熟悉。由單片機(jī)作為數(shù)字鐘的核心控制器,可以通過它的時(shí)鐘信號(hào)進(jìn)行計(jì)時(shí)實(shí)現(xiàn)計(jì)時(shí)功能,將其時(shí)間數(shù)據(jù)經(jīng)單片機(jī)輸出,利用顯示器顯示出來,通過按鍵可以進(jìn)行定時(shí)、校時(shí)功能。 關(guān)鍵詞 : DS1302 實(shí)時(shí)鐘 萬年歷 The Design of The Simple Logic Controller Based on SCM Abstract: Now a new era of knowledge explosion, new products, new technologies emerge in endlessly, the development of electronic technology is changing. It is no exaggeration to say, electroni c technology applications everywhere, electronic technology is changing our life, and our world. In this fast development, the time is more precious to people in the fast pace of life, people often fotten when time, once encounter something important and fet time, this will bring great loss. So we need a regular system to remind those busy people, and digital clocks bring great convenience. Due to the microcontroller has flexibility, low cost, low power consumption, the secrecy is good wait for a characteristic, so the electronic calendar clocks are generally based on DS1302, plus some peripheral equipment to achieve. In recent years, with the development of science and technology and the progress of the society, the people of a digital clock higher requirements, the traditional clock already cannot satisfy the demands of the people. Multifunctional digital clock in performance or in style have undergone a qualitative change, electronic alarm clock, number, etc. Microputer in the multifunction digital clock application is very mon, and has the function of digital clock and work order is very familiar with. But few know its internal structure and work principle. By single chip microputer as the core controller, digital clock through its clock signal timing realize its function, the clock time data using SCM outputs, display, through the buttons can be regularly, school when function. Output devices with LCD monitors can display technology of digital technology and the pipe. Keywords: DS1302 calendar clock. 目 錄 引言 ?????????????????????????????? ????? 1 第一章 系統(tǒng)概述 ????????????????????????????? 2 設(shè)計(jì)要求 ??????????????????? ??????????? 2 設(shè)計(jì)方案 ????