目 录
1 绪论 .............................................................................................................................................1
2 单片机的发展及应用 .................................................................................................................2
2.1 单片机的发展 ......................................................................................................................2
2.2 单片机的应用 ......................................................................................................................2
3 芯片简介 .....................................................................................................................................4
3.1 MCS-51 芯片简介 .................................................................................................................4
3.2 中断系统 ..............................................................................................................................5
3.3 时钟电路 ..............................................................................................................................5
3.4 8255 芯片简介 .....................................................................................................................7
4 系统硬件设计 ..............................................................................................................................9
4.1 交通管理的方案论证 ...........................................................................................................9
4.2.1 系统总框图如下 ............................................................................................................9
4.2.2 交通灯硬件线路图(见附录 2) ...................................................................................10
4.2.3 系统工作原理 ..............................................................................................................10
5控制器的软件设计 ...................................................................................................................11
5.1 计数器硬件延时 .................................................................................................................11
5.1.1 计数器初值计算 .........................................................................................................11
5.1.2 1秒的方法 .................................................................................................................11
5.1.3 相应程序代码 .............................................................................................................11
5.2 软件延时 ............................................................................................................................12
5.3 时间及信号灯的显示 ........................................................................................................12
5.3.1 8051 并行口的扩展 ....................................................................................................12
5.3.2 显示原理 .....................................................................................................................12
5.3.3 8255 输出信号与数码管的连接 ................................................................................13
5.3.4 8255 与 8051 的连接 ..................................................................................................13
5.4 程序设计 ............................................................................................................................14
6 结论 ...........................................................................................................................................16
致谢 ...............................................................................................................................................17
参考文献 .......................................................................................................................................18
附录 ...............................................................................................................................................19
附录 1 .........................................................................................................................................19
附录 2 .........................................................................................................................................23