【正文】
P3=0X7B。a0amp。amp。 P3=0xeF。 disp()。 for(m=60。 find_code[1]=12。 find_code[3]=4。 delay500ms()。 //有條件轉(zhuǎn)移 TR0=0。 EA=1。amp。 TH0=0x3C。i8。 //S3 鍵處理緊急狀況 uchar time。 [3] 康華光,《電子技術(shù)基礎(chǔ) 數(shù)字部分 (第五版 )》,高等教育出版社。 由于使用的是單片機(jī)作為核心的控制元件,使得電路的 可靠性比較高,功能也比較強(qiáng)大,而且可以隨時(shí)的更新系統(tǒng),進(jìn)行不同狀態(tài)的組合。 第二,在軟件調(diào)試過(guò)程中,使我又一次復(fù)習(xí)了 keil 和 proteus 聯(lián)合使用的方法。 本次設(shè)計(jì)中, S1 鍵按下后,開(kāi)啟交通燈;當(dāng) S2 鍵按下后,關(guān)閉交通燈,當(dāng) S3 鍵按下后,是應(yīng)急車道通車。延時(shí)函數(shù)在顯示函數(shù)中用到,由于時(shí)間比較短,就采用純軟件的方法延時(shí)。除此之外還有晶振電路,復(fù)位電路,電源電路和下載口電路。 關(guān)鍵詞: 單片機(jī); AT89S52; 交通燈 湖南工學(xué)院《單片機(jī)課程設(shè)計(jì)說(shuō)明書(shū)》 ABSTRACT Traffic light control system based on SCM (Single Chip Microputer) is designed in this paper. System requires that MCS51 series SCM is used as CPU. Traffic light control system should be designed and made .There are four groups light which indicate to turn left, turn right, and go straight ahead and pedestrian access in east, west, north and south four directions. Timer shows traffic conversion remainder time. When special vehicles, such as 119,120 go through, the system can automatically allow special vehicles running and other vehicles is prohibited. Based on analysis of the system functions, three schemes areput forward .By parison, LED dynamic cycle display scheme has better functions and it is selected to be designed. The design includes hardware part and software part. Hardware has three parts .They are SCM system, LED time display, traffic lights. AT89S52 SCM is selected as control CPU. LED display and traffic lights are set in east, west, north and south four directions. Three LED monitors are used to show time. Highlight and redgreen two clor traffic lights are used as traffic lights. Software is designed by module. It is divided into main program, timer interrupting service subroutine, LED display subroutine, traffic display subroutine. Key words: scm; AT89S52 ; traffic light 湖南工學(xué)院《單片機(jī)課程設(shè)計(jì)說(shuō)明書(shū)》 目 錄 1 設(shè)計(jì)課題任務(wù)、功能要求說(shuō)明及總體方案介紹 .............................................................. 1 設(shè)計(jì)課題任務(wù)與功能要求 ..................................................................................... 1 設(shè)計(jì)課題總體方案介紹及工作原理說(shuō)明 ................................................................ 1 2 設(shè)計(jì)課題硬件系統(tǒng)的設(shè)計(jì) .............................................................................................. 2 設(shè)計(jì)課題硬件系統(tǒng)各模塊功能簡(jiǎn)要介紹 ............................................................... 2 主控制系統(tǒng)模塊 ........................................................................................ 2 按鍵電路 ................................................................................................... 2 流水燈電路 ................................................................................................ 3 數(shù)碼管 電路 ..................................