1.基于51單片機
2.基于VSPD虛擬串口軟件
3.拋磚引玉,簡單發送一句話。
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
仿真截圖
單片機源程序如下:
- #include <reg51.h>
- #include <intrins.h>
- #define uchar unsigned char
- #define uint unsigned int
- sbit P12=P1^2;
- char code str[] = "you are the best! \n\r";
- main()
- {
- uint j;
- TMOD=0x20;
- TL1=0xfd;TH1=0xfd;
- SCON=0x50;
- PCON &= 0xef;
- TR1=1;
- IE=0x00;
- P12=1;
- while(1)
- {
- uchar i=0;
- while(str[i]!='\0')
- {
- SBUF=str[i];
- while(!TI);
- TI=0;
- i++;
- }
- for(j=0;j<50000;j++);
- }
- }
復制代碼
所有資料51hei提供下載:
基于protues仿真485,發送數據到上位機.zip
(310.53 KB, 下載次數: 135)
2020-1-27 22:38 上傳
點擊文件名下載附件
基于protues仿真485,發送數據到上位機
|