Liaoning Normal University ( 届)
本科生毕业论文(设计)
题 目: 基于单片机和FPGA的出租车计费系统 学 院: 辽宁师范大学 专 业: 电子信息工程 学 号: 学生姓名: 指导教师:
年 月
1
目录
摘要 .................................................................... 1 Abstract ................................................................ 1 1绪论................................................................... 2 2系统设计 ............................................................... 2 2.1 系统组成 ......................................................... 2 2.1.1 计费及显示 ................................................... 3 2.1.2 时钟及显示 ................................... 错误!未定义书签。 2.1.3 计费开始提示 ................................. 错误!未定义书签。 2.2 功能模块设计 .................................... 错误!未定义书签。 3硬件及软件实现 ........................................ 错误!未定义书签。 3.1 传感器 ........................................... 错误!未定义书签。 3.1.1 光电传感器电路设计 .......................... 错误!未定义书签。 3.1.2车轮光电开关检测电路 .......................... 错误!未定义书签。 3.2 单片机 .......................................... 错误!未定义书签。 3.2.1 8051 单片机功能方块图 ....................... 错误!未定义书签。 3.2.2 AT89S51单片机简介 ............................................ 3 3.2.3 AT89S5l与51系列单片机相比具有如下特点 ....................... 4 3.2.4 89S51的内部框图 .............................................. 4 3.2.5 中断控制 ..................................................... 8 3.2.6 单片机控制程序设计 ........................................... 8 3.2.7 单片机汇编语言源程序 ........................................ 13 3.3显示及按键控制系统 ................................................ 29 3.3.1 LED数码管 ................................................... 29
2 3.3.2 数据显示电路的设计 .......................................... 31 4系统检测及分析 ........................................................ 32 4.1 系统仿真硬件验证 ................................................ 32 4.1.1 系统的调试方法 .............................................. 32 4.1.2 系统的硬件验证 .............................................. 32 4.2 设计技巧分析 ..................................................... 33 谢辞 ................................................................... 37 参考文献: ............................................................. 38
3 摘要
本系统电源电压为+16V,速度传感器具有汽车每运行1㎞提供1000个脉冲信号的特性。显示器可以采用LED数码管。系统采用单片机和FPGA的结合进行系统的主体设计,测控FPGA芯片通过采集传感器脉冲信号WCLK进行里程计算,里程计费,利用外部脉冲信号SCLK产生标准时钟信号,以计算等待时间,等待费用,并产生里程标志(LCBZ),等待标志(DDBZ),熄灯标志(XDBZ)等有关控制标志信号,同时根据单片机发出的开始信号(START),时段标志(SDBZ),传输数据选择(SEL)等控制信号将有关计算结果传送给FPGA芯片。单片机MCU除了完成键盘扫描,显示控制外,还通过P0口与FPGA进行数据交换,并向测控FPGA芯片发出有关控制信号。本设计方案利用单片机和FPGA的结合,发挥它们各自的长处,分工清晰,实际使用和操作符合大众逻辑,容易被人接受。而且,单片机丰富的IO口和FPGA模块化的设计为系统功能的扩展提供了空间和便利。
关键词:计费系统;单片机;FPGA芯片 Abstract
The system power supply voltage of + 16V, speed sensor be used LED digital tube. The system adopts the single chip and FPGA binding system of the main design, control FPGA chip through the acquisition sensor pulse signal WCLK to mileage, metered, using an external pulse signal SCLK produces a standard clock signal, to calculate the waiting time, waiting cost, and generate the mileage signs ( LCBZ ), wait for the signs (DDBZ ), mark ( lights out XDBZ ) and other related control signal, at the same time according to the MCU by a start signal ( START ), time slot markers ( SDBZ ), transmission data selection ( SEL ) and other control signals to be transmitted to the calculation results of FPGA chip. Single chip MCU in addition to the completion of the keyboard scanning, display control, through the P0 and FPGA data exchange, and to control FPGA chip emits the control signal. The design makes use of SCM and FPGA combination, play to their respective strengths, a clear division of labor, the actual application and operation in line with the general logic, is easy to be accepted by people. Moreover, SCM rich I O and FPGA modular design for system expansion provides space and facilities. Key words:billing system;SCM;FPGA chip
1
相关推荐: