【正文】
理及接口技術(shù) 清華大學(xué)出版社 2008年8月[7] 戴佳 51單片機(jī)C語(yǔ)言應(yīng)用程序設(shè)計(jì)實(shí)例精講第二版 電子工業(yè)出版社 2009年11月[8] (第2版)北京:[9] 周良權(quán),傅恩錫,(第二版)北京:高等教育出版社 3[10] [11] 邱平. [12] :電力工業(yè)出版社,1980年[13] 李鳴華,. 電子技術(shù)應(yīng)用,1998年Based on SCM car anticollision system designThe College of Physics and Information Engineering07 class electronics information science and technology 070303049 gan jingchangFaculty adviser Zhu Chengquan lecturer【Abstract】This paper introduces the properties and the characteristics of AT89S51, designs a impactproof alarm with low cost, high precision, miniaturization, digital display taking it as the core . The impactproof alarm takes SCM’s realtime control and data processing functions bine with the Ultrasonic ranging technology,the sensor technologies. It is able to detecte the distance of rear obstacle and the automobile, through digital display device shows by sound circuit distance, and according to the distance situation warned. It has the vital significance to prevent automobile reverse accident.【 keywords 】 Microcontroller。 //LED控制 sbit LED2=P2^5。 //顯示函數(shù) void timeToBuffer()。 //開中斷 TMOD=0x11 //設(shè)定時(shí)器0為計(jì)數(shù),設(shè)定時(shí)器1定時(shí) ET0=1。 cl=0。 while(1) { keyscan()。 } else timeToBuffer()。 delay(200)。 delay(200)。 } void delay(i) { while(i)。 TL0=0x00。 TH1=0x9E。 csbint=1。 sj1=sj1+10。 } } xx=0。 if(sj1100) sj1=50。 } Void offmsd() //百位為0判斷模塊 { if (buffer[0] == 0xC0) buffer[0] = 0xFF。 s=sj2。break。 xx++。 sj1=40。 t=t29。 while(i) { } i=0。 if(csbds=40) { csbds=0。 xm2=s100*xm010*xm1。 delay(200)。 //顯示函數(shù) if(ssj1) bg=0。 buffer[0]=0xC6。/////////測(cè)試報(bào)警距離 sj2=200。 TH1=0x9E。 void k3cl()。unsigned int s,t,i,xx,j,sj1,sj2,sj3,mqs,sx1。 sbit csbout=P1^0。系統(tǒng)結(jié)構(gòu)簡(jiǎn)單、體積小、實(shí)時(shí)LED顯示和報(bào)警、抗干擾能力好等優(yōu)點(diǎn)。定時(shí)器1的定時(shí)時(shí)間不能太小,如果在較短的時(shí)間間隔內(nèi)發(fā)送,那么也將影響接收 [13]。報(bào)警模塊如圖9所示。然后再用超聲波脈沖重復(fù)測(cè)量。單片機(jī)AT89S51發(fā)送模塊接收模塊LED顯示報(bào)警