【正文】
摘 要 本 設(shè)計(jì) 是以 AT89S51 單片機(jī)為核心實(shí)現(xiàn)的一個(gè)智能電子計(jì)時(shí)器系統(tǒng) 。 目前市場(chǎng)上的 電子計(jì)時(shí) 器,主要有 基于 NE555 的電子計(jì)時(shí)器、基于脈沖的電子計(jì)時(shí)器以及基于 AT89S51 單片機(jī)的電子計(jì)時(shí)器三種 。通過(guò)比較,本課題選擇了“基于 AT89S51 單片機(jī)的電子計(jì)時(shí)器 ”的設(shè)計(jì)方案。該方案利用了 AT89S51 單片機(jī)為主控芯片,實(shí)現(xiàn)了 時(shí)間顯示 、 定時(shí)中斷 以及記錄比分 等功能。 具有簡(jiǎn)單易操作、時(shí)間可以任意設(shè)定等優(yōu)點(diǎn),適合目前人們對(duì)智能小家電的需求。 本 設(shè)計(jì) 主要從總體設(shè)計(jì)、硬件設(shè)計(jì)、軟件設(shè)計(jì)、系統(tǒng)實(shí)現(xiàn)等方面來(lái)對(duì)智能電子 計(jì)時(shí)器進(jìn)行詳細(xì)的介紹。 硬件主要由 顯示模塊、按鍵模塊、復(fù)位模塊 、晶振電路 等組成;軟件是用 C語(yǔ)言編程,再利用 Keil 軟件進(jìn)行仿真,最后將軟硬件結(jié)合起來(lái)實(shí)現(xiàn)電子計(jì)時(shí)器的功能。 本 設(shè)計(jì)主要是完成定時(shí)時(shí)功能, 該計(jì)時(shí)器 系統(tǒng)簡(jiǎn)單易操作, 定時(shí)時(shí)間也較長(zhǎng),適合在 999 秒以?xún)?nèi)的定時(shí),比如豆?jié){機(jī)、榨汁機(jī)等的定時(shí)。 關(guān)鍵詞 : AT89S51, LED 數(shù)碼管 ,電子計(jì)時(shí)器, C語(yǔ)言 Abstract This design is based on AT89S51 as the core implementation of an intelligent electronic timer system. Currently on the market of electronic timer, are mainly based on the electronic timer NE555, based on the pulse of the electronic timer and electronic timer based on AT89S51 3 kinds. By parison, chose the topic electronic timer based on AT89S51 design. The scheme takes advantage of the AT89S51 as the main control chip, implement the time display, timing interrupt and record the score. With a simple easy to operate, the advantages of time can be set arbitrary, meet requirements of intelligent household appliances. This design mainly from the overall design, hardware design, software design, system implementation, etc to intelligent electronic timer is introduced in detail. Hardware is mainly posed of display module, keys module, reset module, a crystal vibration circuit and so on。 Software is written in C language programming, using the Keil software simulation, electronic timer function is realized by bining software and hardware. Timing of the pletion of this design is mainly the function, the timer system easy to operate, simple timing time is longer, suitable time within 999 seconds, such as timing DouJiangJi, juicer and so on. Keywords: AT89S51, LED digital tube, electronic timer, the C language 目 錄 第一章 緒論 .................................................................................................................. 1 第二章 電子計(jì)時(shí)器及 AT89S51單片機(jī)的簡(jiǎn)介 ................................................................. 2 電子計(jì)時(shí)器的的功能以及工作原理 ....................................................................... 2 電子計(jì)時(shí)器的功能簡(jiǎn)述 ................................................................................. 2 電子計(jì)時(shí)器的工作原理及組成 ....................................................................... 2 AT89S51單片機(jī)的簡(jiǎn)介 ........................................................................................... 3 AT89S51功能特性概述 .................................................................................... 3 AT89S51的 引腳圖及說(shuō)明 ................................................................................ 4 第三章 系統(tǒng)的總體設(shè)計(jì) ................................................................................................... 8 方案比較 ............................................................................................................... 8 功能設(shè)計(jì) ............................................................................................................ 10 功能實(shí)現(xiàn)流程 ..................................................................................................... 10 第四章 硬件設(shè)計(jì) ......................................................................................................... 12 單片機(jī)最小系統(tǒng) ................................................................................................... 12 電子計(jì)時(shí)的功能模塊 ............................................................................................ 14 .......................................................................................................... 14 .............................................................................................................. 15 .............................................................................................................. 16 第五章 軟件設(shè)計(jì) ......................................................................................................... 19 C語(yǔ)言簡(jiǎn)介 ......................................................................................................... 19 軟件模塊規(guī)劃 ..................................................................................................... 20 程序?qū)崿F(xiàn) ............................................................................................................ 21 ............................................................................................ 22 ................................................................................................... 22 ................................................................................................ 23 ......................................................................................... 24 第六章 系統(tǒng)實(shí)現(xiàn) ........................................................................................................... 26 硬件實(shí)現(xiàn) ......................................................................................