课 程 设 计
课 程 EDA技术课程设计
题 目 出租车动计费系统
院 系 电子科学学院
专业班级 电子信息工程
学生姓名
学生学号
指导教师
XX学课程设计务书
课程 EDA技术课程设计
题目 出租车动计费系统
专业 电子信息工程 姓名 学号
容基求参考资料等
容:
设计量程9999元出租车动计费计费器具行车里程计费等候时间计费起价三部分功数码显示车费数目
基求:
1设计出租车动计费器具行车里程计费等候时间计费起价三部分四位数码显示总金额值9999元
2行车里程单价1元公里等候时间单价05元10分钟起价3元(3公里起价)均通工输入
3行车里程计费电路汽车行驶里程数转换成成正脉数然计数译码电路转换成收费金额实验中脉模拟汽车前进十米100脉表示1公里然BCD码例法器里程脉公里单价例系数例系数开关预置例单价10元公里脉量001元脉
4LED显示行驶公里数两数码显示收费金额
参考资料:
[1] 潘松著EDA技术实教程(第二版) 北京:科学出版社2005
[2] 康华光编电子技术基础 模拟部分 北京:高教出版社2006
[3] 阎石编数字电子技术基础 北京:高教出版社2003
完成期限 2011311
指导教师
专业负责
2011年 3月7日
总体设计思想
1基原理
着出租车行业发展出租车已城市交通重组成部分加强行业理减少司机客纠纷出发具良性计价器出租车司机客说必采模拟电路数字电路设计计价器整体电路规模较器件造成障率高难调试采单片机进行设计相说功强较少硬件适软件相互配合容易实现设计求灵活性强通软件编程完成更附加功设计采AT89S52单片机控器A44E霍尔传感器测距实现出租车功计价设计输出采8段数码显示
体设计思路传感器安装车轮检测汽车行进公里数产生系列相应脉输出脉送单片机进行处理单片机根程序设定通计算脉数换算出行驶公里数根EEPROM中读取价格等相关数进行金额计算计算金额里程单价实时显示数码独立键盘调节价格等相关数相应钮产生信号交单片机处理实时显示出调节数存储EEPROM中掉电调数丢失系统结构图图
2设计框图
根计费器设计求该系统分成四模块块计费模块块时间计时模块块路程控制模块块输出显示模块
速度控制模块
路程控制模块
计费模块
扫描显示模块
二设计步骤调试程
1总体设计电路
控机系统采Atmel 公司生产 AT89S52单片机含256 字节数存储器置8K 电擦FLASH ROM重复编程满足控机软件系统设计必扩展程序存储器复位电路晶振电路AT89S52 工作需简外围电路单片机系统电路图图示
2模块设计相应模块程序
21速度控制程序:
LIBRARY IEEE
USE IEEESTD_LOGIC_1164ALL
USE IEEESTD_LOGIC_UNSIGNEDALL
entity sudukongzhi is
port(clkresetstartin std_logic
kin std_logic_vector(2 downto 0)
clkoutout std_logic)
end sudukongzhi
ARCHITECTURE FUN OF sudukongzhi IS
signal count1std_logic_vector(1 downto 0)
signal tmpclkclksstd_logic
begin
kinside<000k
clks_label
process(resetclk)
variable count2std_logic_vector(2 downto 0)
begin
if reset'0' then
count2000
elsif (clk'event and clk'1') then
if start'1' then
if count2kinside then count2000
end if
if not(k000) then count2count2+1
end if
if count2001 then tmpclk
clkout
LIBRARY IEEE
USE IEEESTD_LOGIC_1164ALL
USE IEEESTD_LOGIC_UNSIGNEDALL
USE IEEESTD_LOGIC_ARITHALL
ENTITY luchengkongzhi IS
PORT(clkresetin std_logic
lucheng1out std_logic_vector(3 downto 0)
lucheng2out std_logic_vector(3 downto 0)
end luchengkongzhi
ARCHITECTURE FUN OF luchengkongzhi IS
begin
process(clkreset)
variable mmstd_logic_vector(11 downto 0)
begin
if reset'0' then
elsif clk'event and clk'1' then
if mm(3 downto 0)1001then
mmmm+7
else mmmm+1
end if
if mm(7 downto 4)1010then
mmmm+01100000
end if
if mm(11 downto 8)1010then
mmmm+011000000000
end if
end if
lucheng1
end FUN
23计费模块程序:
LIBRARY IEEE
USE IEEESTD_LOGIC_1164ALL
USE IEEESTD_LOGIC_UNSIGNEDALL
USE IEEESTD_LOGIC_ARITHALL
ENTITY jifeimokuai IS
PORT(clkresetin std_logic
judge2in std_logic_vector(3 downto 0)
judge3in std_logic_vector(3 downto 0)
jifei1out std_logic_vector(3 downto 0)
jifei2out std_logic_vector(3 downto 0)
jifei3out std_logic_vector(3 downto 0)
jifei4out std_logic_vector(3 downto 0))
end jifeimokuai
ARCHITECTURE FUN OF jifeimokuai IS
SIGNAL enSTD_LOGIC
signal shoufeistd_logic_vector(7 downto 0)
signal shoufeijishustd_logic_vector(15 downto 0)
begin
shoufei<00110011when((shoufeijishu(15)'1')
or(shoufeijishu(14)'1')
or(shoufeijishu(13)'1'))
else00100010
en<'0' when judge30000 and judge2(3 downto 2)00 and ((judge2(1)'0')or (judge2(1)'1' and judge2(0)'0')) else '1'
process(clkreset)
variable mmstd_logic_vector(15 downto 0)
begin
if reset'0'then
mm0000011100000000
elsif clk'event and clk'1' then
if en'1' then mmmm+shoufei
end if
if mm(3)'1' and (not(mm(2 downto 1)00))then
mmmm+6
end if
if mm(7)'1' and (not(mm(6 downto 5)00))then
mmmm+01100000
end if
if mm(11)'1' and (not(mm(10 downto 9)00))then
mmmm+011000000000
end if
if mm(15 downto 12)1010then
mmmm+0110000000000000
end if
end if
jifei1
end FUN
24扫描显示模块程序:
LIBRARY IEEE
USE IEEESTD_LOGIC_1164ALL
USE IEEESTD_LOGIC_UNSIGNEDALL
entity xianshimokuai is
port(clkin std_logic
p8in std_logic_vector(3 downto 0)
p7in std_logic_vector(3 downto 0)
p6in std_logic_vector(3 downto 0)
p5in std_logic_vector(3 downto 0)
p4in std_logic_vector(3 downto 0)
p3in std_logic_vector(3 downto 0)
p2in std_logic_vector(3 downto 0)
p1in std_logic_vector(3 downto 0)
xuanzeout std_logic_vector(7 downto 0)
shuzhiout std_logic_vector(7 downto 0))
end entity
ARCHITECTURE FUN OF xianshimokuai IS
signal countstd_logic_vector(2 downto 0)
signal tmpstd_logic_vector(3 downto 0)
signal choiceinstd_logic_vector(7 downto 0)
signal datainstd_logic_vector(7 downto 0)
begin
clk1_label
process(clk)
begin
if clk'event and clk'1' then
count
end process
clk2_label
process(clk)
begin
if clk'event and clk'0' then
xuanze
else shuzhi(0)<'0'
end if
end if
end process
choicein<11111110 when count000else
11111101 when count001else
11111011 when count010else
11110111 when count011else
11101111 when count100else
11011111 when count101else
10111111 when count110else
01111111
tmp
p3 when count010else
p4 when count011else
p5 when count100else
p6 when count101else
p7 when count110else
p8
with tmp select
datain(7 downto 1)<1111110 when 0000
0110000 when 0001
1101101 when 0010
1111001 when 0011
0110011 when 0100
1011011 when 0101
1011111 when 0110
1110000 when 0111
1111111 when 1000
1111011 when 1001
1110111 when 1010
0011111 when 1011
1001110 when 1100
0111101 when 1101
1001111 when 1110
1000111 when othersend FUN
3仿真仿真结果分析
计费模块仿真图
计程模块仿真图
4实验调试结果
耐心调试学互相讨研究终较利完成课程设计仿真较理想仿真结果
三结心体会
通天关出租车计价器课程设计EDA工具更熟练掌握整设计程中碰问题键盘延时防抖问题较解决编程序模块程序调掌握够相关应软件没熟练掌握通天反复思考参考网程序终完成设计设计中收获动手力独立解决问题力提高动手程中仅增强实践力理更深认识次设计极鼓舞信心相信学中通断学实践提高专业方面知识
dong北石油学
参考资料
[1] 潘松著EDA技术实教程(第二版) 北京:科学出版社2005
[2] 康华光编电子技术基础 模拟部分 北京:高教出版社2006
[3] 阎石编数字电子技术基础 北京:高教出版社2003
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档