【正文】
cd(hz2,hz3,hz4)。 COUT=0。 //全部費(fèi)用 } else { if(COUT)=60) //低速計(jì)數(shù) { length++。 //全部路程 leng=0。 //去除千位 } 本科畢業(yè)論文 fa=leng*price。 //本次路程加上上次剩余 if(len/TI=0) //達(dá)到千位 { leng=len/TI。 //低速計(jì)數(shù)清零 price=a*10+b。 //第一次加上起價(jià)費(fèi) inf=1。 while(1) { clock()。 /*第一次標(biāo)志位 */ initial()。 /*時(shí)鐘顯示子程序 */ void check_ds12887(void)。 /*單價(jià)修改子程序 */ void change_time(void)。 /*LCD 忙狀態(tài)檢測(cè)函數(shù) */ void pute(void)。 /*LCD 設(shè)置子程序 */ void show_lcd(uchar *,uchar *,uchar *)。 /*初始化子程序 */ void delay(void)。 /* 單 價(jià) 空 */ uchar xdata hz6[16]={0x20,0x20,0x20,0x20,0xA3,0xBA,0xA3,0xB0,0xA3,0xB0, /* 空 空 : N N */ 0xD4,0xAA,0xA3,0xAF,0x4B,0x4D}。 /* N N k m */ uchar xdata hz4[16]={0xBC,0xDB,0xC7,0xAE,0xA3,0xBA,0xA3,0xB0,0xA3,0xB0, /* 價(jià) 格 : N N */ 0xA3,0xB0,0xA3,0xB0,0xD4,0xAA}。/* 0~F 的字型編碼 */ /*LCD 顯示數(shù)組 第一行為時(shí)鐘占用 */ uchar xdata hz2[16]={0xB5,0xA5,0xBC,0xDB,0xA3,0xBA,0x20,0x20,0x20,0x20, /* 單 價(jià) : 空 空 */ 0xA3,0xB0,0xA3,0xB0,0xD4,0xAA}。 unsigned char code NO[10]={0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9}。 uchar ds_h,ds_m,ds_s,ds_t。 unsigned char bdata sta_ds。 /*8279*/ sbit du=sta_8279^7。 /* lcd 可位尋址片內(nèi)數(shù)據(jù)存儲(chǔ)器,允許位與字節(jié)混合訪問 */ sbit busy=status^7。nn=0。 /*顯示參數(shù) */ uint idata m,n,o,p,q,r,s,t。 /*低速計(jì)數(shù) */ uint idata h1,h2,m1,m2,s1,s2。 /*單價(jià) */ uint idata len,fa。 /*鍵值 */ uint idata num=0。 第 6 章 顯示子程序服務(wù)程序設(shè)計(jì) 顯示子程序服務(wù)程序概述 由于是分屏顯示數(shù)據(jù),所以就要用到 4 個(gè)顯示子程序,分別是:時(shí)分秒顯示子程序( HMS_DIS)、金額單價(jià)顯示子程序( CP_DIS)、路程單價(jià)顯示子程序(DP_DIS)、單價(jià)調(diào)節(jié)子程序 (PA_DIS)。當(dāng)中途等待結(jié)束的時(shí)候,也就自動(dòng)切換到正常的計(jì)價(jià)。 定時(shí)中斷服務(wù)程序 重置計(jì)數(shù)初值 中斷 10 次? 數(shù)據(jù)送顯示緩沖單元 調(diào)用顯示子程序 恢復(fù)現(xiàn)場(chǎng) 并中斷返回 否 是 開始 保護(hù)現(xiàn)場(chǎng) 本科畢業(yè)論文 第 4章 中斷服務(wù) 程序設(shè)計(jì) 每當(dāng)霍爾傳感器輸出一個(gè)低 電平信號(hào)就使單片機(jī)中斷一次,當(dāng)里程計(jì)數(shù)器對(duì)里程脈沖計(jì)滿 1000 次時(shí),使微機(jī)進(jìn)入里程計(jì)數(shù)中斷服務(wù)程序中。 本科畢業(yè)論文 系統(tǒng) 初始化后 ,判斷 口 ,是否等待計(jì)價(jià) .若是則進(jìn)入等待計(jì)價(jià)處理,若否,則進(jìn)入下一步,判斷是否進(jìn)行車輪計(jì)數(shù),若沒有進(jìn)行車輪計(jì)數(shù)則返回等待計(jì)價(jià)處理,若進(jìn)行車輪計(jì)數(shù),則由計(jì)數(shù)器加 1,然后判斷計(jì)數(shù)器是否加到 50,若不到 50,則由數(shù)碼管顯示,若到了 50 則由到 50 方式處理,最后由數(shù)碼管顯示計(jì)算 的價(jià)錢。 碼管顯示子程序通過動(dòng)態(tài)掃描實(shí)現(xiàn)。 計(jì)數(shù)子程序是通過對(duì)工作寄存器的循環(huán)累加實(shí)現(xiàn)的。在等計(jì) 價(jià)中,調(diào)用等待計(jì)價(jià)子程序,每 4 秒調(diào)用計(jì)數(shù)子程序?qū)τ?jì)數(shù)器加 1,在車輪計(jì)中,車輪每轉(zhuǎn)過 1 周調(diào)用計(jì)數(shù)子程序?qū)τ?jì)數(shù)器加 1。本電路設(shè)計(jì)的計(jì)價(jià)器不但能實(shí)現(xiàn)基本的計(jì)價(jià),而且還能根據(jù)白天、黑夜、中途等待來調(diào)節(jié)單價(jià),同時(shí)在不計(jì)價(jià)的時(shí)候還能作為時(shí)鐘為司機(jī)同志提供方便。 ?? 啟動(dòng)計(jì)時(shí)開關(guān) ?? 數(shù)據(jù)復(fù)位(清零) ?? 白天 /晚上轉(zhuǎn)換 系統(tǒng)主要功能 本課程設(shè)計(jì)所設(shè)計(jì)的出租車計(jì)價(jià)器的主要功能有: 數(shù)據(jù)的復(fù)位、白天 /晚上轉(zhuǎn)換、數(shù)據(jù)輸出、計(jì)時(shí)計(jì)價(jià)、單價(jià)輸出及調(diào)整、路程輸出、語音播報(bào)數(shù)據(jù)信息、實(shí)現(xiàn)在系統(tǒng)掉電的時(shí)候保存單價(jià)和系統(tǒng)時(shí)間等信息等功能。 ?? 距離檢測(cè)使用霍爾開關(guān) A44E ?? 白天 /晚上收費(fèi)標(biāo)準(zhǔn)的轉(zhuǎn)換開關(guān) ?? 數(shù)據(jù)的清零開關(guān) ?? 單價(jià)的調(diào)整(最好使用+和-按鍵) ?本科畢業(yè)論文 (2) 數(shù)據(jù)輸出(采用 LCM103)。 3.具有數(shù)據(jù)的復(fù)位功能 。 設(shè)計(jì)要求 1. 不同情況具有不同的收費(fèi)標(biāo)準(zhǔn)。目前市場(chǎng)上出租車計(jì)價(jià)器功能主要有 具有數(shù)據(jù)的復(fù)位功能、白天 /晚上轉(zhuǎn)換功能、數(shù)據(jù)輸出功能、計(jì)時(shí)計(jì)價(jià)功能等等,但 能夠進(jìn)行 語音播報(bào)數(shù)據(jù)信息的 出租車計(jì)價(jià)器還是比較少見的,針對(duì)這一點(diǎn)我們來設(shè)計(jì)一款多功能出租車計(jì)價(jià)器,在原有功能的基礎(chǔ)上增加單價(jià)輸出、單價(jià)調(diào)整、路程輸出、顯示當(dāng)前的系統(tǒng)時(shí)間、語音播報(bào)數(shù)據(jù)信息等功能。出租車計(jì)價(jià)器通過傳感器與行駛車輛連接。 關(guān)鍵詞: 出租車計(jì)價(jià)器; 單片機(jī) ; 控制 ABSTRACT Abstract: Taximeter is both passengers and drivers of the transaction criteria, it is the taxi industry an important symbol, a taxi is the most important tools. It relates to the interests of both transactions. Has a good performance regardless of the meter is a vast number of taxi drivers or passengers are very necessary. Therefore, the car meter is also very much a study of value. The use of analog circuits and digital circuit design of the meter as a whole circuit of a larger scale, using the device, a failure rate is high and difficult to debug, the pattern of switching need to use mechanical switches, mechanical switch will cause a longtime contacts Bad, functions not easy to achieve. SCM used for the design, a relatively powerful, with less hardware and appropriate software can easily coordinate with each other to achieve the design requirements, flexibility and strong, can be programmed by software to plete more of the additional Function. Pricing model for the switch, software programming and can easily cite the achievement. To avoid a mechanical switch the destabilizing factors. Keywords: Taximeter ; 89 S51 MCU ; control 本科畢業(yè)論文 目 錄 摘要 .................................................................................................................................