【正文】
密特觸發(fā)器、單穩(wěn)態(tài)觸發(fā)器和多諧振蕩器等多種應(yīng)用電路,在這個電路中是多諧振蕩器,它電路簡單、性能穩(wěn)定,波形標(biāo)準(zhǔn)。 圖5 數(shù)碼管封裝圖及數(shù)據(jù)線與數(shù)碼管管腳關(guān)系第3章 出租車計價器的程序設(shè)計本系統(tǒng)的軟件設(shè)計主要可分為主程序模塊、定時計數(shù)中斷程序、里程計數(shù)中斷服務(wù)程序、中途等待中斷服務(wù)程序、顯示子程序服務(wù)程序、鍵盤服務(wù)程序六大模塊。 系統(tǒng)主程序設(shè)計在主程序模塊中,需要完成對各接口芯片的初始化、出租車起價和單價的初始化、中斷向量的設(shè)計以及開中斷、循環(huán)等待等工作。然后,主程序?qū)⒏鶕?jù)各標(biāo)志寄存器的內(nèi)容,分別完成啟動、清除、計程和計價等不同的操作。當(dāng)按下S1時,就啟動計價,將根據(jù)里程寄存器中的內(nèi)容計算和判斷出行駛里程是否已超過起價公里數(shù)。當(dāng)?shù)竭_(dá)目的地的時候,由于霍爾開關(guān)沒有送來脈沖信號,就停止計價,顯示當(dāng)前所應(yīng)該付的金額和對應(yīng)的單價,到下次啟動計價時,系統(tǒng)自動對顯示清零,并重新進行初始化過程。如果里程大于3公里,則執(zhí)行公式:總金額=起步價+(里程3)*單價;否則,執(zhí)行公式:總金額=起步價。顯示程序利用定時器每1ms產(chǎn)生一次中斷,相應(yīng)變量置位,點亮一個數(shù)碼管,顯示一位數(shù)據(jù),利用主函數(shù)內(nèi)的循環(huán),實現(xiàn)動態(tài)掃描顯示,同時根據(jù)數(shù)碼管余輝和人眼暫留現(xiàn)象,即可實現(xiàn)顯示。測試包括里程計價測試。由于在系統(tǒng)設(shè)計中采用模塊設(shè)計法,所以方便對各電路模塊功能進行逐級測試。我們想到外接一個5V的直流電源,發(fā)現(xiàn)這樣會使整個系統(tǒng)顯示累贅而難以操作。于是將555的電源和地接到了最小系統(tǒng)的Vcc和地。在軟件設(shè)計過程中遇到一個嚴(yán)重的問題就是系統(tǒng)的時序設(shè)計。導(dǎo)致按鍵功能和顯示功能不能同時出現(xiàn)。將中斷子程序的部分內(nèi)容調(diào)整到主程序中調(diào)用子程序則這解決了這一問題。在課程設(shè)計的過程中,還是碰到了許多的問題。通過這幾天晚上的苦想和反復(fù)調(diào)試,以及參考網(wǎng)上的程序,最終還是把問題解決了。在動手的過程中,不僅能增強實踐能力,而且在理論上可以有更深的認(rèn)識;這次設(shè)計給了我極大的鼓舞和信心,相信在以后的學(xué)習(xí)中可以通過不斷的摸索和實踐來提高其他方面的知識。在此特別感謝我的指導(dǎo)老師:***老師。參考文獻[1] 華成英,[M].:清華大學(xué)出版社,2006[2] [M].:高等教育出版社,2004[3] 李金平,[M].北京:電子工業(yè)出版社,2007[4] 潘永雄,[M].西安:西安電子科技大學(xué)出版社,2007[5][M].北京:清華大學(xué)出版社,2004[6] [M].北京:北京航空航天大學(xué)出版社,2009[7] [M].:北京航空航天大學(xué)出版社,2005[8] [M].:中國科學(xué)技術(shù)大學(xué)出版社,2008。[10] [M].:東南大學(xué)出版社,2009。[12] [M].:北京航空航天大學(xué)出版社,2011。[14] [M].第二版. 北京:北京航空航天大學(xué)出版社,2010。 //端口定義;sbit led2=P3^4。sbit key2=P1^1。uchar Switch=OFF。uint Viameter=0。// 數(shù)碼管為共陽uint Money=0。 } while(i)。 if(key1==0) { while(!key1)。 led1=1。 led1=0。 if(key2==0) { while(!key2)。 Money=0。 led1=1。 if(key3==0) { while(!key3)。 led2=1。 led2=0。 qian=(Viameter*100)/1000。 shi=(Viameter*100)%100/10。 P2=0x01。 Delay(100)。 P0=(dat[bai]amp。 Delay(100)。 P0=dat[shi]。 P2=0x08。 Delay(100)。 qian=Money/1000。 shi=Money%100/10。 P2=0x10。 Delay(100)。 P0=dat[bai]。 P2=0x40。0x7f)。 P2=0x80。 Delay(100)。 EX0=1。 while(1) { key()。 DisM()。 if(Viameter=3) Money=60。 else Money=Money+19。s 72hour visafree policy has attracted wide attention from both Chinese and foreign experts and businessmen since it took effect on Sept 1 last year. The program permits citizens from 51 countries and regions including the United States, Australia, Canada and Japan who have valid visas and flight tickets to a third country to spend three days in the city. The capital of Sichuan province is the first city in the western region of China to offer foreign tourists a threeday visa and the fourth nationwide to adopt the policy following Shanghai, Beijing and Guangzhou. Li Zhiyong, deputy dean of the tourism institute at Sichuan University, said the move contributes to a large increase in the number of overseas tourists and raises the city39。s largest breeding and research center. Three days are long enough for foreign visitors to visit those iconic tourist spots, he noted. The city is home to the remains of the Jin sha civilization that dates back more than 3,000 years as well as the Qing cheng Mountains and the Du jiang yan irrigation system. Qing cheng has long been recognized as the birthplace of Taoism, China39。s business development. Rudy Buttignol, president of the public broadcasting pany in British Columbia, Canada, said his work requires frequent travel to Chengdu and the policy makes the trips easier. Data from the city39。s cooperation with Central Asian countries, a senior official said. Shaanxi Governor Lou Qinjian said the province is fresh, rich and unique, as it was when it anchored one end of the ancient Silk Road. It is the best option for acmodating industrial transfers from East China or the world at large, he said on Wednesday in Xi39。an, the starting point of the ancient Silk Road, a trade channel established more than 2,000 years ago linking China, Central Asia and Europe.