【正文】
、 P P2或 P3),用于對外部數(shù)據(jù)的傳輸。 單片機的基本結(jié)構(gòu) MCS52 單片機內(nèi)部結(jié)構(gòu) 8052單片機包含中央處理器、程序存儲器 (ROM)、數(shù)據(jù)存儲器 (RAM)、定時 /計數(shù)器、并行接口、串行接口和中斷系統(tǒng)等幾大單元及數(shù)據(jù)總線、地址總線和控制總線等三大總線,現(xiàn)在我們分別加以說明: 中央處理器: 中央處理器 (CPU)是整個單片機的核心部件,是 8位數(shù)據(jù)寬度的處理器,能處理 8位二進制數(shù)據(jù)或代碼, CPU 負(fù)責(zé)控制、指揮和調(diào)度整個單元系統(tǒng)協(xié)調(diào)的工作,完成運算和控制輸入輸出功能等操作。 目前,我國生產(chǎn)很多型號的單片機,在此,我們 采用型號為 STC89C52 的單片機。將單片機和傳感器相結(jié)合,可以構(gòu)成新一代的智能傳感器。商用系統(tǒng)中廣泛使用的電子計量儀器、收款機、條形碼閱讀器、安全監(jiān)測系統(tǒng)、空氣調(diào)節(jié)系統(tǒng)和冷凍保鮮系統(tǒng)等,都采用了單片機構(gòu)成的專用系統(tǒng)。 下面大致介紹一下單片機的主要應(yīng)用領(lǐng)域和特點。由于 CMOS 等工藝的大量采用,很多單片機可以在更低的電壓下工作( 或 ),功耗已經(jīng)降低到 uA級。 高效率和高性能 為了提高執(zhí)行速度和執(zhí)行效率,單片機開始使用 RISC、流水線和 DSP 的設(shè)計技術(shù),使單片機的性能有了明顯的提高,表現(xiàn)為:單片機的時鐘頻率得到提高;同樣頻率的單片機運行效率也有了很大的提升;由于集成度的提高,單片機 的尋址能力、片內(nèi) ROM( FLASH)和 RAM 的容量都突破了以往的數(shù)量和限制。其發(fā)展趨勢不外乎以下幾個方面: 多功能 單片機中盡可能地把所需要的存儲器和 I/O 口都集成在一塊芯片上,使得單片機可以實現(xiàn)更多的功能。單片機微型計算機簡 稱單片機,特別適用于控制領(lǐng)域,故又稱為微控制器。因此,研究數(shù)字鐘及擴大其應(yīng)用,有著非常現(xiàn)實的意義。這種軟件代替硬件的控 制技術(shù)也稱為微控制技術(shù),是傳統(tǒng)控制技術(shù)的一次革命。 目前,單片機正朝著高性能和多品種方向發(fā)展趨勢將是進一步向著 CMOS 化、低功耗、小體積、大容量、高性能、低價格和外圍電路內(nèi)裝化等幾個方面發(fā)展。 關(guān)鍵詞: 數(shù)字電子鐘 單片機 Abstract At the end of the 20th century, electronic technology has experienced rapid growth, the modern electronic products, almost permeated the various sectors of society, and promoted the development of social productive forces and the social informatization level, but also improve the modern electronic products to further improve the performance, product update rhythm also more and more quickly. Modern life of people pay more and more attention to the concept of time, money and time on the hospital. For those in time and accurately grasp the very strict about or inaccurate, time will bring great trouble, so as to displays clock digital tube than the pointer clock showed a lot of advantages. Digital pipe display time is simple and accurate readings, time to seconds. And mechanical dependent on crystal oscillators, may cause errors. A digital clock is used in digital circuit , points and second digital display timer. A digital clock accuracy and stability than old mechanical clock. In this design, we adopt LED digital display tube, minutes and seconds, when in 24 hours time, according to the principle of dynamic display of digital tube to show, with the crystals 12MHz produce oscillation pulses, timer count. In this design, the circuit has its time, still can realize the function of the time. A digital clock is its small, inexpensive, high precision, easy to use and when, the function is much, facilitate integration by vast consumption, so it has been widely used. Key words: digital electric clock microcontroller XXXX 職業(yè)技術(shù)學(xué)院 畢業(yè)設(shè)計(論文) 3 目 錄 摘要(中文) ????????????????????????????? ? Ⅰ 摘要(英文) ????????????????????????????? ?Ⅱ 引言 ……………………………………………………………………………………… ? 4 第 一 章 整體設(shè)計方案 ??????????????????????????? 5 單片機的選擇 ???????????????????????????? 5 單片機的基本結(jié)構(gòu) ?????????????????????????? 6 第 二 章 數(shù)字鐘的 硬件設(shè)計 ????????????????????????? 11 最小系統(tǒng)設(shè)計 ???????????????????????????? 11 LED 顯示電路 ???????????????????????????? 13 鍵盤控制電路 ???????????????????????????? 15 第 三 章 數(shù)字鐘的軟件設(shè)計 ????????????????????????? 17 系統(tǒng)軟件設(shè)計流程圖 ????????????????????????? 17 數(shù)字電子鐘的原理圖 ??? ?????????????????????? 21 ????????????????????????????? 22 延時 子程序 ????????????????????????????? 22 主程序和 定時器中斷子程序 ?????????????????????? 22 LED 顯示子程序 ??????????????????????????? 23 按鍵控制子程序 ??????????????????????????? 25 第 四 章 系統(tǒng)仿真 ???????????????? ????????????? 28 PROTUES 軟件介紹 ?????????????????????????? 28 電子鐘系統(tǒng) PROTUES 仿真 ??????????????????????? 28 第 五 章 調(diào)試與功能說明 ?????????????????????????? 29 系統(tǒng)性能測試與功能說明 ??????????????????????? 29 系統(tǒng)時鐘誤差分析 ?????????????????????????? 29 軟件調(diào)試問題及解 決 ???????????????? ????????? 29 結(jié)論 ?????????????????????????????????? 30 致謝 ?????????????????????????????????? 31 參考文獻 ???????????????????????????????? 32 XXXX 職業(yè)技術(shù)學(xué)院 畢業(yè)設(shè)計(論文) 4 引言 20 世紀(jì)末,電子技術(shù)獲得了飛速的發(fā)展,在其推動下,現(xiàn)代電子產(chǎn)品幾乎滲透了社會的各個領(lǐng)域,有力地推動了社會生產(chǎn)力的發(fā)展和社會信息化程度的提高,同時也使現(xiàn)代電子產(chǎn)品性能進一步提高,產(chǎn)品更新?lián)Q代的節(jié)奏也越來越快。數(shù)字鐘的精度、穩(wěn)定度遠(yuǎn)遠(yuǎn)超過老式機械鐘。對于那些對時間把握非常嚴(yán)格和準(zhǔn)確的人或事來說