基于单片机的交通控制系统模拟设计
1. 设计思路.................................................................................................................................................................2
2.1 电源提供方案 为使模块稳定工作,须有可靠电源。因此考虑了两种电源方案:..................................2
2.2 显示界面方案...................................................................................................................................................3
2.3 输入方案:.......................................................................................................................................................3
3 单片机交通控制系统总体设计..............................................................................................................................3
3.1单片机交通控制系统的通行方案设计............................................................................................................3
3.2 单片机交通控制系统的功能要求...................................................................................................................4
3.3单片机交通控制系统的基本构成及原理........................................................................................................5
4智能交通灯控制系统的硬件设计...........................................................................................................................5
4.1 AT89C51单片机简介........................................................................................................................................6
4.1.1 AT89C51
单片机的主要特性
.....................................................................................................................6
4.1.2
主要引脚功能
............................................................................................................................................6
4.2 交通灯中的中断处理流程...............................................................................................................................8
4.3 系统硬件总电路构成及原理...........................................................................................................................9
4.3.1
系统硬件电路构成
.....................................................................................................................................9
4.3.2
系统工作原理
.............................................................................................................................................9
4.4其它硬件介绍及连接......................................................................................................................................10
4.4.1八段LED数码管...........................................................................................................................................10
5 系统软件程序的设计............................................................................................................................................12
5.1 程序主体设计流程.........................................................................................................................................12
5.2 理论基础知识.................................................................................................................................................13
5.2.1
定时器原理
...............................................................................................................................................13
5.2.2
软件延时原理
...........................................................................................................................................14
5.2.3 中断原理......................................................................................................................................................14
5.3子程序模块设计..............................................................................................................................................14
5.3.1
状态灯显示及判断
...................................................................................................................................14
5.3.2 LED
倒计时显示
......................................................................................................................................15
5.3.3
紧停及调整时间中断子程序
..................................................................................................................15
5.3.4
红绿灯时间调整程序
..............................................................................................................................16
5.4 系统软件调试.................................................................................................................................................18
5.4.1 TKS
仿真器
...............................................................................................................................................18
5.4.2
集成开发环境
KEIL.................................................................................................................................18
参考文献……………………………………………………………………………………………..17
设计心得体会………………………………………………………………………………………...18
附录……………………………………………………………………………………………………19
1