【正文】
************************************** void main() { init()。// void set(uchar x)。 uchar dispbuf1[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}。 sbit K2=P1^6。//液晶清屏 void lcd_set()。 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 23 參考文獻(xiàn) [1] 李朝青.單片機(jī)的 C 語言應(yīng)用程序設(shè)計(jì) [M],北京:北京航空航天大學(xué)出版社, 2021 [2] 陳海宴. 51 單片機(jī)原理及應(yīng)用 [M],北京:北京航空航天大學(xué)出版社, 2021 [3] 張志,高大志,楊為名等.微控制器原理及接口技術(shù)實(shí)驗(yàn)教程 [M],沈陽:東北大學(xué)出版社,2021 [4] 高大志.單片機(jī)實(shí)驗(yàn)指導(dǎo)書 [M],沈陽:信息學(xué)院實(shí)驗(yàn)中心, 2021 [5] 周立功 ,夏宇聞 .單片機(jī)與 CPLD綜合應(yīng)用技術(shù) [M],北京 :北京航空航天大學(xué)出版 社 [6] 丁元杰 .單片微機(jī)原理及應(yīng)用 [M],北京 :機(jī)械工業(yè)出版社 [7] 靳達(dá)編 .單片機(jī)應(yīng)用系統(tǒng)開發(fā)實(shí)例導(dǎo)航 [M],北京 :人民郵電出版社 [8] 李光飛 .單片機(jī)課程設(shè)計(jì)實(shí)例指導(dǎo) [M],北京 : 北京航空航天大學(xué)出版社 [9] 胡宴如 .高頻電子線路 [M],北京 : 高等教育出版社 [10] 白駒珩 ,雷曉平 .單片計(jì)算機(jī)及其應(yīng)用 [M],成都 : 電子科技大學(xué)出版社 [11] 李廣弟 .單片機(jī)基礎(chǔ) [M],北京 : 北京航空航天大學(xué)出版社 [12] 沈美明 ,溫冬嬋 .IBM 匯編語言程序設(shè)計(jì) [M],北京 : 清華大學(xué)出版社 [13] 彭傳正 ,林春景 .凌陽單片機(jī)原理與實(shí)踐 [M],北京 : 北京航空航天大學(xué)出版 社 [14] 李榮正 ,陳學(xué)軍 .PIC 單片機(jī)實(shí)踐教程 [M],北京: 北京航空航天大學(xué)出版社 [15] 閻石 .數(shù)字電子技術(shù)基礎(chǔ) ,北京 : 高等教育出版社 [16] 張鑫、華臻、陳書謙.《單片機(jī)原理及應(yīng)用》 [M].電子工業(yè)出版社, 2021. P110~136. [17] 丁元杰、吳大偉.《單片微機(jī)實(shí)題集與實(shí)驗(yàn)指導(dǎo)書》 [M].機(jī)械工業(yè)出版社, 2021. P124~125. [18] AT89C52 概述 [EB/OL]: 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 24 附錄 A 本設(shè)計(jì)原理圖 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 25 附錄 B 本設(shè)計(jì)源程序 include define uchar unsigned char define uint unsigned int sbit rw=P1^1。 BUSY=0 表示已 “準(zhǔn)備好 ”,等待計(jì)算機(jī)的訪問。 TL=X%256。 當(dāng)出租車運(yùn)行后,就啟動計(jì)價器,根據(jù)里程寄存器中的內(nèi)容計(jì)算和判斷行駛里程是否已超過起步價公里數(shù)。閱讀序列后,停止命令將 EE PROM 在備用電源模式。 AT24C08 只使用 2 輸入硬件尋址和共 28 設(shè)備可以解決的一個單總線系統(tǒng)。不管是否寫了全部 31 字節(jié),所寫的每一個字節(jié)都將傳送至 RAM。最低有效位如為 0 表示要進(jìn)行寫操作,為 1 表示進(jìn)行讀操作,控制字節(jié)總是從最低位開始輸出。 DS1302 是 SPI 總線驅(qū)動方式。 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 10 時鐘芯片 DS1302 引腳說明 DS1302 引腳圖參 照圖 。這樣兩次電壓變換,使霍耳開關(guān)完成了一次開關(guān)動作。 霍爾器件具有以下優(yōu)點(diǎn): 結(jié)構(gòu)牢固,體積小,重量輕,壽命長,安裝方便,功耗小,頻率高(可達(dá) 1MHZ) ,耐振動,不怕灰塵、油污、水汽及鹽霧等的污染或腐蝕。 11. 從 CGRAM 或 DDRAM 讀出數(shù)據(jù)的指令一覽 功能: 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 8 讀取 DDRAM 或 CGRAM 中的內(nèi)容。 功能: 設(shè)定 每次定入 1 位數(shù)據(jù)后光標(biāo)的移位方向,并且設(shè)定每次寫入的一個字符是否移動。 第 6 腳: E(或 EN)端為使能 (enable)端。在 FLASH 編程期間,此引腳也用于施加 12V編程電源( VPP) 。此時, ALE 只有在執(zhí)行 MOVX, MOVC 指令是 ALE 才起作用。 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 5 表 P3 口的特殊功能 引腳 替代功能 說明 RXD 串行數(shù)據(jù)接收 TXD 串行數(shù)據(jù)發(fā)送 INT0 外部中斷 0 申請 INT1 外部中斷 1 申請 T0 定時器 0 外部事件計(jì)數(shù)輸入 T1 定時器 1 外部事件計(jì)數(shù)輸入 WR 外部 RAM 寫選通 RD 外部 RAM 讀選通 RST——復(fù)位輸入。 P2 口當(dāng)用于外部程序存儲器或 16 位地址外部數(shù)據(jù)存儲器進(jìn)行存取時, P2 口輸出地址的高八位。 P0 能夠用于外部程序數(shù)據(jù)存儲器,它可以被定義為數(shù)據(jù) /地址的第八位。STMicroelectronics 即意法半導(dǎo)體公司是 1987 年 6 月在意大利的 SGS 微電子公司和法國的湯姆遜微電子公司合并后產(chǎn)生的。出租車計(jì)價器通過傳感器與行駛車輛連接。 國內(nèi)外研究現(xiàn)狀 隨著超大規(guī)模集成電路技術(shù)的發(fā)展,單片機(jī)也隨之有了很大發(fā)展,各種新穎的單片機(jī)層出不窮,并已廣泛地應(yīng)用到人類生活的各個領(lǐng)域,包括工業(yè)控制、數(shù)據(jù)采集、智能儀表、 機(jī)電一體化、家用電器等各方面,成為當(dāng)今科學(xué)技術(shù)現(xiàn)代化不可缺少的重要工具。 關(guān)鍵詞 : 出租車計(jì)費(fèi) 器; 霍爾傳感器; STC89C52RC; DS1302; LCD1602 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 II Auto meter design and Implementation Abstract This design is based on a single chip AT89C52 taxis design, can achieve the main functions are: data reduction, day / night conversion, data output, timing, price adjustment, and valuation of output. Output, implemented in the system power off when preservation of monovalent and system time information and other functions. Output using LCD display. The design with the reset circuit, clock circuit, keyboard circuit, LCD1602 display circuit. ( 1) reset circuit is a single chip initialization operation, in addition to the normal initial acquisition, to cast off predicament, the reset circuit can start again. ( 2) the clock circuit using a 12MHz crystal, as the system clock source, with higher accuracy. ( 3) the keyboard circuit uses four keys, S1, S2, S3, S4, its functions are: S1 split screen display toggle button, S2 function set key, S3. +. / day and night switching button, S4. . / Midway for switch. ( 4) in the upper electricity character liquid crystal display 1602 original starting price, mileage charges, waiting time charges three charges. In 1602 the LCD can display the running time, operation suspension can be obtained by the putation time, the total cost and the total distance. Here is mainly to the AT89S52 MCU as the core controller, P0 mouth is connected with the 1602 liquid crystal display module, P1 port access keys, through the key input. The system assumes that the constant speed 60Km / h ( 1Km / min ), the starting price is 6 yuan / 2 km, night starting price is yuan / 2 km, More than two kilometers and yuan/1km, wait for more than 5 minutes at 1 km to calculate. Keywords: taxi meter; Holzer sensor ; STC89C52RC; DS1302; LCD1602 內(nèi)蒙古科技大學(xué)課程設(shè)計(jì)論文 III 目錄 摘要 ........................................................................................................................................ I Abstract.................................................................................................................................. II 第一章 前言 ......................................................................................................................... 1 問題的提出 .............................................................................................................. 1 國內(nèi)外研究現(xiàn)狀 ...................................................................................................... 1 設(shè)計(jì)思路 .................................................................................................................. 2 第二章 硬件組成 ....................................................................