完整版出租车计价器毕业设计Word文档下载推荐.docx
《完整版出租车计价器毕业设计Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《完整版出租车计价器毕业设计Word文档下载推荐.docx(26页珍藏版)》请在冰豆网上搜索。
ABSTRACT
Withthedevelopmentofthetimes,.Taximetertaxioperatingcostsisdedicatedinligentinstruments,isanimportantandindispensabletoolforataxi.Itisthepassengersandthedriver'
stradingstandardsrelatedtotheinterestsofbothparties.Formanyyears,widespreaduseofthemetertheindustryaswellasreducedisputeswithpassengersstarting,thissingle-functionmeterincreasinglyunabletomeetpeople'
sneeds.Thereforetaximetertechnologyisconstantlyimprovingandinnovation,designagoodperformancemultifunctionaltaximeterisparticularlyimportant.
Thisdesignusesasingle-chipAT89S52asthecoredesignMultifunctionaltaximeter,taxiviaHallsensorA44Erunningmileage,pulseextraction.UseMCUforLCDLM016Lcontrol,whilecompletingtheentiretaximetersignalread-writeprocess.AsthesimulationcannotbeachievedA44EHallsensor,inthesimulationinsteadofapulsegenerator,atadifferentfrequencypulsessimulatedifferentspeed,accordingtotawaitstate,automaticallyjumpBythemetertobillingortimebilling.Themetercanachievemileageandvaluationdisplay,clockdisplay.Itisonthemarketthansomeofthemetereasiertouse,morefeature-full,abletostrengthenthemanagementofthetaxiindustrytoprovideareliablebasis.Usingsingle-chipdesign,therelativeuseofanaloganddigitalcircuitdesignmeterismorepowerful,withlesseasilycomplementeachothertoachievethedesignrequirements,andflexibility,notonlythroughsoftwareprogrammingtoachievetherequiredfunctionalityandcantoalargeextentontheexpansionoffunctions,youcaneasilyupgradethesystem.
Keywords:
multifunctionaltaximeter;
microcontroller;
lcd;
andexperiment[M].Shanghai:
FudanUniversitypress,2005.12.
[2]马淑华,王凤文,张美金编著.单片机原理与接口技术第二版[M].北京:
北京邮电大学出版社,2007.
MaShuhua,WangFengwen,ZhangMeijinBianZhu.Singlechipmicrocomputerprincipleandinterfacetechnologysecondedition[M].Beijing:
BeijingUniversityofPostsandecommunicationspress,2007.
[3]谭浩强著.C程序设计第三版[M].北京:
清华大学出版社,2005.大学出版社,1990.1.
TanHaoqiang.Cprogrammingthirdedition[M].Beijing:
TsinghuaUniversitypress,2005,UniversityPress,1990.1.
[4]李光飞.单片机C程序设计指导[M].北京:
北京航空航天大学出版社,2003.01.
LiGuangfeimicrocontrollerCprogramdesignguidelines[M]Beijing:
BeijingUniversityofAeronauticsandAstronauticsPress,2003.01.
[5]李广弟,朱月秀,冷祖祁.单片机基础第3版[M].北京:
北京航空航天大学出版社,2007.
LiGuangdi,ZhuYuexiu,Qicoldprogenitor.BasedonThirdEdition[M].Beijing:
BeihangUniversitypress,2007.
[6]周慈航.单片机应用程序设计技术[M].北京:
北京航空航天大学出版社,2002.
ZhouCihang.Applicationprogrammingtechnology[M].Beijing:
BeihangUniversitypress,2002.
[7]何立民.MS-51系列单片机应用系统设计[M].北京:
北京航空航天大学出版社,1999.
HeLimin.MS-51seriessingle-chipmicrocomputerapplicationsystemdesign[M].Beijing:
BeihangUniversitypress,1999.
[8]李群芳,肖看.单片机原理接口与应用[M].北京:
清华大学出版社,2005.
LiQunfang,Xiao.Principleofsingle-chipinterfaceandapplication[M].Beijing:
TsinghuaUniversitypress,2005.
[9]马忠梅编著.单片机的C语言Windows环境编程宝典[M].北京:
北京航空航天大学出版,2003.6.
EditedbyMaZhongmei.TheMCUClanguageWindowsprogrammingenvironment[M].Beijing:
BeihangUniversitypress,2003.6.
[10]高峰.单片微型应用系统设计及实用技术[M].北京:
机械工业出版社,2004.
GaoFeng.Singlechipmicrocomputerapplicationsystemdesignanditspracticaltechnique[M].Beijing:
MechanicalIndustryPress,2004.
[11]刘守义.单片机应用技术[M].西安:
西安电子科技大学出版社,1996.
LiuShouyi.Applicationtechnology[M].Xi'
an:
Xi'
anElectronicandScienceUniversitypress,1996.
[12]谢剑英,贾青.微型计算机控制技术第3版[M].北京:
国防工业出版社,2001.
XieJianying,QingJia.ThemicrocomputercontroltechnologyThirdEdition[M].Beijing:
NationalDefenseIndustryPress,2001.
附录
附录一:
程序
计程车计价器设计
该模拟程序折合规则:
1km-1m,等待30s-1km-1m,1m-1.4元
底层规则:
若脉冲个数秒<
10,则判为低速,1m-200个脉冲
#include<
reg51._Show_Time(uchartime_data[7]);
voidMoney_Show(uintmoney[2]);
voidShow_Wait_Time(uint);
voidShow_Mileage(void);
voidRun_BackGround(void);
运行起来后,将在LCD上一直出现的
voidRun_BackGround(void)
{
WriteChar('
'
3,0);
:
10,0);
13,0);
.'
3,1);
Y'
6,1);
}
voidShow_Mileage(void)
12,1);
WriteString("
km"
14,1);
voidShow_Wait_Time(uinttime_count)
s'
15,1);
'
10,1);
voidMoney_Show(uintmoney[2])
WriteDecimal(money[0],0,3,1);
WriteDecimal(money[1],1,3,1);
voidRun_Show_Time(uchartime_data[7])
WriteInt(BcdToInt(time_data[2]),1,2,1,0);
WriteInt(BcdToInt(time_data[3]),1,2,4,0);
WriteInt(BcdToInt(time_data[4]),1,2,8,0);
voidTime_Show(uchartime_data[7])
6,0);
9,0);
9,1);
WriteInt(BcdToInt(time_data[0]),1,2,4,0);
WriteInt(BcdToInt(time_data[2]),1,2,7,0);
WriteInt(BcdToInt(time_data[4]),1,2,4,1);
WriteInt(BcdToInt(time_data[5]),1,2,7,1);
voidSystem_init(void)
RstLcd();
ClrLcd();
P1=0x00;
config_ok=0;
Time_Show(time);
LcdPos(5,0);
SetCur(3);
INT1_init();
while(config_ok==0);
等待配置时间结束标志
SetCur
(1);
settimeover..."
0,0);
Delay(60000);
Run_BackGround();
P1=0xff;
voidDelay(uintdtime)
uinttemp;
for(temp=0;
temp<
dtime;
temp++);
voidINT0_init(void)
EA=0;
IT0=1;
EX0=1;
EA=1;
voidINT1_init(void)
IT1=1;
EX1=1;
voidmain()
{
uchartime_tmp[7],i;
System_init();
DS1302_GetData(time);
pulse_count_tmp=pulse_count;
mileage_count_new=mileage_count_old=0;
Money_Show(money);
if(k==1)
else
Money_Show(money1);
Run_Show_Time(time);
Show_Mileage();
while
(1)
{
if(config_ok==0)若设置时间未完成
System_init();
DS1302_GetData(time_tmp);
if(!
(P1&
0x04))
{
P1&
=0xfe;
P1|=0x02;
pause=0;
if(time[6]!
=time_tmp[6])
{
Run_Show_Time(time_tmp);
for(i=0;
i<
7;
i++)
time[i]=time_tmp[i];
}
first_3_km=0;
if(k==1)
money[0]=8;
money[1]=0;
else
money1[0]=10;
money1[1]=0;
mileage_count_new=mileage_count_old=0;
WriteString("
"
0,1);
Money_Show(money);
Money_Show(money1);
pulse_count=0;
Show_Mileage();
time_count=0;
}
elseif(pause==0)
INT0_init();
if(pulse_count-pulse_count_tmp<
10)判断是否是低速行驶(计时),即一秒内,脉冲数目的个数变化值若小于10,则判为低速
{
state=1;
P1&
P1|=0x02;
time_count++;
等待计时加1
if(time_count%10==0&
&
first_3_km>
2)由等待时间换算公里数,10s折合为1km(1m)
{
if(k==1)
money[1]+=40;
else
money1[1]+=40;
if(money[1]>
99)
{
money[0]+=1;
money[1]%=100;
}
money[0]+=0;
money1[0]+=0;
Money_Show(money);
Money_Show(money1);
}
elseif(time_count%10==0&
first_3_km<
=2)
first_3_km++;
else;
mileage_count_old=mileage_count_new;
Show_Wait_Time(time_count);
}
else否则则判为全速状态(计里程)
state=0;
=0xfd;
P1|=0x01;
time_count=0;
全速状态下,把等待时间清0
pulse_count_tmp=pulse_count;
if(state==0)
mileage_count_new=pulse_count200;
if(mileage_count_new!
=mileage_count_old&
2)
Show_Mileage();
for(i=mileage_count_old;
mileage_count_new;
money[1]+=50;
money1[1]+=20;
money[0]+=1;
money1[0]+=1;
elseif(mileage_count_new!
first_3_km++;
else
}
staticvoidINT0_ser(void)interrupt0
pulse_count++;
staticvoidINT1_ser(void)interrupt2
charresult;
uchari;
staticucharpos;
配置到哪一项
配置时间
if(!
(P2&
0x20)&
config_ok==0)++
for(i=0;
100;
i++);
config_ok==0)
result=BcdToInt(time[pos])+1;
if((pos==0&
result==50)||(pos==4&
result==24)||(pos==5&
result==60)||(pos==6&
result==60))
result=0;
elseif(pos==2&
result==13)
result=1;
elseif(pos==3)
month_day[1]=(time[0]%4==0&
time[0]%100!
=0)||time[0]%400==0?
29:
28;
判断润平年
if(result==month_day[time[2]-1]+1)
result=1;