您现在的位置:主页 > 新闻动态 >

典型的89C51编程程序

时期:2021-11-27 06:46 点击数:
本文摘要:#includeat89x52.h#includestdio.h#includeintrins.h#includectype.hsbitrdy=P3^2;sbitvpp=P3^3;sbitp26=P3^4;sbitp27=P3^5;sbitp36=P3^6;sbitp37=P3^7;sbitprog=P2^7;voidinit_serial(){SCON=0x50;/*mode1*/TMOD=0x20;TH1=0xfd;PCON=0x80;/*38400bps*/TR1=1

乐鱼官网推荐

#includeat89x52.h#includestdio.h#includeintrins.h#includectype.hsbitrdy=P3^2;sbitvpp=P3^3;sbitp26=P3^4;sbitp27=P3^5;sbitp36=P3^6;sbitp37=P3^7;sbitprog=P2^7;voidinit_serial(){SCON=0x50;/*mode1*/TMOD=0x20;TH1=0xfd;PCON=0x80;/*38400bps*/TR1=1;/*lo

leye乐鱼娱乐app

adtmr1*/TI=1;ES=1;}voidinit_pro(){p26=0;p27=0;p36=0;p37=0;vpp=1;prog=1;}voidsendbyte(unsignedcharda)/*sendabyte*/{while(!TI);TI=0;SBUF=da;}unsignedcharIntToAscii(unsignedchara)/*changeDECtoASCIIHEXcode*/{if(a10)returna+48;if(a9)returna+55;}unsi

leyu乐鱼全站app

gnedintgetadr()/*get5ditiDECadr*/{unsignedchari,a[5];for(i=0;i5;i++){while(!RI);RI=0;a[i]=SBUF-48;}returna[0]*10000+a[1]*1000+a[2]*100+a[3]*10+a[4];}unsignedchargetdata()/*get2ditiHEXdata*/{unsignedchard1,d2;while(!RI);RI=0;d1=toint(SBUF);while
本文关键词:乐鱼官网推荐,典型的,89C51,编程,程序

本文来源:leyu乐鱼全站app-www.michael-andre.com



Copyright © 2007-2021 www.michael-andre.com. leyu乐鱼全站app科技 版权所有 备案号:ICP备38989592号-5