当前位置:网站首页>51 single chip microcomputer multi computer communication

51 single chip microcomputer multi computer communication

2022-06-25 01:02:00 xuechanba

Video learning link : https://www.bilibili.com/video/BV1pi4y147A6?spm_id_from=333.880.my_history.page.click&vd_source=b91967c499b23106586d7aa35af46413
 Insert picture description here
 Insert picture description here
 Insert picture description here
Only used in case of multi computer communication SM2 , In general, do not use .
 Insert picture description here
 Insert picture description here
TB8 It is used when sending data , And RB8 Corresponding .
 Insert picture description here
 Insert picture description here

 Insert picture description here
The ninth digit of the data is the check digit .

The difference between serial mode 2 and mode 3 is , The baud rate of serial mode 2 is fixed , There are only two options , The baud rate of mode 3 is determined by the timer T1 Is determined by the overflow rate , That is, mode 3 is a working mode with variable baud rate .

therefore , When working in mode 3 , First, understand the communication sequence of mode 3 ,
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
When other events are handled between processes , If there is an interruption , Execute the corresponding interrupt program .
 Insert picture description here
 Insert picture description here
 Insert picture description here
Each time the host key is pressed , Add... To the count result 1 , At the same time, the counting result is displayed on the nixie tube . And when the switch is grounded , Send to 1 Single chip microcomputer No . When the switch is connected to high level , Send to 2 Single chip microcomputer No . After each slave receives the data, it should display the receiving result on its own digital tube .

 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
After sending the slave address , Or during key counting , Interrupt requests may occur .
 Insert picture description here
If RB8 The value of is 1 Words , Is the address signal , If RB8 The value of is 0 Words , Data signals .

Finally, the program code and simulation are uploaded to the data file .

原网站

版权声明
本文为[xuechanba]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242011511409.html