0 Preface
The master-slave system consisting of a PC and a single-chip microcomputer is very common and has been applied in many fields. In these systems, serial communication is generally used between the PC and the MCU. Data and instructions are exchanged according to a certain format, and the PC control of the MCU, data forwarding, or data and status on the MCU are completed. Return.
When the number of microcontrollers is large, it is easier to control the PC to all microcontrollers. Generally in this case, the broadcast method is adopted.
All the MCUs are hung on a serial data bus, only need to address the MCU, and the PC broadcasts the address data and the control message. After receiving the broadcast data, the MCU performs address comparison and filters out the required data. The corresponding data transfer.
If the PC wants to broadcast to the MCU and return all the information of the MCU, that is, the MCU needs to send data to the PC, plus the number of MCUs is larger (more than 100 MCUs), then the PC and MCU should be realized. The difficulty of communicating with each other is relatively large.
This paper proposes a practical method, through the actual circuit construction and debugging, realizes the mutual communication between PC and MCU, and achieves the predetermined goal, so that the system has the following functions:
(1) The PC can control all 100 MCUs, and send different control words to each MCU as needed;
(2) The state modification of the PC to the MCU is random and irregular;
(3) All the MCUs return some of their status information to the PC in order.
1 Several ways to achieve mutual communication
The broadcast from PC to multiple MCUs is relatively simple. It is more difficult for multiple MCUs to send data to the PC. Since more than 100 single-chip microcomputers are hung on one data bus, the difficulty of system design lies in the transmission of control rights of the data bus. It is absolutely impossible for two or more devices to send data to the bus at the same time. At the beginning of the system design, two kinds of bus control methods were considered: relay type and point name type:
(1) Relay bus control mode
The basic idea of ​​this control method is: after initialization, all the MCUs are in the serial receiving state after receiving the PC data, and do not occupy the bus control right. The PC sends a loopback start command, the first microcontroller responds to the command, and immediately takes control of the bus, and sends data to the PC on the bus. After the data transmission is completed, the first microcontroller sends a control command to notify the second. The single-chip microcomputer, at the same time, the first single-chip microcomputer exits the bus control right and is in the receiving state; after receiving the first instruction of the first single-chip microcomputer, the second single-chip microcomputer starts transmitting data to the bus, and ends the transmission, like the first single-chip microcomputer. After that, the third MCU is notified, and thus, the relay is continuously transmitted, and the bus is controlled in turn until the last MCU completes the data transmission. In the process of controlling the bus and transmitting back in the single-chip microcomputer, if the data is to be transmitted to a certain or some single-chip microcomputer through the PC, the PC software will automatically store the data, and wait until the last one-chip computer receives the data sent to the PC. The PC then takes up the data bus and starts transmitting data to the microcontroller.
(2) Named bus control mode
The control method is basically the same as the relay control method. The difference is that this control method needs to wait for the PC to name the command. After the system is initialized, after the MCU receives the PC command and data, the PC sends the point name command, so that the first MCU starts to transmit data. After receiving the instruction, the first MCU immediately takes up the bus and starts transmitting data. After the transmission is finished, the transmission is sent. After the end instruction is sent to the PC, the PC immediately occupies the bus after receiving the end instruction, and then sends the name command to let the second MCU start transmitting data, so that the operation continues until the last MCU ends the transmission.
What suddenly appear into your mind when hear Mini Gaming PC? Is there quality heat-releasing fan and box design of Mini Gaming PC Build? Does it run stable and smoothly when handle heavier jobs, like Photoshop, Pr, engineering design and drawing, 3d Max, big games, etc. ? now we can be responsible to answer [ Yes". No matter cheap mini gaming pc or Mini Gaming PC Under $500, equips with quality fan to heat releasing. Therefore, no need to worry that again.
To processor, can do from intel celeron j4125, N5105 up to i3, i5 i7 10th 11th 12th with or without video graphics. To slots, same rich as traditional computer tower, like above 4 or 6 usb ports, 2 Rj45, VGA, PD, slot, etc.
You can also find Mini Gaming PC, j4125 Mini PC ,Custom All In One PC, windows 10 Education Laptop,Quad Core Processor Laptop, 15 Inch Gaming Laptop ,windows Yoga Laptop , 8 inch Android Tablet, etc.
If any other special requirements interest, you can also let us know, will try our best support you.
Meet your unique demand in this field is our mission, so just feel free contact us whenever you have different idea.
Mini Gaming PC Build,Cheap Mini Gaming PC,Mini Gaming PC Under $500,Mini Gaming Desktop
Henan Shuyi Electronics Co., Ltd. , https://www.shuyilaptops.com