1 / 5

单片机P89V51RD2FN

DB. 1#. 2#. 单片机P89V51RD2FN. D 2.0~2.7. D 1.0~1.7. P1.0~P1.7. 74HC373. 74HC373. ___ OE. ___ LEA. ___ OE. ___ LEA. O 1.0~1.7. O 2.0~2.7. P 2.0. P 2.1. 图1.交通灯控制器框架图. O 1.0. O 1.1. O 1.2. O 1.3. NLr. 1#. EMg. 绿. 红r. 绿g. 74HC373. NL. NM. NR. O 1.4. NLg. EMr. 绿.

Download Presentation

单片机P89V51RD2FN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DB 1# 2# 单片机P89V51RD2FN D2.0~2.7 D1.0~1.7 P1.0~P1.7 74HC373 74HC373 ___ OE ___ LEA ___ OE ___ LEA O1.0~1.7 O2.0~2.7 P2.0 P2.1 图1.交通灯控制器框架图

  2. O1.0 O1.1 O1.2 O1.3 NLr 1# EMg 绿 红r 绿g 74HC373 NL NM NR O1.4 NLg EMr 绿 WR EL O1.5 NMr ELg O2.7 O1.6 WM GND EM O2.6 O1.7 NMg ELr O2.5 WL ER 绿 O2.4 SR SM SL 绿 SLr WMg 2# O2.3 O2.2 O2.1 O2.0 74HC373 注1:因为全程右转,故右转向灯恒绿,红脚接GND,绿脚接VCC,图中未画出。 注2:上图中除地线外所有引脚都需串限流电阻,阻值为红脚串1KΩ绿脚串500Ω时亮度较合适,并且红绿都亮时为黄光;为了画图方便简洁,图中并未画出,请读者自己添加。 注3:符号说明,NESW分别表示北东南西,LMR分别表示左中右,rg分别表示红绿。 SLg WMr SMr WLg SMg WLr 图2.交通灯接线图

  3. 开始 置T1的寄存器 ShowState(Statenumber); 函数的入口参数Statenumber是随该函数的执行次数在循环变化,所以在一个周期内,每一次输出的状态都不一样 主程序框图 置初始常数 开中断 Y 扫描键盘 N 根据既定逻辑输出状态 Count=0 Count=100 Count值判断 调用状态输出函数ShowState(Statenumber); 调用状态输出函数ShowState(Statenumber); 等待 图3

  4. T1入口 置初始常数 Count++ 中断返回 定时程序,每隔50ms中断一次,Count=100时恰好5s,Count=500(即Count=0)时恰好25s 图4

  5. NM/SM NL/SL EM/WM EL/WL 路口传感器模拟按键:当检测到道路空闲时跳转下一状态 1 2 3 4 7 8 5 6 紧急绿灯按键:供特种车辆紧急通过 NM/SM NL/SL EM/WM EL/WL 图5

More Related