freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于stc89c52單片機出租車計價器設計-文庫吧在線文庫

2024-07-28 18:50上一頁面

下一頁面
  

【正文】 n of single chip puter is automatic taximeter. The hardware of this design is posed of single chip puter and peripheral circuits which consist of Detection Unit, Processing Unit and Human Computer Interaction Unit. The Detection Unit is based on Halleffect sensor. The Processing Unit contains STC89C52 and AT24C02. Human Computer Interaction Unit is posed of keyboard and LED.The function of this system includes as follows:1. Set the unit price。4. 通信方面。2. 寄存器分配、不同存儲器的尋址及數(shù)據(jù)類型等細節(jié)完全由編輯器自動處理。2. 要求單價可調(diào),并要求對等待時間進行計時。(默認起步價為5元/3公里,等待計時單價為1元/1分鐘)為提高計時、計價精度,確保乘客對自己消費的知情權(quán),同時為減少司機朋友來回調(diào)整單價以及停車后需重設單價的麻煩,計價器應具有掉電保持功能,即當重新啟動后維持原有數(shù)值(包括總金額、等待時間、行駛里程、單價)不變,直至強制按下清零鍵,計價器顯示起步價(剛起步時對應總金額)、運行單價,為下一次計價做準備。復位電路和晶振電路,以及P0口接入的10K的上拉電阻便構(gòu)成了STC89C52 單片機工作所需的最簡外圍電路。本設計利用P0口的I/O功能 [2] 。A44E霍爾傳感器原理里程計算主要通過霍爾傳感器A44E檢測完成,出租車車輪每旋轉(zhuǎn)一周,霍爾傳感器A44E便產(chǎn)生一相應的脈沖輸出,并把該脈沖交由單片機進行處理,單片機則根據(jù)程序設定,通過計算脈沖個數(shù)換算出已行駛里程:里程=脈沖個數(shù)*出租車車輪周長。每當設定一次單價,系統(tǒng)就調(diào)用存儲程序,將單價信息保存在芯片內(nèi);當系統(tǒng)重新上電的時候,自動調(diào)用讀存儲器程序,將存儲器內(nèi)的單價等信息,讀到緩存單元中,供主程序使用。由于調(diào)節(jié)信息不多,故采用5個獨立鍵盤即可,分別實現(xiàn)清零、切換、增大、減小和功能等作用。、用于顯示總金額; ,顯示等待時間;,用于顯示里程,由于需精確到小數(shù)位,但經(jīng)過添加溢出指示,可計到20公里,在現(xiàn)實中已基本夠用;,用于顯示單價。L—低電平;X—任意電平;Z—高阻態(tài),既不是高電平也不是低電平,其電平狀態(tài)由與它相連接的其它電氣狀態(tài)決定;Q0—上次的電平狀態(tài)。圖27 數(shù)碼管動態(tài)顯示電路洛陽理工學院畢業(yè)設計(論文)第3章 軟件設計 系統(tǒng)主程序在主程序模塊中,需要完成對各參量和接口的初始化、出租車起步價和單價的初始化以及中斷、計算、循環(huán)等工作。圖32 里程中斷服務子程序 中途等待中斷程序在中途等待中斷程序中,定時器1每50ms計一次數(shù),每計夠100次(5sec),便將當前里程值送入某個緩存變量,與前一個5秒的值進行比較,如果兩者相同,則表明霍爾傳感器沒有輸出信號,認為出租車停了下來,進入等待計時,計時中間變量dd自加1,計夠12次為一分鐘,dd自清零,同時根據(jù)所設的等待單價刷新總金額。如果里程大于3公里,則執(zhí)行公式:總金額=起步價+(里程3)*單價+等待時間*等待單價;否則,執(zhí)行公式:總金額=起步價+等待時間*等待單價。鍵盤程序流程圖如圖35。call stack window 調(diào)出相應變量觀察。0x7f,共陰極時加入 ||0x)控制是否顯示小數(shù)點兒,故實際計算時要做適當改動。1. 能準確計算出出租車運行里程;2. 實現(xiàn)了單價可調(diào),并可以對等待時間進行計時;,使其具備掉電存儲功能。當然還在此,我向身邊關(guān)心我的老師、同學致以誠摯的謝意!最后感謝母校對我這幾年的辛勤培養(yǎng)。 // +sbit key2=P1^2。sbit Sda=P3^7。 //分別為白天單價、夜晚單價、//等待單價、 白天夜晚單價切換暫存 、起步價uint aa,bb,temp,temp1,inter,exter。}void delayNOP( ) // 保證I2C的時序要求 ={_nop_()。_nop_()。 delayNOP( ) 。 delayNOP( ) 。 delayNOP( )。 uchar temp。 temp=Data1。Sda=1。0xfe。 Send(0xa0)。}uchar RdFromROM(uchar Addresss){ uchar Data。 Ack()。 while(1) { WrToROM (0x01,table[3])。 //while(aa) if(aa) { jshi=zongjine0/100。 wela=1。 P2=0x02。 P2=0x04。 wela=0。 dula=1。 dula=1。 P0=table[dge]amp。 P0=table[djiao]。 while(!key3)。 } } if(key2==0) { delay(5)。 //display(0,2,0,danjia2)。 if(key2==0) { danjia2。 //WrToROM (0x02,22)。 if(key2==0) { danjia3。 //WrToROM (0x03,33)。 if(key2==0) { qibu。 //WrToROM (0x04,44)。 //Scl=1。 qibu=RdFromROM(0x04)。 //開外部中斷1 // IT1=1。 //開定時器T0中斷 TR0=1。 wela=1。amp。 }void qiehuan(){ if(key4==0) //白天夜晚切換 { delay(5)。 if(qiehuantemp==0) danjia=danjia2。 qiehuan()。*/ if(key0==0) //清零鍵 { delay(5)。 TL0=(6553646080)%256。 if(temp1==temp) dd++。 if(inter==500) //設車輪周長為2米,則500個脈沖為1Km { inter=0。 //TL1=(655363000)%256。 licheng++。s CD4000 series of these pure hardware buttoned, then the circuit must be a large PCB board! But if the United States if the 7039。sZ80 is the first designed in accordance with this idea processor, then on the development of microcontroller and dedicated processors have parted ways.Are 8bit microcontroller early or4 bits. One of the most successful is the INTEL 8031, for a simple, reliable and good performance was a lot of praise. Then developed in 8031 out of MCS51 MCU Systems. SCM systems based on this system until now is still widely used. With the increased requirements of industrial control field, began a 16bit microcontroller, because the cost is not satisfactory but have not been very widely used. After 90 years with the great development of consumer electronics, microcontroller technology has been a huge increase. With INTEL i960 series, especially the later series of widely used ARM, 32bit microcontroller quickly replace highend 16bit MCU status and enter the mainstream market. The traditional 8bit microcontroller performance have been the rapid increase capacity increase pared to 80 the number of times. Currently, highend 32bit microcontroller clocked over 300MHz, the performance catching the mid9039。 } exter=qufan。 while(!exter)。 }/*void inter1() interrupt 2 //A44E外部脈沖中斷,計算里程 {if(exter==0)。 temp1=temp。 while(!key0)。 //display(123,4,56,78)。 qiehuantemp=1。 delay(5)。(licheng30)) zongjine=qibu+dengdai*danjia3。 P0=table[0]。 //TL1=(655363000)%256。 //TH0=(6553650000)/256。 dd=0。 dengdai=0。 while(!key3)。 while(!key2)。 while(!key1)。 while(!key2)。 while(!key1)。 while(!key2)。 while(!key1)。 delay(5)。 if(danjia1==100) danjia1=0。 if(key3==0) { // aa=0。 wela=1。 wela=1。 delay(4)。 delay(4)。 dula=0。0x7f。 P0=table[jshi]。 lshi=licheng0/10。 P2=rd。 return(Data)。 Send(Addresss)。 Send(Data)。}while(BitCounter)。delayNOP( )。 Scl=0。 if((tempamp。 delayNOP( )。 delayNOP( )。 delayNOP( ) 。 delayNOP( ) 。_nop_()。i0。licheng。 //里程溢出指示//sbit dula=P3^0。//sbit exter=P3^3。當然設計存在不少缺陷,做如下改進。 計價器系統(tǒng)的仿真當各個子模塊都實現(xiàn)后,聯(lián)調(diào)則主要是看當把他們?nèi)诤显谝黄饡r是否會有時序上的沖突,以及可能存在的分析不周全的地方。 delay(5)。最后解決的方法是用了鎖存器,顯示結(jié)果正常為固定的預設的八個數(shù)字。在此瞬間,段選控制I/O口輸出相應字符段選碼(字符碼),而位選則控制I/O口在該顯示的位送入選通電平,以保證該位顯示顯示相應字符。其中:X表示計數(shù)初值,TH、TL分別為16位計數(shù)器高8位和低8位應裝入的初值。若已超過,則根據(jù)里程值、每公里的單價值和起步價來計算出當前的總金額,并將結(jié)果存于總金額寄存器中;中途等待時,無脈沖輸入,不產(chǎn)生中斷,當時間超過等待設定值時,開始進行計時,并把等待金額加到總金額里,然后將總金額、里程、等待時間和單價送數(shù)碼管顯示出來。本次設計中:,;。74HC573的引腳分布圖26如下。需要注意的時,當按鍵按下和
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1