資源簡介
串口多字節發送與接收,實現串口與單片機數據交換
代碼片段和文件信息
#include
sbit?E485=P3^7;
sbit????ge?=?P2^0;
sbit????shi?=?P2^1;
sbit????bai?=?P2^2;
sbit????qian?=?P2^3;
void?mie();
void?delay(unsigned?int?t);
void?Delay1(unsigned?char?j);
unsigned?char??data_gedata_shidata_baidata_qian;
unsigned?char?code?led[]={0x3f0x060x5b0x4f0x660x6d0x7d0x070x7f0x6f0x00};
unsigned?int?aflag;
unsigned?int?temp;?
unsigned?char?temp1temp2;
unsigned?char??s[2];
unsigned?char?r[2];
void?main()
{?
???
??REN=1;?????//串行通信工作方式1允許接收
??SM0=0;
??SM1=1;
??
??TMOD=0x20;?//?設定定時器1工作于方式2
??TH1=0xfd;
??TL1=0xfd;
??TR1=1;
??EA=1;
??ES=1;
???P1?=?led[0];
???ge=1;
???shi=1;
???bai=1;
???qian=1;
???delay(1000);
???P1?=?led[1];
???ge=1;
???shi=0;
???bai=0;
???qian=0;
???delay(1000);
???P1?=?led[9];
???ge=0;
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2235??2011-06-16?22:42??232\serial_port.c
?????文件???????1662??2011-06-16?22:42??232\serial_port.hex
?????文件?????????70??2011-06-16?22:42??232\serial_port.lnp
?????文件??????11676??2011-06-16?22:42??232\serial_port.M51
?????文件???????9254??2011-06-16?22:43??232\serial_port.plg
?????文件???????6376??2005-03-22?15:22??232\STARTUP.A51
?????文件??????14056??2011-06-16?22:42??232\STARTUP.LST
?????文件???????2052??2011-02-28?20:10??232\serial_port_Uv2.Bak
?????文件???????2051??2011-02-28?20:29??232\serial_port.Uv2
????.......??????1164??2011-06-16?19:53??232\serial_port_Opt.Bak
?????文件????????749??2011-06-16?22:42??232\STARTUP.OBJ
?????文件???????5987??2011-06-16?22:42??232\serial_port.LST
?????文件???????7946??2011-06-16?22:42??232\serial_port.OBJ
?????文件???????7449??2011-06-16?22:42??232\serial_port
?????文件???????1165??2011-06-16?22:43??232\serial_port.Opt
?????目錄??????????0??2011-06-16?18:40??232
-----------?---------??----------?-----??----
????????????????73892????????????????????16
- 上一篇:UTM 坐標轉換
- 下一篇:WPS 二次開發接口文檔
評論
共有 條評論