【正文】
I 摘 要 隨著居民生活水平的不斷提高,自行車不再僅僅是普通的運(yùn)輸、代步的工具,而是成為人們娛樂、休閑、鍛煉的首選。 自行車的速度里程表能夠滿足人們最基本的需求, 讓人們能清楚地知道當(dāng)前的速度、里程等物理量。 本論文主要闡述一種基于霍爾元件的自行車的速度里程表的設(shè)計(jì)。以 AT89C52 單片機(jī)為核心, A44E霍爾傳感器測轉(zhuǎn)數(shù),實(shí)現(xiàn)對自行車?yán)锍?/速度的測量統(tǒng)計(jì),采用 24C02實(shí)現(xiàn)在系統(tǒng)掉電的時(shí)候保存里程信息,并能將自行車的里程數(shù)及速度用 LED實(shí)時(shí)顯示。文章詳細(xì)介紹了自行車的速度里程表的硬件電路和軟件設(shè)計(jì)。硬件部分利用霍爾元 件將自行車每轉(zhuǎn)一圈的脈沖數(shù)傳入單片機(jī)系統(tǒng),然后單片機(jī)系統(tǒng)將信號經(jīng)過處理送顯示。軟件部分用匯編語言進(jìn)行編程,采用模塊化設(shè)計(jì)思想。該系統(tǒng)硬件電路簡單,子程序具有通用性,完全符合設(shè)計(jì)要求。 關(guān)鍵詞: 里程 /速度;霍爾元件;單片機(jī); LED 顯示II ABSTRACT With the developing of people’s life, the bicycle is not only the universal tool of transportation and substitute for walking, but bees the first choice of entertainment and exercising. The bicycle mileage/speed can fulfill the basic need of people’s life, so that they can learn the speed and the mileage of the bicycle. In this paper, the bicycle mileage/speed design based on the Hall element is elaborated. By AT89C52 as kernel, using A44E Hall element to measure revolution, the measure and statistic are achieved. The range information is saved by 24C02 when the power is off, the bicycle speed can be displayed on LED. In this article, the hardware circuit and software design of bicycle mileage/speed instrument are introduced in detail. About the hardware, the pulse number is transmitted of one cycle of the bicycle into Single Chip Microputer system. Then the signal processed by Single Chip Microputer system is sent to display scream. About the software, in assemble language。 the program is designed in the mode of modules. The system has simple hardware, mon subprogram, and meets the demand of design. KEY WORDS: Mileage / speed。 Hall element。 Single chip microputer。 LED III 目 錄 摘 要 .............................................................................................................. I 第一章 緒 論 .................................................................................................1 ........................................................................................... 1 單片機(jī)發(fā)展趨勢 ................................................................................ 1 ...................................................................... 3 第二章 系統(tǒng)總體方案設(shè)計(jì) .............................................................................4 .................................................................................... 4 .................................................................................... 6 .................................................................................... 8 第三章 硬件電路設(shè)計(jì) ..................................................................................10 ................................................................................................ 10 ........................................................................ 10 ............................................................... 11 ............................................................... 12 ........................................................................ 13 片機(jī)原理簡介 .......................................................................... 13 ............................................................... 15 ................................................................... 18 /計(jì)數(shù)功能介紹 .......................................................... 20 ........................................................................... 21 ............................................................................. 21 觸發(fā)器的選擇 ............................................................................ 22 74LS244芯片的介紹 ................................................................... 24 .................................................................... 24 .......................................................................... 24 .......................................................................... 26 .......................................................................... 27 本章小結(jié) ......................................................................................... 29 IV 第四章 軟件程序設(shè)計(jì) .................................................................................. 30 .......................................................................................... 30 ................................................................................... 30 斷子程序的設(shè)計(jì) ............................................................................ 33 ..................................................................... 34 ............................................................................ 35 第五章 系統(tǒng)調(diào)試與分析 .............................................................................. 38 ................................................................................... 38 ........................................................................ 39 .......................................................................................... 41 ...................................................................................... 41 致 謝 ........................................................................................................ 43 參考文獻(xiàn) ..................................................................................................... 44 附 錄 .......................................................................................................... 46 1 第一章 緒 論 課題 簡介 自行車被發(fā)明及使用到現(xiàn)在已有兩百多年的歷史,這兩百年間人類在不斷的嘗試與研發(fā)過程中,將玩具式的木馬車轉(zhuǎn)換到今日各式新穎休閑運(yùn)動自行車,自行車發(fā)展的目的也從最早的交通代步的