【文章內(nèi)容簡介】
7=1。 sub=0。 m。 add1(m)。}if(start==1) //計時開始{ if(mm==0){ P2_7=!P2_7。 P2_6=1。 m++。 if(mm==6000)m=0。 add1(m)。 }if(stop==1) start=0。 //計時停止if(count_down==1) //倒計時開始 { if(m0)m。 P2_7=1。 if(mm==0)P2_6=!P2_6。 }}}(2)定時器中斷子程序這里的秒表的計時、鍵盤的掃描及數(shù)值顯示燈都是利用定時中斷來完成的。定時的時間設(shè)為1ms,用于數(shù)值顯示;同時利用累加的方法實現(xiàn)10ms和200ms的定時,用于鍵盤的掃描及控制顯示燈的閃爍。void time0(void){ TL0=0x18。 TH0=0xfc。 ms++。 if(ms==10) { ms=0。 mm++。 if(mm==20)mm=0。 scankey=1。 } display()。 }(3)顯示子程序顯示子程序其實包括了display()和add1(time)兩個子程序。add1(time)是用來計算數(shù)碼管各個位要顯示的數(shù)值的子程序,display()是查段位碼表及進(jìn)行動態(tài)掃描的子程序。void add1(time) uint time。{ uint n,a。 a=time/1000。 LED1=a。 //計算十秒位數(shù)值 n=timeamp。1000。 LED2=(n/100)。 //計算秒位數(shù)值 n=n%100。 LED3=(n/10)。 //計算十分一秒位數(shù)值 LED4=n%10。 //計算百分一秒位數(shù)值 }void display(void){ switch(ms%4) { case o: P3=0xfe。 P1=table[LED4]。 P1_7=1。 Break。 case 1: P3=0xfd。 P1=table[LED3]。 P1_7=1。 Break。 case 2: P3=0xfb。 P1=table[LED2]。 P1_7=1。 Break。 case o: P3=0xf7。 P1=table[LED1]。 P1_7=1。 Break。 default:return。 }}5 結(jié)論本次畢業(yè)設(shè)計的任務(wù)是以單片機(jī)AT89C52作為控制核心,設(shè)計電子秒表,使其具有計時、倒計時功能。通過我?guī)讉€月的努力,本次畢業(yè)設(shè)計取得了較好的成果,基本上達(dá)到了本次畢業(yè)設(shè)計任務(wù)書的要求。初步實現(xiàn)了具有計時、倒計時功能的電子秒表設(shè)計。雖然還有一些欠缺的地方,但是總體來說這次的畢業(yè)設(shè)計還是很成功的。這次畢業(yè)設(shè)計讓我收獲很大,學(xué)到很多將來一定能用到的知識,設(shè)計、定時器應(yīng)用、LED應(yīng)用等。更重要的是,我學(xué)會了軟硬件開發(fā)的思想。在這次設(shè)計中給我感受最深的就是我們應(yīng)該加強(qiáng)同學(xué)與老師之間的相互合作與配合,老師在其中起著很大作用,他時刻地洞察著你的進(jìn)展情況,關(guān)鍵時候給你指明了方向,讓你向著他理想的目標(biāo)前進(jìn)。同時,我們作為學(xué)生要能理解老師的一番苦意,我們要有進(jìn)取心,持之以恒的精神,遇到困難不能氣餒,只有這樣才能讓指導(dǎo)老師看到成功的希望。我相信,在以后的工作學(xué)習(xí)中,我會更加努力,全身心地投入社會,做出我理想的成績!參考文獻(xiàn)[1] ,:2142[2] 戢衛(wèi)平,胡耀輝,[M].北京:冶金工業(yè)出版社,2006:2947[3] 桑勝舉,[M].北京:中國鐵道出版社,2010:132[4] [M].北京:清華大學(xué)出版社,2005:103149[5] [M].北京:清華大學(xué)出版社,2004:2245[6] [M].北京:國防工業(yè)出版社,2008:32117[7] Kai E, Sawata S, Lkebukuro K et al. Detection of PCR product in solution using surface plasmon resonance. Analytical elctrical. :796800[8] Verghese G C, Lang H, Casey L F. Analysis of instability in electrical machines .IEEE Transon IA, 1986, 22 :853864[9] [M].北京:機(jī)械工業(yè)出版社,2005: 179[10] 童詩白,[M].北京:高等教育出版社,2009:379[11] 葉挺秀,張伯堯. :2580[12] 許日濱,[M].北京:人民郵電出版社,2000:15169[13] [M].北京:北京理工大學(xué)出版社,2009:70128[14] [M].北京:清華大學(xué)出版,2008:69214[15] [M].北京航空航天大學(xué)出版社,:103105Stopwatch design based on SCMGao Shangchao(College of Physics and Electronic Information, Dezhou University, Dezhou, 253023)Abstract With puter penetration in the social sphere, SCM applications are constantly deepening, and promote the traditional control detection technology update. Single chip is integrated on a chip microputer, including CPU, random access memory, a readonly memory, input / output interface circuit, timer / counter and other parts. In this paper the main train of thought of the design is the use of AT89C52 microcontroller as the central processor, the application of LED digital display, design has a timer and countdown function electronic stopwatch. The design of the multifunction stopwatch system uses AT89C52 microcontroller as the central device, and use its timer / counter timing and the count principles, bined with display circuit, LED digital tube, as well as the external interrupt circuit to design a timer. The software and hardware together organically, allowing the system to achieve four LED display has a timer and countdown function electronic stopwatch. Keywords SingleChip Microputer。 LED figures tube display。 AT89C52; Stopwatch致 謝 在這次畢業(yè)設(shè)計即將結(jié)束之際,首先要感謝我的指導(dǎo)老師曲培樹老師對我在畢業(yè)設(shè)計中的指導(dǎo)和關(guān)心! 同時應(yīng)當(dāng)感謝學(xué)校給我這次設(shè)計的機(jī)會,為我的設(shè)計提供了良好的設(shè)計環(huán)境以及完好設(shè)備,讓我在幾個月的設(shè)計中學(xué)到了許多寶貴的知識。這里還要感謝自己的同學(xué)們,他們的幫助使得這次的設(shè)計最終順利的完成。最后,再次感謝老師、同學(xué)在設(shè)計中對我的關(guān)心和幫助,感謝答辯老師對我論文的審閱。 然后還要感謝大學(xué)四年來所有的老師,為我們打下專業(yè)知識的基礎(chǔ);同時還要感謝所有的同學(xué)們,正是因為有了你們的支持和鼓勵。此次畢業(yè)設(shè)計才會順利完成。 最后,感謝我的母校德州學(xué)院老師們四年來對我的大力栽培,謝謝您們!g an employment tribunal claimEmployment tribunals sort out