1.Communication command
Communication instructions are shown in Figure 1-1 below:
XMT is the sending command, its parameter TBL is the sending buffer, and PORT is the communication port, generally 0 or 1;
RCV is a receiving command, and its parameter TBL is a receiving buffer, where the received data is placed. PORT is a communication port, generally 0 or 1;
Figure 1-2 shows the valid operands of parameters
Figure 1-1 Send and receive commands
Figure 1-2 Valid operands of sending and receiving instructions
2. Introduction to communication command free port mode
The following figure is the introduction of the free port mode, you can understand it.
3. Send and receive data format
Send command XMT can send one or more bytes at a time, up to 255 bytes.
The following figure shows the data format description of the sending buffer TBL, and the first byte shows the sending length.
Note: If there is an interrupt service connected to the send end event, an interrupt will be generated after the last character is sent, the interrupt number is 9 for port 0, and the interrupt number 26 for port 1
Receive command RCV can send one or more bytes at a time, up to 255 bytes.
The following figure shows the TBL data format description of the receiving buffer and the receiving information monitoring bytes. The first byte indicates the receiving length.
Note: If there is an interrupt service connected to the receive completion event, an interrupt will be generated after the last character is received, the interrupt number 23 for port 0, and the interrupt number 24 for port 1
4. Application cases of communication commands
The following figure is a sample program for reference and study
5. Obtain and set port address commands
In addition, there are two port operation instructions as shown in the figure below, which are to set or obtain the station address of the specified port CPU, which are generally not used very much.