【正文】
M 陣列和三個(gè)鎖定位的電擦除可通過正確的控制信號(hào)組合,并保持 ALE 管腳處于低電平 10ms 來完成。該反向放大器可以配置為片內(nèi)振蕩器。在 FLASH 編程期間,此引腳也用于施加 12V 編程電源( VPP)。在由外部程序存儲(chǔ)器取指期間,每個(gè)機(jī)器周期兩次 /PSEN有效。此時(shí), ALE只有在執(zhí)行 MOVX,MOVC 指令是 ALE 才起作用。在平時(shí), ALE 端以不變的頻率周期輸出正脈沖信號(hào),此 頻率為振蕩器頻率的 1/6。 RST:復(fù)位輸入。 P3 口: P3 口管腳是 8 個(gè)帶內(nèi)部上拉電阻的雙向 I/O 口,可接收輸出4 個(gè) TTL 門電流。這是由于內(nèi)部上拉的緣故。 P1 口管腳寫入 1 后,被內(nèi)部 上拉為高,可用作輸入, P1 口被外部下拉為低電平時(shí),將輸出電流,這是由于內(nèi)部上拉的緣故。當(dāng) P1 口的管腳第一次寫 1 時(shí),被定義為高阻輸入。 低功耗的閑 置和掉電模式 32 可編程 I/O 線 數(shù)據(jù)保留時(shí)間: 10 年 1. 主要特性 開關(guān)的作用是便于為最小系統(tǒng)板上的程序的燒寫提供電源。 紅外避障電路 紅外發(fā)射二極管發(fā)射的紅外線遇到障礙物后,被反射回來,接收管接收到紅外線,信號(hào)被 LM358 放大后再經(jīng) LM567 鎖相環(huán)后輸出低電平,并送給單片機(jī)進(jìn)行處理。由此可見,測(cè)距輪每轉(zhuǎn)一周,紅外光接收管均能接收到一個(gè)脈沖信號(hào)經(jīng)過整形器后送入計(jì)數(shù)器或直接送入單片機(jī)中。測(cè)長輪的周長 為記數(shù)的單位,最好取有效值為單一的數(shù)值(如本設(shè)計(jì)中采用 米),精度根據(jù)電動(dòng)車控制的需要確定。放大和施密特整形電路如圖 八 所示。由于光柵隨電機(jī)高速轉(zhuǎn)動(dòng),則紅外線三極管接收到的就是一系列脈沖信號(hào)。在小車行走過程中,若向左方向偏離黑線 ,則右側(cè)的探頭就會(huì)檢測(cè)到黑線,把信號(hào)傳給單片機(jī)。 超聲波檢測(cè)電路 供電電源方案的選擇 采用單一電源供電。用這種方案能很精確的算出小車已經(jīng)走過的距離。 第 17 頁 H 橋控電路 路程檢測(cè)方案的選擇 采用光電碼盤進(jìn)行檢測(cè)。電路如 下圖 所示 : 第 16 頁 2. 電動(dòng)機(jī)的選擇 采用普通直流電機(jī)。開 始由手動(dòng)啟動(dòng)小車,并復(fù)位,當(dāng)經(jīng)過規(guī)定的起始黑線,由超聲波傳感器和紅外光電傳感器檢測(cè),通過單片機(jī)控制小車開始記數(shù)顯示并避障、調(diào)速;系統(tǒng)的自動(dòng)避障功能通過超聲波傳感器正前方檢測(cè)和紅外光電傳感器左右側(cè)檢測(cè),由單片機(jī)控制實(shí)現(xiàn);在電動(dòng)車進(jìn)駛過程中,采用雙極式H 型 PWM 脈寬調(diào)制技術(shù),以提高系統(tǒng)的靜動(dòng)態(tài)性能;采用動(dòng)態(tài)共陰顯示行駛時(shí)間和里程。程序設(shè)計(jì)上使用了時(shí)鐘中斷來控制小車行駛的狀態(tài)檢測(cè),使用外部中斷來記錄 第 12 頁 小車行駛的距離,軟件上設(shè)置了一個(gè)狀態(tài)寄存器,來記錄小車運(yùn)行的狀態(tài),小車的運(yùn)行為延黑線行駛狀態(tài),避障礙物狀態(tài)等。 第一章 智能小車總體概況 智能小車以 AT89C51為核心,經(jīng)焊接相關(guān)芯片用電路板自制而成,通過 I/O 口檢測(cè)信號(hào),輸出信號(hào)到 L293D,從而驅(qū)動(dòng)兩個(gè)直流電機(jī)控制其前進(jìn)、停止、左轉(zhuǎn)、右轉(zhuǎn)。 本設(shè)計(jì)就采用了比較 先進(jìn)的 89C51為控制核心, 89C51采用 CHOMS工藝,功耗很低。 第三代單片機(jī)包括了 Intel公司發(fā)展 MCS51系列的新一代產(chǎn)品,如 8x C152﹑ 80C51FA/FB﹑ 80C51GA/GB﹑ 8x C451﹑ 8x C452,還包括了 Philips﹑ Siemens﹑ ADM﹑ Fujutsu﹑ OKI﹑ HarriaMetra﹑ ATMEL等公司以 89C51 為核心推出的大量各具特色﹑與 89C51 兼容的單片機(jī)。本設(shè)計(jì)采用 MCS51 系列中的 AT89C51 單片機(jī)。本題目是結(jié)合科研項(xiàng)目而確定的設(shè)計(jì)類課題。 關(guān)鍵詞: AT89C51單片機(jī);光電傳感器; PWM 調(diào)速;電動(dòng)小車 Smart cars designthe AT89C51 microcontroller is one of eight, his versatility and usability is the user high praise. This system to design for the purpose of the topic request, AT89C51 microcontroller as control core, ultrasonic sensor detection road barriers, the automatic control of electric car obstacleavoidance, speed, and speed, and can be automatically stop recording time, 第 3 頁 mileage and speed, automatic tracing and light function. The whole system of the circuit structure is simple, reliable performance. The test results, this paper introduces the hardware design method of system analysis and test results. In the design of the control system of intelligent car, USES AT89C51 as the core, with L293D drive two dc motor driving car, when the signal generation, is going through tracing module of the infrared tubes are found by the black level signal generated LM393 singlechip microcontroller, return again according to the requirement of design procedure of judgment for motor driver module, let the car to achieve progress, left, right, the basic function such as parking. Find the white line, and the external environment of the strength of the light of sports car produce very big effect, this based on the experiments of tracing refers to the white striped floor found. Tracing is through infrared tubes and receive tube recognition path. Using the technology mainly include: (1) through programming to control the speed of the car, (2) sensor effective application, (3) new display chip USES, This design report is divided into five chapters: The first chapter is intelligent car overview. Introduces the 第 4 頁 function and the car show car model. Chapter 2 is the system requirements. Introduces the design requirement and the principle of car. Expounds the functional modules of the scheme parison and argumentation, the final solution. The third chapter is hardware realization and unit circuit implementation. Expounds each part of the circuit design, and gives the principle diagram. Chapter four is a software design. Introduces the design idea and program flow chart and design program. The fifth chapter is debugging systems. Introduces the WAVE, and software testing software debugging process, Hardware testing and testing instruments and equipment, etc. The references and appendix. Keywords: AT89C51, photoelectric sensors, PWM control, electric cars 目 錄 緒論 ..............................................................5 第 5 頁 第一章 智 能 小 車 總 體 概況 ..........................................6 1 . 1 概況 ....................................................6 1 . 2 總 體 結(jié) 構(gòu)圖 ..............................................6 第二章 系 統(tǒng) 方 案 設(shè)計(jì) ..............................................7 2 . 1 方案論證 ................................................7 2. 1. 1 系統(tǒng)原理圖 ..........................................7 2. 1. 2 路面情況檢測(cè)方案的選擇 ..............................8 2. 1. 3 電動(dòng)機(jī)的選擇 ........................................9 2. 1. 4 電動(dòng)機(jī)驅(qū)動(dòng)方案的選擇 ................................9 第 6 頁 2 . 1 . 5 路 程 檢 測(cè) 方 案 的 選擇 ..................................9 2. 1. 6 障礙物探測(cè)方案的選擇 ................................10 2. 1. 7 供電電源方案的 選擇 ..................................10 第三章 系統(tǒng)硬件電路設(shè)計(jì) ..........................................11 3. 1 系統(tǒng)硬件設(shè)計(jì) ...........................................11 3. 1. 1 路面黑線檢測(cè)設(shè)計(jì)與實(shí)現(xiàn) ..............................11 3. 1. 2 電動(dòng)機(jī)驅(qū)動(dòng)電路設(shè)計(jì)與實(shí)現(xiàn) ............................11 3. 1. 3 車輪檢速與路程計(jì)算 ..................................13 第 7 頁 3. 1. 4 紅外避障電路 ........................................15 3. 1. 5 電源電路 ............................................15 第四章 主 控 芯 片 介紹 .............................................16 4 . 1 . 1 AT89C51 主控芯片介紹 .................................16 4 . 1 . 2 電 動(dòng) 機(jī) 驅(qū) 動(dòng) 芯 片L293D.................................18 4 . 1 . 3 串 口 電 路 芯 片MAX232..................................19 第五章 軟 件 設(shè)計(jì) ............