版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p> With the improvement of people's living standard and life rhythm accelerate, the time requirements of increasingly high, precision digital timing consumption demand is increasing. </p><p> Th
2、e production of electronic calendar has many kinds, general to study of multi-function electronic calendar, the calendar in addition to the original display time, date and other basic functions, also has the alarm, alarm
3、 and other functions. Business production of electronic calendar from the quality, price, and practical considerations, constantly improve the design of the electronic perpetual calendar, making it more with the market.&
4、lt;/p><p> The design for the software, hardware with a combination of a set of design. In software design, the hardware part should have relevant knowledge, which helps to design a deeper understanding, contr
5、ibute to software design. Basic to understand some of the main devices of the basic functions and role. In addition to using integrated clock chip, and adopts the scheme of MCU, using AT89series single-chip microcomputer
6、 made perpetual calendar circuit, use a combination of hardware and software metho</p><p> 1 design schemes</p><p> This article proposed one kind based on the AT89C51MCU calendar design, the
7、program to AT89C51single-chip microcomputer as a controlling core, and the clock chip DS1302, keyboard, LED display modules and hardware system. In the hardware system with a separate keyboard and LED display, can displa
8、y a wealth of information, according to the needs of users at any time on time calibration, choice of time, to sum up this calendar is convenient, intuitive display, multiple functions, simple circuit, lo</p><
9、p> 2 functional requirements</p><p> Electronic calendar can dynamically display the year, month, day, week, hour, minute, second.</p><p> 3 technical feasibility</p><p> Wit
10、h the domestic large scale integrated circuits, the microprocessor and its peripheral chip had rapid development. Integrated technology most recent development is one of the CPU and peripheral chips, such as program memo
11、ry, data memory, parallel I/O port, serial I/O port, timer / counter, an interrupt controller and other control components are integrated in a chip, made of monolithic computer ( Single-Chip Microcomputer ). But in recen
12、t years the introduction of some high-end chip also inclu</p><p> The 4 chip select</p><p> The main control chip using51 Series MCU clock chip using AT89C51, American DALLAS company introduce
13、d a high performance, low power consumption, with the RAM real-time clock DS1302. Using DS1302 as the timing chip, can achieve accurate timing. More importantly, DS1302can be in a very small current back-up power supply
14、(2.5~ 5.5V power supply,2.5V power consumption less than 300nA), and DS1302</p><p> Can be programmed to select a variety of charging current to power for slow charge, can guarantee the basic power backup p
15、ower supply.</p><p> Display driver using MAX7219, MAX7219 is a microprocessor and a common cathode eight eight LED digital tube display, graph bar / column chart displays or64 dot matrix display interface
16、small serial input / output chip. Sheet including BCD decoder, multiple scan controller, word and bit drive and 8x 8static RAM. External resistor only need one set all LED displays current field. MAX7219 and microprocess
17、or only three wires to connect, each show has an address by the digital microprocessor write. A</p><p> The 5 display driver MAX7219</p><p> (1) MAX7219 and single chip computer is connected w
18、ith three wires ( DIN, CLK, LOAD ), using16 bit data serial shift receiving mode</p><p> (2) eight LED display, graph bar / column chart displays or64 dot matrix display</p><p> (3) including
19、a BCD decoder, multiple scan controller, word and bit drive and 8x 8static RAM</p><p> (4) may choose to shutdown mode, the digital brightness control, from 1 to8to select the scan number and LED displays f
20、or all the test mode</p><p> (5) can drive8LED display</p><p> (6) the internal RAM address 01~ 08H respectively corresponding to DIG0 ~DIG7.</p><p> (7) scan register ( address:
21、0BH ) the register in the D0 ~ D3 bits of data of the set value is 0 ~ 7H, set the value of said display dynamic scanning digital from 1 to8.</p><p> (8) stop register ( address:0CH ) when D0=0, MAX721is in
22、 a halt state; when D0=1, in a normal working state.</p><p> (9) showed the test register ( address:0FH ) when D0=0, MAX7219according to a set pattern in normal work; when D0=1, in beta status. In this stat
23、e, regardless of the MAX7219in what mode, all of the LED will be the maximum brightness display.</p><p> (10) the brightness register ( address:0AH ) luminance can use the hardware and software of the two m
24、ethods to regulate brightness registers in the D0 ~D3can control LED display.</p><p> LED display register by an internal8x 8static RAM, the operator can direct positioning of individually addressable regis
25、ter, to refresh and keep the data, as long as more than 2 V ( V + for + 5V ).</p><p> Control register includes: decoding mode, display brightness adjustment, scan limits ( select scan digits), shutdown and
26、 display the test register.</p><p> 6 DS1302working mode and data operation principle</p><p> DS1302can be years, months, days, weeks, when, minutes and seconds for time, and has a leap year c
27、ompensation function, wide voltage up to 2.5~5.5V. Using a three wire interface synchronization with CPU communication, and may use a burst mode a transmission of multiple byte clock signal or RAM data. DS1302has a33x8fo
28、r temporary storage of data RAM register. DS1302 is a DS1202 upgrade products, compatible with DS1202, but the increase of main power supply dual power supply pins / back to back, wh</p><p> DS1302 clock ch
29、ip includes a real time clock / calendar and31 bytes of static RAM. It passes through a simple serial interface and communication. Real time clock / calendar with seconds, hours, days, weeks, months and years of informat
30、ion. For less than 31days at the end of the month and the date is automatically adjusted, also includes a leap year correction function. The operation of the clock can be used with AM/PM24< > or12 hour format. Usin
31、g a three wire interface synchronization with CPU c</p><p> DS1302 in any transmission of data must be initialized, the RST foot placement is high, then the8 bits of the address and command words into the s
32、hift register, the data at the rising edge of SCLK was access to. At the beginning of the 8clock cycle, the command byte loaded into the shift register, another clock cycle during a read operation when the output data, i
33、n a write operation for writing data. The number of clock pulses in single byte mode for8+8, in multiple byte mode for8+ bytes, the ma</p><p> DS1302 total of12 registers, which has 7registers and calendar,
34、 clock, stored data bits for BCD code.</p><p> Clock seconds pause: register bit7bit clock pause a definition. When it is 1, DS1302stops oscillating, entering the low power backup, usually in the DS1302writ
35、e operation (such as entering a clock adjustment procedures ), oscillation stopped. When it is 0, the clock will start.</p><p> AM-PM/12-24hour: hour register bit7is defined as 12or 24hour mode select bit.
36、It is in high level,12hour. In this way, a5 for the second10 hours of bits (20 ~ 23h).</p><p> The crystals DS1302choose 32768Hz, capacitor recommended values for6pF. Because of low frequency, can also be c
37、onnected capacitor, the timing precision effect.</p><p> The 7ending</p><p> When I finally finished all the typing, typesetting, proofreading, drawing the task after all very tired, but at th
38、e same time looking at the computer screen graduation design manuscript my heart is sweet, I feel it all worth it.</p><p> I will never forget this unforgettable several months. I am here to find informatio
39、n on the day, in the face of countless books list, the most memorable is each time finding information on the thrill and excitement. I'm from data collection, to master a lot of microcomputer and its interface applic
40、ation knowledge, let me for what I have learned to consolidate and improve, and let me on the SCM new technology knowledge. Throughout the process, I learned new knowledge, the growth of knowledge. In </p><p&g
41、t; Stand on solid ground, serious learning attitude, seek truth from facts, not afraid of difficulties, unremittingly, hard-working spirit is my in this design the maximum benefits. I think this is a willpower, is to my
42、 actual ability of a promotion, also for my future study and work of great help.</p><p> 隨著人們生活水平的提高和生活節(jié)奏的加快,對時間的要求越來越高,精準數(shù)字計時的消費需求也是越來越多。 </p><p> 我國生產(chǎn)的電子萬年歷有很多種,總體上來說以研究多功能電子萬年歷為主,使萬年歷除了原有的
43、顯示時間,日期等基本功能外,還具有鬧鈴,報警等功能。商家生產(chǎn)的電子萬年歷更從質(zhì)量,價格,實用上考慮,不斷的改進電子萬年歷的設(shè)計,使其更加的具有市場。</p><p> 本設(shè)計為軟件,硬件相結(jié)合的一組設(shè)計。在軟件設(shè)計過程中,應(yīng)對硬件部分有相關(guān)了解,這樣有助于對設(shè)計題目的更深了解,有助于軟件設(shè)計?;镜囊私庖恍┲饕骷幕竟δ芎妥饔?。 除了采用集成化的時鐘芯片外,還有采用MCU的方案,利用AT89系列單片微
44、機制成萬年歷電路,采用軟件和硬件結(jié)合的方法,控制LED數(shù)碼管輸出,分別用來顯示年、月、日、時、分、秒,其最大特點是:硬件電路簡單,安裝方便易于實現(xiàn),軟件設(shè)計獨特,可靠。AT89C51是由ATMEL公司推出的一種小型單片機。95年出現(xiàn)在中國市場。其主要特點為采用Flash存貯器技術(shù),降低了制造成本,其軟件、硬件與MCS-51完全兼容,可以很快被中國廣大用戶接受?! ?本文介紹了基于AT89C51單片機設(shè)計的電子萬年歷。</p>
45、;<p><b> 1 設(shè)計方案</b></p><p> 本文提出了一種基于AT89C51單片機的萬年歷設(shè)計方案,本方案以AT89C51單片機作為主控核心,與時鐘芯片DS1302、按鍵、LED顯示等模塊組成硬件系統(tǒng)。在硬件系統(tǒng)中設(shè)有獨立按鍵和LED顯示器,能顯示豐富的信息,根據(jù)使用者的需要可以隨時對時間進行校準、選擇時間等,綜上所述此萬年歷具有讀取方便、顯示直觀、功能多樣
46、、電路簡潔、成本低廉等諸多優(yōu)點,符合電子儀器儀表的發(fā)展趨勢,具有廣闊的市場前景。</p><p><b> 2 功能要求</b></p><p> 電子萬年歷能動態(tài)顯示年、月、日、星期、小時、分鐘、秒。</p><p><b> 3. 技術(shù)可行性</b></p><p> 隨著國內(nèi)超大規(guī)模集
47、成電路的出現(xiàn),微處理器及其外圍芯片有了迅速的發(fā)展。集成技術(shù)的最新發(fā)展之一是將CPU和外圍芯片,如程序存儲器、數(shù)據(jù)存儲器、并行I/O口、串行I/O口、定時/計數(shù)器、中斷控制器及其他控制部件集成在一個芯片之中,制成單片計算機(Single-Chip Microcomputer)。而近年來推出的一些高檔單片機還包括有許多特殊功能單元,如A/D、D/A轉(zhuǎn)換器、調(diào)制解調(diào)器、通信控制器、鎖相環(huán)、DMA、浮點運算單元、PWM控制輸出單元、PWM輸出時
48、的死區(qū)可編程控制功能等。因此,只要外加一些擴展電路及必要的通道接口就可以構(gòu)成各種計算機應(yīng)用系統(tǒng),如工業(yè)流水線控制系統(tǒng)、作為家用電器的主控制器、分布式控制系統(tǒng)的終端節(jié)點或作為其主控制節(jié)點起中繼的作用、數(shù)據(jù)采集系統(tǒng)、自動測試系統(tǒng)等。 單片機的出現(xiàn),并在各技術(shù)領(lǐng)域中得到如此迅猛的發(fā)展,與單片機構(gòu)成計算機應(yīng)用系統(tǒng)所形成的下述特點有關(guān): (1)單片機構(gòu)成的應(yīng)用系統(tǒng)有較大的可靠性。這些可靠性的獲得除了依靠單片機芯片本身的高可靠性以及應(yīng)用有
49、最少的聯(lián)接外,還可以方便地采用軟、硬件技術(shù)。 ?。?)系統(tǒng)擴展、系統(tǒng)配置較典型、規(guī)范,容易構(gòu)成各種規(guī)</p><p><b> 4 芯片選擇</b></p><p> 主控芯片使用51系列AT89C51單片機,時鐘芯片使用美國DALLAS公司推出的一種高性能、低功耗、帶RAM的實時時鐘DS1302。采用DS1302作為計時芯片,可以做到計時準確。更重要的是,DS
50、1302可以在很小電流的后備電源(2.5~5.5V電源,再2.5V時耗電小于300nA),而且DS1302</p><p> 可以編程選擇多種充電電流來使電源進行慢速充電,可以保證后備電源基本不耗電。</p><p> 顯示驅(qū)動采用MAX7219,MAX7219 是微處理器和共陰極八段八位LED 數(shù)碼管顯示、圖條/柱圖顯示或64 點陣顯示接口的小型串行輸入/輸出芯片。片內(nèi)包括BCD 譯
51、碼器、多路掃描控制器、字和位驅(qū)動器和8×8 靜態(tài)RAM。外部只需要一個電阻設(shè)置所有LED 顯示器字段電流。MAX7219 和微處理器只需三根導(dǎo)線連接,每位顯示數(shù)字有一個地址由微處理器寫入。允許使用者選擇每位是BCD 譯碼或不譯碼。使用者還可選擇停機模式、數(shù)字亮度控制、從1~8 選擇掃描位數(shù)和對所有LED 顯示器的測試模式。顯示模塊采用普通的共陰極四位一體八段LED數(shù)碼管。</p><p> 5 顯示驅(qū)
52、動MAX7219</p><p> ?。?) MAX7219 和單片計算機連接有三條引線(DIN、CLK、LOAD),采用16 位數(shù)據(jù)串行移位接收方式</p><p> ?。?)八位LED 顯示、圖條/柱圖顯示或64 點陣顯示</p><p> (3) 包括BCD 譯碼器、多路掃描控制器、字和位驅(qū)動器和8×8 靜態(tài)RAM</p><p
53、> ?。?) 可選擇停機模式、數(shù)字亮度控制、從1~8 選擇掃描位數(shù)和對所有LED 顯示器的測試模式</p><p> (5) 最多能驅(qū)動8 位LED 顯示器</p><p> ?。?) 內(nèi)部RAM 地址01~08H 分別對應(yīng)于DIG0~DIG7。</p><p> (7) 掃描界限寄存器(地址0BH):該寄存器中D0~D3 位數(shù)據(jù)設(shè)定值為0~7H,設(shè)定值表
54、示顯示器動態(tài)掃描個數(shù)位1~8。</p><p> ?。?) 停機寄存器(地址0CH):當D0=0 時,MAX721 處于停機狀態(tài);當D0=1 時,處于正常工作狀態(tài)。</p><p> ?。?) 顯示測試寄存器(地址0FH):當D0=0時,MAX7219 按設(shè)定模式正常工作;當D0=1 時,處于測試狀態(tài)。在該狀態(tài)下,不管MAX7219 處于什么模式,全部LED 將按最大亮度顯示。</p
55、><p> ?。?0) 亮度寄存器(地址0AH):亮度可以用硬件和軟件兩種方法調(diào)節(jié)亮度寄存器中的D0~D3位可以控制LED 顯示。</p><p> LED 顯示寄存器由內(nèi)部8 × 8 靜態(tài)RAM 構(gòu)成,操作者可直接對位寄存器進行個別尋址, 以刷新和保持數(shù)據(jù), 只要V +超過2 V(一般為+ 5V)。 </p><p> 控制寄存器包括: 譯碼模式, 顯示
56、亮度調(diào)節(jié), 掃描限制(選擇掃描位數(shù)),關(guān)斷和顯示測試寄存器。</p><p> 6 DS1302的工作方式及數(shù)據(jù)操作原理</p><p> DS1302可以對年、月、日、星期、時、分、秒進行計時, 且具有閏年補償功能, 工作電壓寬達2.5~5.5V。采用三線接口與CPU進行同步通信, 并可采用突發(fā)方式一次傳送多個字節(jié)的時鐘信號或RAM數(shù)據(jù)。DS1302內(nèi)部有一個33x8的用于臨時性存
57、放數(shù)據(jù)的RAM寄存器。DS1302是的DS1202升級產(chǎn)品, 與DS1202兼容, 但增加了主電源/后背電源雙電源引腳, 同時提供了對后背電源進行涓細電流充電的能力。</p><p> DS1302時鐘芯片包括實時時鐘/日歷和31字節(jié)的靜態(tài)RAM。它經(jīng)過一個簡單的串行接口與微處理器通信。實時時鐘/日歷提供秒、分、時、日、周、月和年等信息。對于小于31天的月和月末的日期自動進行調(diào)整,還包括閏年校正的功能。時鐘的運
58、行可以采用24<小>時或帶AM/PM的12小時格式。采用三線接口與CPU進行同步通信,并可采用突發(fā)方式一次傳送多字節(jié)的時鐘信號或RAM數(shù)據(jù)。</p><p> DS1302在任何數(shù)據(jù)傳送時必須先初始化,把RST腳置為高電平,然后把8位地址和命令字裝入移位寄存器,數(shù)據(jù)在SCLK的上升沿被訪問到。在開始8個時鐘周期,把命令字節(jié)裝入移位寄存器后,另外的時鐘周期在讀操作時輸出數(shù)據(jù),在寫操作時寫入數(shù)據(jù)。時鐘脈
59、沖的個數(shù)在單字節(jié)方式下為8+8,在多字節(jié)方式下為8+字節(jié)數(shù),最大可達248字節(jié)數(shù)。如果在傳送過程中置RST腳為低電平,則會終止本次數(shù)據(jù)傳送,并且I/O引腳變?yōu)楦咦钁B(tài)。上電運行時,在Vcc≥2.5V之前,RST腳必須保持低電平。只有在SCLK為低電平時,才能將RST置為高電平。</p><p> DS1302共有12個寄存器,其中有7個寄存器與日歷、時鐘相關(guān),存放的數(shù)據(jù)位為BCD碼形式。</p>&
60、lt;p> 時鐘暫停:秒寄存器的位7定義位時鐘暫停位。當它為1時,DS1302停止振蕩,進入低功耗的備份方式,通常在對DS1302進行寫操作時(如進入時鐘調(diào)整程序),停止振蕩。當它為0時,時鐘將開始啟動。</p><p> AM-PM/12-24小時方式:小時寄存器的位7定義為12或24小時方式選擇位。它為高電平時,選擇12小時方式。在此方式下,位5為第二個10小時位(20~23h)。</p>
61、;<p> DS1302的晶振選用32768Hz,電容推薦值為6pF。因為振蕩頻率較低,也可以不接電容,對計時精度影響不大。</p><p><b> 7 結(jié)束語</b></p><p> 當我終于完成了所有打字、繪圖、排版、校對的任務(wù)后整個人都很累,但同時看著電腦熒屏上的畢業(yè)設(shè)計稿件我的心里是甜的,我覺得這一切都值了。</p>&l
62、t;p> 我不會忘記這難忘的幾個月的時間。在我徜徉書海查找資料的日子里,面對無數(shù)書本的羅列,最難忘的是每次找到資料時的激動和興奮。我從資料的收集中,掌握了很多單片機及其接口應(yīng)用的知識,讓我對我所學(xué)過的知識有所鞏固和提高,并且讓我對當今單片機的最新發(fā)展技術(shù)有所了解。在整個過程中,我學(xué)到了新知識,增長了見識。在今后的日子里,我仍然要不斷地充實自己,爭取在所學(xué)領(lǐng)域有所作為。</p><p> 腳踏實地,認真嚴
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電子萬年歷
- 電子萬年歷設(shè)計
- 萬年歷課程設(shè)計--萬年歷電子時鐘
- 外文翻譯-基于單片機的電子萬年歷
- 電子萬年歷中英文翻譯---基于實時鐘芯片的電子萬年歷的設(shè)計
- 電子萬年歷畢業(yè)論文
- 電子萬年歷畢業(yè)設(shè)計
- 電子萬年歷畢業(yè)設(shè)計
- 電子萬年歷設(shè)計與制作
- 電子萬年歷畢業(yè)設(shè)計
- 基于cj萬年歷
- 萬年歷開題報告
- 課程設(shè)計報告--電子萬年歷
- 電子萬年歷畢業(yè)設(shè)計稿
- 畢業(yè)論文——電子萬年歷設(shè)計
- 電子萬年歷設(shè)計-畢業(yè)論文
- 電子萬年歷課程設(shè)計 (2)
- 電子萬年歷的設(shè)計與仿真
- 電子萬年歷設(shè)計報告書
- proteus課程設(shè)計--電子萬年歷
評論
0/150
提交評論