【正文】
d you think that you have been dismissed unfairly.For more information about dismissal and unfair dismissal, see you don39。此次畢業(yè)設(shè)計(jì)才會(huì)順利完成。最后,再次感謝老師、同學(xué)在設(shè)計(jì)中對(duì)我的關(guān)心和幫助,感謝答辯老師對(duì)我論文的審閱。 AT89C52; Stopwatch致 謝 在這次畢業(yè)設(shè)計(jì)即將結(jié)束之際,首先要感謝我的指導(dǎo)老師曲培樹(shù)老師對(duì)我在畢業(yè)設(shè)計(jì)中的指導(dǎo)和關(guān)心! 同時(shí)應(yīng)當(dāng)感謝學(xué)校給我這次設(shè)計(jì)的機(jī)會(huì),為我的設(shè)計(jì)提供了良好的設(shè)計(jì)環(huán)境以及完好設(shè)備,讓我在幾個(gè)月的設(shè)計(jì)中學(xué)到了許多寶貴的知識(shí)。我相信,在以后的工作學(xué)習(xí)中,我會(huì)更加努力,全身心地投入社會(huì),做出我理想的成績(jī)!參考文獻(xiàn)[1] ,:2142[2] 戢衛(wèi)平,胡耀輝,[M].北京:冶金工業(yè)出版社,2006:2947[3] 桑勝舉,[M].北京:中國(guó)鐵道出版社,2010:132[4] [M].北京:清華大學(xué)出版社,2005:103149[5] [M].北京:清華大學(xué)出版社,2004:2245[6] [M].北京:國(guó)防工業(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] 童詩(shī)白,[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。在這次設(shè)計(jì)中給我感受最深的就是我們應(yīng)該加強(qiáng)同學(xué)與老師之間的相互合作與配合,老師在其中起著很大作用,他時(shí)刻地洞察著你的進(jìn)展情況,關(guān)鍵時(shí)候給你指明了方向,讓你向著他理想的目標(biāo)前進(jìn)。這次畢業(yè)設(shè)計(jì)讓我收獲很大,學(xué)到很多將來(lái)一定能用到的知識(shí),設(shè)計(jì)、定時(shí)器應(yīng)用、LED應(yīng)用等。初步實(shí)現(xiàn)了具有計(jì)時(shí)、倒計(jì)時(shí)功能的電子秒表設(shè)計(jì)。 }}5 結(jié)論本次畢業(yè)設(shè)計(jì)的任務(wù)是以單片機(jī)AT89C52作為控制核心,設(shè)計(jì)電子秒表,使其具有計(jì)時(shí)、倒計(jì)時(shí)功能。 Break。 P1=table[LED1]。 Break。 P1=table[LED2]。 Break。 P1=table[LED3]。 Break。 P1=table[LED4]。 //計(jì)算十分一秒位數(shù)值 LED4=n%10。 //計(jì)算秒位數(shù)值 n=n%100。1000。 LED1=a。{ uint n,a。add1(time)是用來(lái)計(jì)算數(shù)碼管各個(gè)位要顯示的數(shù)值的子程序,display()是查段位碼表及進(jìn)行動(dòng)態(tài)掃描的子程序。 } display()。 if(mm==20)mm=0。 if(ms==10) { ms=0。 TH0=0xfc。定時(shí)的時(shí)間設(shè)為1ms,用于數(shù)值顯示;同時(shí)利用累加的方法實(shí)現(xiàn)10ms和200ms的定時(shí),用于鍵盤(pán)的掃描及控制顯示燈的閃爍。 if(mm==0)P2_6=!P2_6。 //計(jì)時(shí)停止if(count_down==1) //倒計(jì)時(shí)開(kāi)始 { if(m0)m。 add1(m)。 m++。}if(start==1) //計(jì)時(shí)開(kāi)始{ if(mm==0){ P2_7=!P2_7。 m。 P2_7=1。 bit_sub=0。 m。 }if(fast_sub==1) //倒計(jì)時(shí)初值連續(xù)減少{ P2_6=0。 m=m10。 }if(double_sub==1) //倒計(jì)時(shí)初值快速減少 { P2_6=0。 m++。 P2_7=1。 bit_add1=0。 m++。}if(fast_add==1) //倒計(jì)時(shí)初值連續(xù)增加{ P2_6=0。 m=m+10。if(double_key==1) //倒計(jì)時(shí)初值快速增加{ P2_6=0。){ if(scankey==1) //進(jìn)行鍵盤(pán)掃描 { scankey=o。 TR0=1。 EA=1。 TL0=0x18。void main(void){begin1()。(1)主程序在主程序中需要完成以下的功能:首先調(diào)用初始化函數(shù)對(duì)各個(gè)變量進(jìn)行初始化,再對(duì)定時(shí)器的定時(shí)初值進(jìn)行設(shè)定,接著根據(jù)各個(gè)標(biāo)志位的值來(lái)判斷單片機(jī)的工作模式及工作狀態(tài)。 計(jì)時(shí)功能流程圖圖41 計(jì)時(shí)功能流程圖 圖42 倒計(jì)時(shí)初值增加流程圖圖43 倒計(jì)時(shí)初值減少流程圖 圖44 倒計(jì)時(shí)開(kāi)始流程圖 主要程序代碼全部的程序包括了頭文件、變量的定義、主程序及各子程序。鍵盤(pán)查詢和數(shù)據(jù)顯示的部分在定時(shí)中段服務(wù)子程序中完成。 主要變量說(shuō)明 程序中用到的關(guān)鍵變量說(shuō)明如表41和表42所示。 程序功能及主要變量的說(shuō)明 程序功能 電子秒表程序主要完成如下功能:(1) 兩種計(jì)時(shí)模式的啟動(dòng)、停止、復(fù)位功能的秒表。4 系統(tǒng)軟件設(shè)計(jì)系統(tǒng)硬件設(shè)計(jì)好之后,接下來(lái)就要進(jìn)行軟件設(shè)計(jì)。而復(fù)位電路則通過(guò)按鍵的作用,實(shí)現(xiàn)系統(tǒng)的默認(rèn)設(shè)置,對(duì)電路起到復(fù)位的作用。LED5—LED6則作為狀態(tài)指示燈根據(jù)單片機(jī)的狀態(tài)顯示計(jì)時(shí)和倒計(jì)時(shí)兩種工作狀態(tài)來(lái)做出相應(yīng)的明亮變化:在準(zhǔn)備計(jì)時(shí)時(shí)LED5亮,LED6熄滅;在準(zhǔn)備倒計(jì)時(shí)的時(shí)候LED5熄滅,LED6亮。 系統(tǒng)總體電路 單片機(jī)電子秒表的原理圖如圖38所示。:和LED6相連,用于顯示