【正文】
江蘇農牧科技職業(yè)學院 畢業(yè)設計(論文) 題目: 基于單片機控制交通燈 姓名: xxxxxxxxx 學號: xxxxxxxxxx 二級院系部: 機電工程系 班級 : 應用電子 10 專業(yè): 應用電子技術 指導教師: xxx 職稱: 講師 二〇 一三 年 五 月 江蘇農牧科技職業(yè)學院論文(設計) I 【摘要】 隨著全球城市化進程的加快 ,機動車的使用數量也越來越多 ,造成了城市交通上的各種問題 ,如何控制好城市的交通已經成為一個全球化的問題 。 交通燈的出現使交通得以有效管制 ,對于疏導交通流量 ,提高交通通行能力 ,減少交通事故有明顯效果 。 本設計利用單片機 8051為核心部件 ,外加定時器﹑復位電路﹑晶振電路﹑顯示電路設計一個比較符合交通規(guī)則的模擬交通燈 。 設計中通過 LED七段數碼管作為計時顯示用 ,用發(fā)光二級管指示車輛的通行 ,定時器工作于方式一并定時 50ms,配 合軟件計時器調用中斷程序 ,中斷程序設置 20次 ,從而達到 1s的定時 ,同時調用顯示程序 ,顯示倒計時的時間 。 本交通燈系統(tǒng)簡單﹑實用性強﹑成本低使用維護方便 ,軟件功能強 ,運行穩(wěn)定﹑可靠的特點 。 【關 鍵詞 】 單片機 ; 交通燈 ; 定時器 江蘇農牧科技職業(yè)學院論文(設計) II Abstract As the global urbanization speeding up, the number of motor vehicles more and more, caused the various problems of urban traffic, how to control the urban traffic has bee a global problem. The emergence of the traffic light is able to effectively control the traffic, for facilitating traffic flow, improve the traffic capacity, reduce traffic accidents have obvious effect. I pick made traffic lights project, analysis of the problems of modern urban traffic control and management status quo, bined with the actual situation of urban and rural traffic illustrates the working principle of traffic light control system, this design 8051 microcontroller as the core ponents, plus timer, reset circuit, crystals circuit, display circuit design a simulation traffic light pared with the traffic rules. Through the design of LED display with seven segment digital tube for timing, using leds indicate vehicle traffic, timer timing 50 ms, along with all the work on ways to cooperate with software timer calls interrupt program, interrupt program set up 20 times, so as to achieve the timing of the 1 s, at the same time call display program, display the countdown time. This traffic light system is simple, strong practicability, low cost, convenient in operation and maintenance, software function is strong, stable running, reliable characteristic. Key Words single chip microputer。 The traffic light。 The timer 江蘇農牧科技職業(yè)學院論文(設計) III 目 錄 【摘要】 .................................................................. I 【關鍵詞】 ................................................................ I Key Words ................................................................ II 緒 論 .................................................................... 1 ...................................................... 2 設計任務 ........................................................... 2 設計要求 .......................................................... 2 方案選定 ........................................................... 3 2. 系統(tǒng)所用芯片簡介 ....................................................... 4 MCS51 單片機簡介 .................................................. 4 MCS51 單片機內部結構 ........................................ 4 MCS51 的引腳說明 ............................................ 5 8255A 并行接口芯片內部結構 ......................................... 8 74LS373 芯片簡介 ................................................... 9 3. 系統(tǒng)硬件設計 .......................................................... 11 交通燈硬件線路圖 .................................................. 11 系統(tǒng)工作原理 ..................................................... 11 ............................................................... 13 延時方法的設定 .................................................... 13 軟件延時 ......................................................... 13 時間及信號燈的顯示 ............................................... 14 8255A 并行口的擴展 .......................................... 14 顯示原理 .................................................... 14 LED 燈簡介 .................................................. 14 8255A 輸出信號與數碼管的連接 ................................ 15 程序設計 ......................................................... 16 流程圖 ........................