当前位置:网站首页>Proteus -- RS-232 dual computer communication
Proteus -- RS-232 dual computer communication
2022-07-02 07:03:00 【Wonderful drifting of coal】
1. Circuit diagram
MAX232 by +5V Single power supply RS-232 Level conversion chip , Internal integrated charge pump circuit 、 Can produce +12V and -12V Two power supplies , Provide RS-232 The need of serial port level , The pin diagram is shown in the figure 5~20 Shown . among , Pin 1、2、3、4、5、6 External capacitance , Composition charge pump .T1in、T2in by TTL Level input , convert to RS-232 After level , Respectively from the T1our、T2our Output ;R1in、R2in by RS-232 Level input , convert to TTL After level , Respectively from the R1our、R2our Output .
2. Code
#include<reg51.h>// Include access sfr Library function rug51、h
unsigned char code c[10]=(// Define the sending data array , And the assignment
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0xf8,0xf8,0x80,0x90);//0~9 Gongyang share code
void main(){
unsigned char i;
unsigned long t;
TMOD=0x20;
TH1=0xe8;TL1=0xe8;
SCON=0x40;
PCON=0;
ET1=0;
ES=0;
TR1=1;
while(1){
for(i=0;i<16;i++){
SBUF=c[i];
while(TI==0);
TI=0;
P1=c[i];
for(t=0;t<21740;t++);}}}
(2) Machine B receives
#include<reg51.h>// Include access sfr Library function rug51、h
void main(){
unsigned char i;
TMOD=0x20;
TH1=0xe8;TL1=0xe8;
SCON=0x40;
PCON=0;
ET1=0;
ES=0;
TR1=1;
while(1){
for(i=0;i<16;i++){
REN=1;
while(RI==0);
REN=0;
RI=0
P1=SBUF;}}}
边栏推荐
- JS divides an array into groups of three
- php中计算树状结构数据中的合计
- Sqli - Labs Clearance (less6 - less14)
- php中通过集合collect的方法来实现把某个值插入到数组中指定的位置
- Log - 7 - record a major error in missing documents (A4 paper)
- Flex Jiugongge layout
- SQLI-LABS通关(less6-less14)
- Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
- The table component specifies the concatenation parallel method
- SQLI-LABS通關(less6-less14)
猜你喜欢
SQLI-LABS通关(less18-less20)
Wechat applet Foundation
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
Huawei mindspire open source internship machine test questions
CVE-2015-1635(MS15-034 )远程代码执行漏洞复现
[Zhang San learns C language] - deeply understand data storage
sqli-labs通关汇总-page4
Win10: add or delete boot items, and add user-defined boot files to boot items
In depth study of JVM bottom layer (II): hotspot virtual machine object
Queue (linear structure)
随机推荐
Thinkphp5中一个字段对应多个模糊查询
Ingress Controller 0.47.0的Yaml文件
Code execution sequence with and without resolve in promise
Sqli labs customs clearance summary-page4
ORACLE 11G SYSAUX表空间满处理及move和shrink区别
Deployment API_ automation_ Problems encountered during test
CVE-2015-1635(MS15-034 )遠程代碼執行漏洞複現
Common function writing method and set get writing method for calculating attributes
sqli-labs通關匯總-page2
Build learning tensorflow
外币记账及重估总账余额表变化(下)
Yolov5 practice: teach object detection by hand
js数组的常用的原型方法
Sqli labs customs clearance summary-page1
IDEA2020中测试PySpark的运行出错
js的防抖和节流
Kali latest update Guide
How to call WebService in PHP development environment?
Sentry construction and use
CAD secondary development object