外文翻译---基于单片机的十字路口交通灯控制器的设计
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
附件1:外文文献原文
BASED ON MCU INTERSECTION TRAFFIC LIGHTS THE CONTROLLER DESIGN
Because of the rapid development of our economy resulting in the car number of large and medium-sized cities surged and the urban traffic, is facing serious test, leading to the traffic problem increasingly serious, its basically are behaved as follows: traffic accident frequency, to the human life safety enormous threat, Traffic congestion, resulting in serious travel time increases, energy consumption increase; Air pollution and noise pollution degree of deepening, etc. Daily traffic jams become people commonplace and had to endure. In this context, in combination with the actual situation of urban road traffic, develop truly suitable for our own characteristics of intelligent signal control system has become the main task.
Preface
In practical application at home and abroad, according to the actual traffic signal control application inspection, planar independent intersection signal control basic using set cycle, much time set cycle, half induction, whole sensor etc in several ways. The former two control mode is completely based on planar intersection always traffic flow data of statistical investigation, due to traffic flow the existence of variable sex and randomicity, the two methods have traffic efficiency is low, the scheme, the defects of aging and half inductive and all the inductive the two methods are in the former two ways based on increased vehicle detector and according to the information provided to adjust cycle is long and green letter of vehicle, it than random arrived adaptability bigger, can make vehicles in the parking cord before as few parking, achieve traffic flowing effect In modern industrial production,current,voltage,temperature, pressure, and flow rate, velocity, and switch quantity are common mainly controlled parameter. For example: in metallurgical industry, chemical production, power engineering, the papermaking industry, machinery and food processing and so on many domains, people need to transport the orderly control. By single chip microcomputer to control of traffic, not only has the convenient control, configuration simple and flexible wait for an advantage, but also can greatly improve the technical index by control quantity, thus greatly improve product quality and quantity. Therefore, the monolithic integrated circuit to the traffic light control problem is an industrial production we often encounter problems.
In the course of industrial production, there are many industries have lots of traffic equipment, in the current system, most of the traffic control signal is accomplished by relays, but relays response time is long, sensitivity low, long-term after use, fault opportunity increases greatly, and adopts single-chip microcomputer control, the accuracy of far greater than relays, short response time, software reliability, not because working time reduced its performance sake, compared with, this solution has the high feasibility.
About AT89C51
(1)function characteristics description:
AT89C51 is a low power consumption, high performance CMOS8 bit micro-controller, has the 8K in system programmable Flash memory. Use high-density Atmel company the beltpassword nonvolatile storage technology and manufacturing, and industrial 80S51 product instructions and pin fully compatible. Chip Flash allow program memory in system programmable, also suitable for conventional programmer. In a single chip, have dexterous 8 bits CPU and in system programmable Flash, make AT89C51 for many embedded control application system provides the high flexible, super efficient solution. A T89C51 has the following standard function: 8k bytes Flash, 256 bytes RAM, 32-bit I/O mouth line, the watchdog timer, two data pointer, three 16 timer/counter, a 6 vector level 2 interrupt structure, full-duplex serial port, piece inside crystals timely clock circuit. In addition, AT89C51 can drop to 0Hz static logic operation, support two software can choose power saving mode. Idle mode, the CPU to stop working, allowing the RAM, timer/counter, serial ports, interruption continue to work. Power lost protection mode, RAM content being saved, has been frozen, microcontroller all work stop, until the next interruption or hardware reset so far. As shown in figure 1 for the AT89C51 pins allotment.
Figure 1 the A T89C51 pins allotment
(2)interrupt introduction
AT89C51 has six interrupt sources: two external interruption, (and), three timer interrupt (timer 0, 1, 2) and a serial interrupts. Each interrupt source can be passed buy bits or remove IE the relevant special register interrupt allow control bit respectively make effective or invalid interrupt source. IE also includes an interrupt allow total control bit EA, it can be a ban all interrupts. IE. Six is not available. For AT89C51, IE. 5 bits are also not be used. User software should not give these bits write 1. They AT89 series for new product reserved. Timer 2 can be TF2 and the T2CON registers EXF2 or logical triggered. Program into an interrupt service, the sign bit can be improved by hardware qing 0. In fact, the interrupt service routine must determine whether TF2 or EXF2 activation disruption, the sign bit must also by software qing 0. Timer 0 and 1 mark
a timer TF0 and TF1 has been presented in the cycle count overflow S5P2 074 bits. Their value until the next cycle was circuit capture down. However, the timer 2 marks a TF2 in count overflow of the cycle of S2P2 074 bits, in the same cycle was circuit capture down
Table 1
Table 2
About 8255 chip
1.8255 features:
(1)A parallel input/output LSI chips, efficacy of I/O devices, but as CPU bus and peripheral interface.
(2)It has 24 programmable Settings of I/O mouth, even three groups of 8 bits I/O mouth to mouth, PB mouth and PA PC mouth. They are divided into two groups 12 I/O mouth, A group including port A and C mouth (high four, PC4 ~ PC7), including group B and C port B mouth (low four, PC0 ~ PC3). A group can be set to give basic I/O mouth, flash control (STROBE) I/O flash controlled, two-way I/O3 modes, Group B can only set to basic I/O or flash controlled the I/O, and these two modes of operation mode entirely by controlling registers control word decision.
2. 8255 pins efficacy:
(1). RESET: RESET input lines, when the input outside at high levels, all internal registers (including control registers) were removed, all I/O ports are denoting input methods.
(2). CS: chip choose a standard lamp line 1, when the input pins for low levels, namely/CS = 0, said chip is selected, allow 8255 and CPU for communications, / CS = 1, 8255 cannot with CPU do data transmission.
(3). RD: read a standard lamp line 1, when the input pins for low levels, namely/RD = 0 and/CS = 0, allow 8255 through the data bus to the CPU to send data or state information, namely the CPU 8255 read from the information or data.
(4). The WR: write a standard lights, when the input pins for low levels, namely/WR = 0 and/CS = 0, allows the CPU will data or control word write 8255.
(5). D7: three states D0 ~ two-way data bus, 8255 and CPU data transmission channel, when the CPU execution input/output instruction, through its realization 8 bits of data read/write operation, control characters and status information transmitted through the data bus.
(6). PA0 ~ PA7: port A input and output lines, A 8 bits of data output latches/buffers, an 8 bits of data input latches.
(7). PB0 ~ PB7: port B input and output lines, a 8 bits of I/O latches, an 8 bits of input and output buffer.
(8). PC0 ~ PC7: port C input and output lines, a 8 bits of data output latches/buffers, an 8 bits of data input buffer. Port C can through the way of working setting into two four ports, every 4 digit port contains A 4 digit latches, respectively with the port A and port B cooperate to use, can be used as control standard lights output or state standard lights input ports.
(9). A0, A1: address selection line, used to select the PA 8255 mouth, PB mouth, PC mouth and controlling registers.
When A0=0, A1= 0, PA mouth be chosen;
When A0=0, A1 = 1, PB mouth be chosen;
When A0=0, A1 = 1, PC mouth be chosen;
When A0=1, A1= 1, control register is selected.
Concerning seven section LED display introduction Through light emitting diode chip appropriate link (including series and parallel) and appropriate optical structure. May constitute a luminous display light-emitting segments or shine points. By these luminous segments or shine point can be composed digital tube, symbols tube, m word pipe, tube, multilevel matrix display tube etc. Usually the digital tube, symbols tube, m word tube were called stroke display, but the stroke displays and matrix tube collectively referred to as character displays.
1. The LED display classification
(1) by word high marks: stroke monitors word high least 1mm (monolithic integrated type more digital tube word high in commonly 2 ~ 3mm). Other types of stroke display tiptop 1.27 mm (0.5 inch) even up to hundreds of mm.
(2) color-coded score red, orange, yellow, green and several kinds.
(3) according to the structure points, reflecting cover type, a single point-elastic and monolithic integrated type.
(4) from the luminous section electrode connection mode of points of anode and cathode two kinds.
2. LED display parameters
Due to the LED display is LED based, so its light, and the electrical characteristics and ultimate meaning of the parameters with most of the same light emitting diode. But because the LED monitor containing multiple light emitting diode, it must has the following specific parameters:
(1) the luminous intensity ratio
Due to the digital tube paragraphs in the same driving voltage, each are not identical, so positive current each different. The luminous intensity All segments of the luminous intensity values the ratio of the maximum and minimum values for the luminous intensity ratio. The ratio between 2.3 in 1.5 ~, the maximum cannot exceed 2.5.
(2) pulse positive current
IF each segment of typical strokes displays for positive dc working current IF, then the pulse, positive current can be far outweigh.someotherwordpeopledontthinkoffirst. Pulse 390v smaller, pulse positive current can be bigger.
Traffic signal control type
The purpose of the traffic signal control are three: first,in time and space space intersection traffic in different directions,control traffic operation order; Second, make on planar cross the road network on the people and objects of transport at the highest efficiency, Third, as the road users to provide necessary information, and help them to effectively use the traffic facilities. Road traffic signal control of basic types have many points method.
According to the control geometry characteristic is divided into: single intersection control - point control, the traffic trunk lines of coordinated control - wire, traffic network coordination control surface controlling; -- According to the control principle differentiates: timing control, induced control and adaptive control.
About watch-dog circuit
By single-chip computers.the micro computer system, because of single chip work often can be affected by external electromagnetic interference, causing program run fly while into dead circulation, the program's normal operation be interrupted by single chip microcomputer control system was unable to work, can cause the whole system of come to a standstill, happen unpredictable consequences, so out of microcontroller running status real-time.according consideration, they generate a specially used for monitoring microcontroller program running state of the chip, commonly known as "watchdog" (watchdog).
MAX692 was slightly system monitoring circuit chip, have back-up battery switching, power lost discriminant functions monitoring, the watchdog. The encapsulation and pin instructions as figure2shows.
Figure 2 MAX692 encapsulation and pins
Watch-dog circuit application, make SCM can in no condition to achieve continuous work, its working principle is: the watchdog chip and MCU an I/O pins are linked together, the I/O pins through program control it regularly to the watchdog of the pins on into high level (or the low level), this program statement is scattered on SCM other control statements, once among single-chip due to the interference makes application run into a fly after the procedures section into dead circulation state, write the watchdog pins program cannot be executed, this time, the watch-dog circuit will be without microcontroller sent signals, then at it and MCU reset pin connected pin reset signal give out a a, make SCM reposition occurs, namely the program from program memory splittext started, so we realized the MCU automatic reset.
Infrared detection circuit
The infrared radiation photon in semiconductor materials stimutes the non-equilibrium carriers (electronic or holes), cause electrical properties change. Because carrier does not escape in vitro, so called within the photoelectric effect. Quantum photoelectric effect high sensitivity, response speed heat detectors much faster, is optional detectors. In order to achieve the best performance, generally need worked in low temperature. Photoelectric detector can be divided into:
(1) optical type: also called photoconductive resistance. The incident photon stimulate the valence band uniform semiconductor electronic across forbidden band into the conduction band and left in valence band, cause cavitation increases, for electric conductance eigen light conductivity. From the band gaps of impurity level also can stimulate light into the conduction band or born carriers valence band, and for impurities light conductivity. The cutoff wavelength by impurity ionization energy (ie) decision. Quantum efficiencies below eigen optical and require lower working temperature.
(2) photovoltaic type: mainly p - n knot of light born volts effect. Energy more than the
width of infrared photonic band gaps in "area and its nearby of electrons cavitation. Existing "electric field make hole into p area, electronic into n area, two parts appear potentials. Deoxidization device have voltage or current signal. Compared with optical detectors, pv detector detect rate more than forty percent of figure limit, Don't require additional bias electric field and load resistance, no power consumption, having a high impedance. These characteristics of preparation and use of the focal plane array bring great benefits.
(3) light emitting - Schottky potential barrier detector: metal and semiconductor contact, typically include PtSi/Si structure and form was Schott potential barrier, infrared photon through Si layer for PtSi absorption, electronic Fermi level, obtain energy leap over left cavitation potential barrier into the Si substrate, PtSi layer of electronic was collected, complete infrared detection. Make full use of Si integration technology, facilitate production, with lower cost and good uniformity wait for an advantage, but make it mass (1024 x 1024 even greater) focal plane array to make up for the defect of quantum low efficiency. Have strict low temperature requirements. With this kind of detector, both at home and abroad has already produced as qualitative good thermography. Pt Si/Si structure made of FPA is the earliest IRFPA.
Timing counting and traffic calculation
Using MCS - 51 internal timer/counter for timing, cooperate software delay realizes the timer. This method hardware cost saving, cut allows the reader in timer/counter use, disruptions and programming get exercise and improve. Computation formula is as follows: TC = M - C
Type in, M for counter touch value, the value and the counter working way concerned.
For a traffic intersection, it can in the shortest possible time to achieve maximum traffic, even reached the best performance, we call in unit of time to achieve the maximum flow multi-energy for cars.
Use the equation: (traffic = traffic/time) to represent.
Intersection traffic lights used to create the general thoughts Cross the road traffic is traffic laws of the silent commands, is drivers and pedestrians standards of behaviour. Cross the road traffic lights control is the guarantee of traffic safety and the roads of the key. At present, the domestic most cities are adopting "automatic" red and green lights, it has fixed "red light - green" conversion interval, and automatic switching. They generally by "transit and prohibit time control display, red yellow green lights and direction indicator" three parts. In the traffic light transit and prohibit time control and display, usually either east-west and south-north direction every 50 seconds; two Either according to the traffic rules, things direction 60 seconds, north-south direction 40 seconds, time control are fixed. The traffic light time control and display, with a fixed time value in advance "petrification" in the SCM, every time only in certain period changing alternately. But, in fact, of different time vehicles is very complex
circulation conditions, is highly nonlinear, random, also often be think influences. Adopt timing control often causing road effective application waste of time, there is less, the red light green direction vehicle direction vehicle backlog. It regardless of the current number of road traffic due to the actual situation of change, its biggest flaw is that when the road conditions change, cannot satisfy the driver and passers-by's actual need, light person cause time wasted, the person that weigh directly lead to traffic jams, bring about urban traffic the decline in efficiency. At present, there is a use of "fuzzy control" technology control method of traffic lights. According to crossroads in both directions vehicle dynamic status, automatic judgment traffic lights to ensure maximum time intervals, traffic, reduce road traffic jams. But unlike timing control, can use digital display the current light color remaining time, so that the driver grasps his driving action, to stop in time or start.
Figure 3 crossroads driveway shape figure
Figure 4 for histograms, writes for north crossroads lamp, the right of the east crossroads lamp, underneath for south crossroads lamp, left for west crossroads lamp. Figure 5 shows the traffic rules for a state chart, set up separately for S1, S2, S3 S4, in this traffic lights, four state for a cycle, circular execution.
Figure 4 vehicle histogram
Please note that figure S2 state and S4 state, they in a given time interval in four directions can open to traffic, this state can within certain time to an even larger traffic, particularly high efficiency. Outer ring is the north for direction state circulation and inner circle is east for direction state cycle.
Figure 5 vehicle state chart
Based on the above the vehicle of a state chart, can list each intersection of logic table lamp, due to opposite of light of a state chart is same, so we only write adjacent intersections of light of logic table, According to the operation diagram can be seen, the adjacent intersections lamp their status in phase differences 180 °. So ultimately just write a group of S1, S2, S3, S4 logic state list. As shown in table 3 shows:
List of "1" representative lights (also represent logic 1), "0" represents the lamp (also represent logic 0), in accordance with the above, can send to the corresponding port logic values.
附件2:外文文献译文
基于单片机的十字路口交通灯控制器的设计由于我国经济的快速发展从而导致了汽车数量的猛增,大中型城市的城市交通,正面临着严峻的考验,从而导致交通问题日益严重,其主要表现如下:交通事故频发,对人类生命安全造成极大威胁;交通拥堵严重,导致出行时间增加,能源消耗加大;空气污染和噪声污染程度日益加深等。
日常的交通堵塞成为人们司空见惯而又不得不忍受的问题。
在这种背景下,结合我国城市道路交通的实际情况,开发出真正适合我们自身特点的智能信号灯控制系统已经成为当前的主要任务。
前言
在实际应用上,根据对国内外实际交通信号控制应用的考察,平面独立交叉口信号控制基本采用定周期、多时段定周期、半感应、全感应等几种方式。
前两种控制方式完全是基于对平面交叉口既往交通流数据的统计调查,由于交通流存在的变化性和随机性,这两种方式都具有通行效率低、方案易老化的缺陷,而半感应式和全感应式这两种方式是在前两种方式的基础上增加了车辆检测器并根据其提供的信息来调整周期长和绿信比,它对车辆随机到达的适应性较大,可使车辆在停车线前尽可能少停车,达到交通流畅的效果。
在现代化的工业生产中,电流、电压、温度、压力、流量、流速和开关量都是常用的主要被控参数。
例如:在冶金工业、化工生产、电力工程、造纸行业、机械制造和食品加工等诸多领域中,人们都需要对交通进行有序的控制。
采用单片机来对交通进行控制,不仅具有控制方便、组态简单和灵活性大等优点,而且可以大幅度提高被控制量的技术指标,从而能够大大提高产品的质量和数量。
因此,单片机对交通灯的控制问题是一个工业生产中经常会遇到的问题。
在工业生产中,有很多行业有大量的交通灯设备,在现行系统中,大多数的交通控制信号都是用继电器来完成的,但继电器响应时间长,灵敏度低,长期使用之后,故障机会大大增加,而采用单片机控制,其精度远远大于继电器,响应时间短,软件可靠性高,不会因为工作时间缘故而降低其性能,相比而言,本方案具有很高的可行性。
关于AT89C51
(1)功能特征描述:
AT89C51是一种低功耗、高性能CMOS8位微控制器,具有8K 在系统可编程Flash 存储器。
使用Atmel 公司高密度非易失性存储器技术制造,与工业80S51 产品指令和引脚完全兼容。
片上Flash允许程序存储器在系统可编程,亦适于常规编程器。
在单芯片上,拥有灵巧的8 位CPU 和在系统可编程Flash,使得AT89C51为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。
AT89C51具有以下标准功能:8k字节Flash,256字节RAM,32 位I/O 口线,看门狗定时器,2 个数据指针,三个16 位定时器/计数器,一个6向量2级中断结构,全双工串行口,片内晶振及时钟电路。
另外,AT89C51 可降至0Hz 静态逻辑操作,支持2种软件可选择节电模式。
空闲模式下,CPU停止工作,允许RAM、定时器/
计数器、串口、中断继续工作。
掉电保护方式下,RAM内容被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。
如图1为8051引脚分配图。
图1 8051引脚分配图
(2)中断介绍
AT89C51有6个中断源:两个外部中断(INT0和INT1),三个定时中断(定时器0、1、2)和一个串行中断。
每个中断源都可以通过置位或清除特殊寄存器IE 中的相关中断允许控制位分别使得中断源有效或无效。
IE还包括一个中断允许总控制位EA,它能一次禁止所有中断。
IE.6位是不可用的。
对于AT89C51,IE.5位也是不能用的。
用户软件不应给这些位写1。
它们为AT89系列新产品预留。
定时器2可以被寄存器T2CON中的TF2和EXF2的或逻辑触发。
程序进入中断服务后,这些标志位都可以由硬件清0。
实际上,中断服务程序必须判定是否是TF2 或EXF2激活中断,标志位也必须由软件清0。
定时器0和定时器1标志位TF0 和TF1在计数溢出的那个周期的S5P2被置位。
它们的值一直到下一个周期被电路捕捉下来。
然而,定时器2的标志位TF2 在计数溢出的那个周期的S2P2被置位,在同一个周期被电路捕捉下来。
(3)外部时钟驱动特性
表1
表2
关于8255芯片
1. 8255特性:
(1) 一个并行输入/输出的LSI芯片,多功效的I/O器件,可作为CPU总线与外围的接口.
(2) 具有24个可编程设置的I/O口,即使3组8位的I/O口为PA口,PB口和PC口.它们又可分为两组12位的I/O口,A组包括A口及C口(高4位,PC4~PC7),B组包括B口及C口(低4位,PC0~PC3).A组可设置为基本的I/O口,闪控(STROBE)的I/O闪控式,双向I/O3种模式;B组只能设置为基本I/O或闪控式I/O两种模式,而这些操作模式完全由控制寄存器的控制字决定.
2. 8255引脚功效:
(1).RESET:复位输入线,当该输入端外于高电平时,所有内部寄存器(包括控制寄存器)均被清除,所有I/O口均被置成输入方式。
(2).CS:芯片选择旌旗灯号线,当这个输入引脚为低电平时,即/CS=0时,表示芯片被选中,允许8255与CPU进行通讯;/CS=1时,8255无法与CPU做数据传输。
(3).RD:读旌旗灯号线,当这个输入引脚为低电平时,即/RD=0且/CS=0时,允许8255通过数据总线向CPU发送数据或状态信息,即CPU从8255读取信息或数据。
(4).WR:写入旌旗灯号,当这个输入引脚为低电平时,即/WR=0且/CS=0时,允许CPU 将数据或控制字写入8255。
(5).D0~D7:三态双向数据总线,8255与CPU数据传送的通道,当CPU执行输入输出指令时,通过它实现8位数据的读/写操作,控制字和状态信息也通过数据总线传送。
(6).PA0~PA7:端口A输入输出线,一个8位的数据输出锁存器/缓冲器,一个8位的数据输入锁存器。
(7).PB0~PB7:端口B输入输出线,一个8位的I/O锁存器,一个8位的输入输出缓冲器。
(8).PC0~PC7:端口C输入输出线,一个8位的数据输出锁存器/缓冲器,一个8位的数据输入缓冲器。
端口C可以通过工作方式设定而分成2个4位的端口,每个4位的端口包含一个4位的锁存器,分别与端口A和端口B配合使用,可作为控制旌旗灯号输出或状态旌旗灯号输入端口。
(9).A0,A1:地址选择线,用来选择8255的PA口,PB口,PC口和控制寄存器。
当A0=0,A1=0时,PA口被选择;
当A0=0,A1=1时,PB口被选择;
当A0=1,A1=0时,PC口被选择;
当A0=1,A1=1时,控制寄存器被选择。
有关七段LED显示器的介绍
通过发光二极管芯片的适当连接(包括串联和并联)和适当的光学结构。
可构成发光显示器的发光段或发光点。
由这些发光段或发光点可以组成数码管、符号管、米字管、矩阵管、电平显示器管等等。
通常把数码管、符号管、米字管共称笔画显示器,而把笔画显示器和矩阵管统称为字符显示器。
1. LED显示器分类
(1)按字高分:笔画显示器字高最小有1mm(单片集成式多位数码管字高一般在2~3mm)。
其他类型笔画显示器最高可达12.7mm(0.5英寸)甚至达数百mm。
(2)按颜色分有红、橙、黄、绿等数种。
(3)按结构分,有反射罩式、单条七段式及单片集成式。
(4)从各发光段电极连接方式分有共阳极和共阴极两种。
2. LED显示器的参数
由于LED显示器是以LED为基础的,所以它的光、电特性及极限参数意义大部分与发光二极管的相同。
但由于LED显示器内含多个发光二极管,所以需有如下特殊参数:
(1) 发光强度比
由于数码管各段在同样的驱动电压时,各段正向电流不相同,所以各段发光强度不同。
所有段的发光强度值中最大值与最小值之比为发光强度比。
比值可以在1.5~2.3间,最大不能超过2.5。
(2) 脉冲正向电流
若笔画显示器每段典型正向直流工作电流为IF,则在脉冲下,正向电流可以远大于IF。
脉冲占空比越小,脉冲正向电流可以越大。
交通信号控制类型
交通信号控制的目的有三点:第一,在时间上和空间上分隔交叉口不同方向的车流,
控制车流的运行秩序;第二,使在平面交叉的道路网络上人和物的运输达到最高效率;第三,为道路使用者提供必要的信息,帮助他们有效地使用交通设施。
道路交通信号控制的基本类型有多种分法。
按控制区几何特性划分为:单个交叉口的控制——点控、交通干线的协调控制——线控、交通网络的协调控制——面控;按控制原理划分:定时控制、感应控制、自适应控制。
关于看门狗电路
在由单片机构成的微型计算机系统中,由于单片机的工作常常会受到来自外界电磁场的干扰,造成程序的跑飞,而陷入死循环,程序的正常运行被打断,由单片机控制的系统无法继续工作,会造成整个系统的陷入停滞状态,发生不可预料的后果,所以出于对单片机运行状态进行实时监测的考虑,便产生了一种专门用于监测单片机程序运行状态的芯片,俗称"看门狗"(watchdog)。
MAX692是微系统监控电路芯片,具有后备电池切换、掉电判别、看门狗监控等功能。
其封装和引脚说明如图2所示。
图2 MAX692封装和引脚
看门狗电路的应用,使单片机可以在无人状态下实现连续工作,其工作原理是:看门狗芯片和单片机的一个I/O引脚相连,该I/O引脚通过程序控制它定时地往看门狗的这个引脚上送入高电平(或低电平),这一程序语句是分散地放在单片机其他控制语句中间的,一旦单片机由于干扰造成程序跑飞后而陷入某一程序段进入死循环状态时,写看门狗引脚的程序便不能被执行,这个时候,看门狗电路就会由于得不到单片机送来的信号,便在它和单片机复位引脚相连的引脚上送出一个复位信号,使单片机发生复位,即程序从程序存储器的起始位置开始执行,这样便实现了单片机的自动复位。
红外检测电路
红外辐射光子在半导体材料中激发非平衡载流子(电子或空穴),引起电学性能变化。
因为载流子不逸出体外,所以称内光电效应。
量子光电效应灵敏度高,响应速度比热探测器快得多,是选择性探测器。
为了达到最佳性能,一般都需要在低温下工作。
光电探测器可分为:
(1) 光导型:又称光敏电阻。
入射光子激发均匀半导体中的价带电子越过禁带进入导带并在价带留下空穴,引起电导增加,为本征光电导。
从禁带中的杂质能级也可激发光生载流
子进入导带或价带,为杂质光电导。
截止波长由杂质电离能决定。
量子效率低于本征光导,而且要求更低的工作温度。
(2) 光伏型:主要是p-n结的光生伏特效应。
能量大于禁带宽度的红外光子在结区及其附近激发电子空穴对。
存在的结电场使空穴进入p区,电子进入n 区,两部分出现电位差。
外电路就有电压或电流信号。
与光导探测器比较,光伏探测器背影限探测率大于40%;不需要外加偏置电场和负载电阻,不消耗功率,有高的阻抗。
这些特性给制备和使用焦平面阵列带来很大好处。
(3) 光发射-Schottky势垒探测器:金属和半导体接触,典型的有PtSi/Si结构,形成Schott ky势垒,红外光子透过Si层为PtSi吸收,电子获得能量跃上Fermi能级,留下空穴越过势垒进入Si衬底,PtSi层的电子被收集,完成红外探测。
充分利用Si集成技术,便于制作,具有成本低、均匀性好等优势,可做成大规模(1024×1024甚至更大)焦平面阵列来弥补量子效率低的缺陷。
有严格的低温要求。
用这类探测器,国内外已生产出具有像质良好的热像仪。
Pt Si/Si结构FPA是最早制成的IRFPA。
定时计数与车流量的计算
利用MCS-51内部的定时器/计数器进行定时,配合软件延时实现到计时。
该方法节省硬件成本,切能够使读者在定时器/计数器的使用、中断及程序设计方面得到锻炼与提高。
计算公式如下:
TC=M-C
式中,M为计数器摸值,该值和计数器工作方式有关。
对于一个交通路口来说,能在最短的时间内达到最大的车流量,就算是达到了最佳的性能,我们称在单位时间内多能达到的最大车流为车流量。
用公式:(车流量= 车流/ 时间)来表示。
十字路口交通灯设计中采用的一般思路
十字道口的红绿灯是交通法规的无声命令,是司机和行人的行为准则。
十字道口的交通红绿灯控制是保证交通安全和道路畅通的关键。
当前,国内大多数城市正在采用“自动”红绿交通灯,它具有固定的“红灯—绿灯”转换间隔,并自动切换。
它们一般由“通行与禁止时间控制显示、红黄绿三色信号灯和方向指示灯”三部分组成。
在交通灯的通行与禁止时间控制显示中,通常要么东西、南北两方向各50秒;要么根据交通规律,东西方向60秒,南北方向40秒,时间控制都是固定的。
交通灯的时间控制显示,以固定时间值预先“固化”在单片机中,每次只是以一定周期交替变化。
但是,实际上不同时刻的车辆流通状况是十分复杂的,是高度非线性的、随机的,还经常受认为因素的影响。
采用定时控制经常造成道路有效应用时间的浪费,出现绿灯方向车辆较少,红灯方向车辆积压。
它不顾当前道路上交通车辆数的实际情况变化,其最大的缺陷就在于当路况发生变化时,不能满足司机与路人的实际需要,轻者造成时间上的浪费,重者直接导致交通堵塞,导致城市交通效率的下降。
目前,有一种使用“模糊控制”技术控制交通灯的方法。
能够根据十字路口两个方向上车辆动态状况,自动判断红绿灯时间间隔,以保证最大车流量,减少道口的交通堵塞。
但是却不像定时。