版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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é)奏的加快,對(duì)時(shí)間的要求越來越高,精準(zhǔn)數(shù)字計(jì)時(shí)的消費(fèi)需求也是越來越多?! ?lt;/p><p> 我國(guó)生產(chǎn)的電子萬年歷有很多種,總體上來說以研究多功能電子萬年歷為主,使萬年歷除了原有的
43、顯示時(shí)間,日期等基本功能外,還具有鬧鈴,報(bào)警等功能。商家生產(chǎn)的電子萬年歷更從質(zhì)量,價(jià)格,實(shí)用上考慮,不斷的改進(jìn)電子萬年歷的設(shè)計(jì),使其更加的具有市場(chǎng)。</p><p> 本設(shè)計(jì)為軟件,硬件相結(jié)合的一組設(shè)計(jì)。在軟件設(shè)計(jì)過程中,應(yīng)對(duì)硬件部分有相關(guān)了解,這樣有助于對(duì)設(shè)計(jì)題目的更深了解,有助于軟件設(shè)計(jì)?;镜囊私庖恍┲饕骷幕竟δ芎妥饔??! 〕瞬捎眉苫臅r(shí)鐘芯片外,還有采用MCU的方案,利用AT89系列單片微
44、機(jī)制成萬年歷電路,采用軟件和硬件結(jié)合的方法,控制LED數(shù)碼管輸出,分別用來顯示年、月、日、時(shí)、分、秒,其最大特點(diǎn)是:硬件電路簡(jiǎn)單,安裝方便易于實(shí)現(xiàn),軟件設(shè)計(jì)獨(dú)特,可靠。AT89C51是由ATMEL公司推出的一種小型單片機(jī)。95年出現(xiàn)在中國(guó)市場(chǎng)。其主要特點(diǎn)為采用Flash存貯器技術(shù),降低了制造成本,其軟件、硬件與MCS-51完全兼容,可以很快被中國(guó)廣大用戶接受。 本文介紹了基于AT89C51單片機(jī)設(shè)計(jì)的電子萬年歷。</p>
45、;<p><b> 1 設(shè)計(jì)方案</b></p><p> 本文提出了一種基于AT89C51單片機(jī)的萬年歷設(shè)計(jì)方案,本方案以AT89C51單片機(jī)作為主控核心,與時(shí)鐘芯片DS1302、按鍵、LED顯示等模塊組成硬件系統(tǒng)。在硬件系統(tǒng)中設(shè)有獨(dú)立按鍵和LED顯示器,能顯示豐富的信息,根據(jù)使用者的需要可以隨時(shí)對(duì)時(shí)間進(jìn)行校準(zhǔn)、選擇時(shí)間等,綜上所述此萬年歷具有讀取方便、顯示直觀、功能多樣
46、、電路簡(jiǎn)潔、成本低廉等諸多優(yōu)點(diǎn),符合電子儀器儀表的發(fā)展趨勢(shì),具有廣闊的市場(chǎng)前景。</p><p><b> 2 功能要求</b></p><p> 電子萬年歷能動(dòng)態(tài)顯示年、月、日、星期、小時(shí)、分鐘、秒。</p><p><b> 3. 技術(shù)可行性</b></p><p> 隨著國(guó)內(nèi)超大規(guī)模集
47、成電路的出現(xiàn),微處理器及其外圍芯片有了迅速的發(fā)展。集成技術(shù)的最新發(fā)展之一是將CPU和外圍芯片,如程序存儲(chǔ)器、數(shù)據(jù)存儲(chǔ)器、并行I/O口、串行I/O口、定時(shí)/計(jì)數(shù)器、中斷控制器及其他控制部件集成在一個(gè)芯片之中,制成單片計(jì)算機(jī)(Single-Chip Microcomputer)。而近年來推出的一些高檔單片機(jī)還包括有許多特殊功能單元,如A/D、D/A轉(zhuǎn)換器、調(diào)制解調(diào)器、通信控制器、鎖相環(huán)、DMA、浮點(diǎn)運(yùn)算單元、PWM控制輸出單元、PWM輸出時(shí)
48、的死區(qū)可編程控制功能等。因此,只要外加一些擴(kuò)展電路及必要的通道接口就可以構(gòu)成各種計(jì)算機(jī)應(yīng)用系統(tǒng),如工業(yè)流水線控制系統(tǒng)、作為家用電器的主控制器、分布式控制系統(tǒng)的終端節(jié)點(diǎn)或作為其主控制節(jié)點(diǎn)起中繼的作用、數(shù)據(jù)采集系統(tǒng)、自動(dòng)測(cè)試系統(tǒng)等?! 纹瑱C(jī)的出現(xiàn),并在各技術(shù)領(lǐng)域中得到如此迅猛的發(fā)展,與單片機(jī)構(gòu)成計(jì)算機(jī)應(yīng)用系統(tǒng)所形成的下述特點(diǎn)有關(guān): (1)單片機(jī)構(gòu)成的應(yīng)用系統(tǒng)有較大的可靠性。這些可靠性的獲得除了依靠單片機(jī)芯片本身的高可靠性以及應(yīng)用有
49、最少的聯(lián)接外,還可以方便地采用軟、硬件技術(shù)。 ?。?)系統(tǒng)擴(kuò)展、系統(tǒng)配置較典型、規(guī)范,容易構(gòu)成各種規(guī)</p><p><b> 4 芯片選擇</b></p><p> 主控芯片使用51系列AT89C51單片機(jī),時(shí)鐘芯片使用美國(guó)DALLAS公司推出的一種高性能、低功耗、帶RAM的實(shí)時(shí)時(shí)鐘DS1302。采用DS1302作為計(jì)時(shí)芯片,可以做到計(jì)時(shí)準(zhǔn)確。更重要的是,DS
50、1302可以在很小電流的后備電源(2.5~5.5V電源,再2.5V時(shí)耗電小于300nA),而且DS1302</p><p> 可以編程選擇多種充電電流來使電源進(jìn)行慢速充電,可以保證后備電源基本不耗電。</p><p> 顯示驅(qū)動(dòng)采用MAX7219,MAX7219 是微處理器和共陰極八段八位LED 數(shù)碼管顯示、圖條/柱圖顯示或64 點(diǎn)陣顯示接口的小型串行輸入/輸出芯片。片內(nèi)包括BCD 譯
51、碼器、多路掃描控制器、字和位驅(qū)動(dòng)器和8×8 靜態(tài)RAM。外部只需要一個(gè)電阻設(shè)置所有LED 顯示器字段電流。MAX7219 和微處理器只需三根導(dǎo)線連接,每位顯示數(shù)字有一個(gè)地址由微處理器寫入。允許使用者選擇每位是BCD 譯碼或不譯碼。使用者還可選擇停機(jī)模式、數(shù)字亮度控制、從1~8 選擇掃描位數(shù)和對(duì)所有LED 顯示器的測(cè)試模式。顯示模塊采用普通的共陰極四位一體八段LED數(shù)碼管。</p><p> 5 顯示驅(qū)
52、動(dòng)MAX7219</p><p> ?。?) MAX7219 和單片計(jì)算機(jī)連接有三條引線(DIN、CLK、LOAD),采用16 位數(shù)據(jù)串行移位接收方式</p><p> (2)八位LED 顯示、圖條/柱圖顯示或64 點(diǎn)陣顯示</p><p> (3) 包括BCD 譯碼器、多路掃描控制器、字和位驅(qū)動(dòng)器和8×8 靜態(tài)RAM</p><p
53、> ?。?) 可選擇停機(jī)模式、數(shù)字亮度控制、從1~8 選擇掃描位數(shù)和對(duì)所有LED 顯示器的測(cè)試模式</p><p> ?。?) 最多能驅(qū)動(dòng)8 位LED 顯示器</p><p> ?。?) 內(nèi)部RAM 地址01~08H 分別對(duì)應(yīng)于DIG0~DIG7。</p><p> (7) 掃描界限寄存器(地址0BH):該寄存器中D0~D3 位數(shù)據(jù)設(shè)定值為0~7H,設(shè)定值表
54、示顯示器動(dòng)態(tài)掃描個(gè)數(shù)位1~8。</p><p> ?。?) 停機(jī)寄存器(地址0CH):當(dāng)D0=0 時(shí),MAX721 處于停機(jī)狀態(tài);當(dāng)D0=1 時(shí),處于正常工作狀態(tài)。</p><p> ?。?) 顯示測(cè)試寄存器(地址0FH):當(dāng)D0=0時(shí),MAX7219 按設(shè)定模式正常工作;當(dāng)D0=1 時(shí),處于測(cè)試狀態(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)成,操作者可直接對(duì)位寄存器進(jìn)行個(gè)別尋址, 以刷新和保持?jǐn)?shù)據(jù), 只要V +超過2 V(一般為+ 5V)。 </p><p> 控制寄存器包括: 譯碼模式, 顯示
56、亮度調(diào)節(jié), 掃描限制(選擇掃描位數(shù)),關(guān)斷和顯示測(cè)試寄存器。</p><p> 6 DS1302的工作方式及數(shù)據(jù)操作原理</p><p> DS1302可以對(duì)年、月、日、星期、時(shí)、分、秒進(jìn)行計(jì)時(shí), 且具有閏年補(bǔ)償功能, 工作電壓寬達(dá)2.5~5.5V。采用三線接口與CPU進(jìn)行同步通信, 并可采用突發(fā)方式一次傳送多個(gè)字節(jié)的時(shí)鐘信號(hào)或RAM數(shù)據(jù)。DS1302內(nèi)部有一個(gè)33x8的用于臨時(shí)性存
57、放數(shù)據(jù)的RAM寄存器。DS1302是的DS1202升級(jí)產(chǎn)品, 與DS1202兼容, 但增加了主電源/后背電源雙電源引腳, 同時(shí)提供了對(duì)后背電源進(jìn)行涓細(xì)電流充電的能力。</p><p> DS1302時(shí)鐘芯片包括實(shí)時(shí)時(shí)鐘/日歷和31字節(jié)的靜態(tài)RAM。它經(jīng)過一個(gè)簡(jiǎn)單的串行接口與微處理器通信。實(shí)時(shí)時(shí)鐘/日歷提供秒、分、時(shí)、日、周、月和年等信息。對(duì)于小于31天的月和月末的日期自動(dòng)進(jìn)行調(diào)整,還包括閏年校正的功能。時(shí)鐘的運(yùn)
58、行可以采用24<小>時(shí)或帶AM/PM的12小時(shí)格式。采用三線接口與CPU進(jìn)行同步通信,并可采用突發(fā)方式一次傳送多字節(jié)的時(shí)鐘信號(hào)或RAM數(shù)據(jù)。</p><p> DS1302在任何數(shù)據(jù)傳送時(shí)必須先初始化,把RST腳置為高電平,然后把8位地址和命令字裝入移位寄存器,數(shù)據(jù)在SCLK的上升沿被訪問到。在開始8個(gè)時(shí)鐘周期,把命令字節(jié)裝入移位寄存器后,另外的時(shí)鐘周期在讀操作時(shí)輸出數(shù)據(jù),在寫操作時(shí)寫入數(shù)據(jù)。時(shí)鐘脈
59、沖的個(gè)數(shù)在單字節(jié)方式下為8+8,在多字節(jié)方式下為8+字節(jié)數(shù),最大可達(dá)248字節(jié)數(shù)。如果在傳送過程中置RST腳為低電平,則會(huì)終止本次數(shù)據(jù)傳送,并且I/O引腳變?yōu)楦咦钁B(tài)。上電運(yùn)行時(shí),在Vcc≥2.5V之前,RST腳必須保持低電平。只有在SCLK為低電平時(shí),才能將RST置為高電平。</p><p> DS1302共有12個(gè)寄存器,其中有7個(gè)寄存器與日歷、時(shí)鐘相關(guān),存放的數(shù)據(jù)位為BCD碼形式。</p>&
60、lt;p> 時(shí)鐘暫停:秒寄存器的位7定義位時(shí)鐘暫停位。當(dāng)它為1時(shí),DS1302停止振蕩,進(jìn)入低功耗的備份方式,通常在對(duì)DS1302進(jìn)行寫操作時(shí)(如進(jìn)入時(shí)鐘調(diào)整程序),停止振蕩。當(dāng)它為0時(shí),時(shí)鐘將開始啟動(dòng)。</p><p> AM-PM/12-24小時(shí)方式:小時(shí)寄存器的位7定義為12或24小時(shí)方式選擇位。它為高電平時(shí),選擇12小時(shí)方式。在此方式下,位5為第二個(gè)10小時(shí)位(20~23h)。</p>
61、;<p> DS1302的晶振選用32768Hz,電容推薦值為6pF。因?yàn)檎袷庮l率較低,也可以不接電容,對(duì)計(jì)時(shí)精度影響不大。</p><p><b> 7 結(jié)束語</b></p><p> 當(dāng)我終于完成了所有打字、繪圖、排版、校對(duì)的任務(wù)后整個(gè)人都很累,但同時(shí)看著電腦熒屏上的畢業(yè)設(shè)計(jì)稿件我的心里是甜的,我覺得這一切都值了。</p>&l
62、t;p> 我不會(huì)忘記這難忘的幾個(gè)月的時(shí)間。在我徜徉書海查找資料的日子里,面對(duì)無數(shù)書本的羅列,最難忘的是每次找到資料時(shí)的激動(dòng)和興奮。我從資料的收集中,掌握了很多單片機(jī)及其接口應(yīng)用的知識(shí),讓我對(duì)我所學(xué)過的知識(shí)有所鞏固和提高,并且讓我對(duì)當(dāng)今單片機(jī)的最新發(fā)展技術(shù)有所了解。在整個(gè)過程中,我學(xué)到了新知識(shí),增長(zhǎng)了見識(shí)。在今后的日子里,我仍然要不斷地充實(shí)自己,爭(zhēng)取在所學(xué)領(lǐng)域有所作為。</p><p> 腳踏實(shí)地,認(rèn)真嚴(yán)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 電子萬年歷
- 電子萬年歷設(shè)計(jì)
- 萬年歷課程設(shè)計(jì)--萬年歷電子時(shí)鐘
- 外文翻譯-基于單片機(jī)的電子萬年歷
- 電子萬年歷中英文翻譯---基于實(shí)時(shí)鐘芯片的電子萬年歷的設(shè)計(jì)
- 電子萬年歷畢業(yè)論文
- 電子萬年歷畢業(yè)設(shè)計(jì)
- 電子萬年歷畢業(yè)設(shè)計(jì)
- 電子萬年歷設(shè)計(jì)與制作
- 電子萬年歷畢業(yè)設(shè)計(jì)
- 基于cj萬年歷
- 萬年歷開題報(bào)告
- 課程設(shè)計(jì)報(bào)告--電子萬年歷
- 電子萬年歷畢業(yè)設(shè)計(jì)稿
- 畢業(yè)論文——電子萬年歷設(shè)計(jì)
- 電子萬年歷設(shè)計(jì)-畢業(yè)論文
- 電子萬年歷課程設(shè)計(jì) (2)
- 電子萬年歷的設(shè)計(jì)與仿真
- 電子萬年歷設(shè)計(jì)報(bào)告書
- proteus課程設(shè)計(jì)--電子萬年歷
評(píng)論
0/150
提交評(píng)論