【正文】
基于單片機(jī)的自行車碼表設(shè)計(jì) I 基于單片機(jī)的自行車碼表設(shè)計(jì) 摘 要 隨著人們生活水平的不斷提高,自行車已經(jīng)不僅僅是運(yùn)輸、代步的工具,其輔助功能也變得越來越重要。因此,人們希望自行車的娛樂、休閑、鍛煉的功能越來越多,能帶來大家更多的健康與快樂。自行車碼表作為自行車的一大輔助工具迅速發(fā)展起來??茖W(xué)、美觀、合理設(shè)計(jì)自行車?yán)锍瘫碛幸欢ǖ膶?shí)用價(jià)值。它能合理計(jì)算出速度及公里數(shù) ,使運(yùn)動(dòng)者運(yùn)動(dòng)適量 ,達(dá)到健康運(yùn)動(dòng)與代步的最佳效果。碼表能盡可能真實(shí)地反映騎行狀況,便于車手及時(shí)調(diào)整自己的舉動(dòng)。 本設(shè)計(jì)以 AT89C51 單片機(jī)為主控制芯片, 128*64 LCD 為顯示終端顯示自行車時(shí)速、里程等信息及系統(tǒng)設(shè)置等,統(tǒng)設(shè)置菜單能夠人工設(shè)置設(shè)備安裝信息以提高測(cè)量精度,提供時(shí)速、里程、平均速度、時(shí)間等信息,時(shí)還附加一報(bào)警功能,當(dāng)行駛到預(yù)設(shè)里程和速度時(shí),系統(tǒng)會(huì)自動(dòng)報(bào)警,提醒已經(jīng)達(dá)到預(yù)設(shè)運(yùn)動(dòng)量。 本設(shè)計(jì)主要包括自行車輪脈沖采集、鍵盤輸入和數(shù)據(jù)顯示等部分,主程序用 C語言編寫,完成各項(xiàng)功能及數(shù)據(jù)的處理,通過 Keil C 來完成程序的編寫和下載,通過單片機(jī)實(shí)驗(yàn)開發(fā)板具體實(shí)現(xiàn)自行車碼表各項(xiàng)功能。 關(guān)鍵詞 ST1101 AT89C51 LCD ZLG7290 報(bào)警 基于單片機(jī)的自行車碼表設(shè)計(jì) II THE DESIGN OF BASING ON MCU BICYCLE STOPWATCH ABSTRACT With the improvement of life level, bike is not only the transport tool but also it?s auxiliary function bee more and more import. Therefore, people hope that the function of amusement, leisure and exercise of bike bee more and more。 and bring more health and happy. As one import auxiliary function of bike stopwatch develops quickly. The design of stopwatch is scientific, reasonable and beautiful。 and it also has its practical value. Stopwatch can calculate speed and distance, reflects true exercise state。 based on this exerciser can adjusts exercise strength so that it can reach the best effect of healthy exercise. This project takes AT89C51 MCU as main control chip and takes 128*64 LCD as terminal display which displays speed per hour, distance and system set. In the system set menu people can set install information to improve measure precision. Besides, it appends alerting function. When reach the distance and speed set in advance, the system will alert automatically to remind exerciser that he has reached exercise strength set in advance. This project mainly includes bicycle wheel pulse acquisition, keyboard input and data shows. The main program is piled by C language which is to do initialization and keyboard dealing。 the piler and download of program are done by Keil C, and the various functions of the bicycle are realized concretely by the SCM experiment development board. KEY WORDS ST1101 AT89C51 LCD ZLG7290 alert基于單片機(jī)的自行車碼表設(shè)計(jì) 1 目 錄 摘要 ....................................................................................................................................... I ABSTRACT............................................................................................................................. II 前言 ...................................................................................................................................... 1 1 緒論 ............................................................................................................................... 2 開發(fā)背景及意義 ............................................................................................ 2 課題背景 ................................................................................................... 2 課題的意義 ............................................................................................... 2 Keil C 介紹 ................................................................................................... 2 設(shè)計(jì)內(nèi)容 .......................................................................................................... 3 2 系統(tǒng)方案論證與分析 .............................................................................................. 4 系統(tǒng)方案 .......................................................................................................... 4 系統(tǒng)概述 ................................................................................................... 4 系統(tǒng)原理 ................................................................................................... 4 采集信息部分以及傳感器的選擇 ........................................................... 5 主控芯片選擇 ................................................................................................. 6 數(shù)據(jù)處理并顯示模塊 ................................................................................... 6 多位 LED 數(shù)碼管顯示 ............................................................................... 6 128*64 LCD 顯示 ...................................................................................... 7 鍵盤部分及所需芯片選擇 ......................................................................... 8 鍵盤設(shè)計(jì)方案 ........................................................................................... 8 ZLG7290 芯片特點(diǎn) .................................................................................... 9 3 系統(tǒng)硬件設(shè)計(jì) ...........................................................................................................10 基于單片機(jī)的自行車碼表設(shè)計(jì) 2 系統(tǒng)設(shè)計(jì) 圖 ....................................................................................................10 AT89C51 主控芯片 ....................................................................................... 11 脈沖發(fā)生源 ....................................................................................................13 輪脈沖檢測(cè) ..............................................................................................13 信號(hào)預(yù)處理電路 ......................................................................................13 E2PROM AT24C02 的應(yīng)用 ........................................................................14 顯示模塊 .........................................................................................................15 顯示資料 RAM( DDRAM) .........................................................................16 繪圖 RAM( GDRAM) .................................................................................17 鍵盤及 ZLG7290 芯片 ..................................................................................17 芯片引腳及說明 ......................................................................................17 引腳功能 .................................