Recently, I am working on the airborne instrument communication of the mentor project, full-duplex serial communication between the underlying acquisition Board (datacenter) and the human machine interface (HMI). Currently, the Protocol rules are based on the Q & A mechanism. Frames can only be divided into two types of calling frames and response frames. data can be transmitted between the two types of frames (according to the Rules), and the end of the frame is defined. for example, if the current HMI sends a calling frame to the data requested by datacenter, after receiving the data, if the verification is correct, the HMI starts to check whether there is a response frame in the receiving cache. If yes, the HMI starts to check whether there is a response frame in the receiving cache, this is called the frame end response. The above is the preset ideal state process. Next, we will consider communication exceptions in this process. Exception 1. dataCenter and HMI full-duplex communication. Both parties can initiate communication at any time. If both parties initiate a calling frame command at the same time, the state of HMI is data in the receiving cache and sending cache, after the command is sent, check whether there is a response frame in the receiving area and the response frame command word is the same as the sending command word. If yes, process the data in the response frame, and the HMI completes the calling frame command. If the system directly responds to the response frame based on the process, the system continues to listen to the response frame of the command word. If the detected frame verification is incorrect and the Error Data is unreliable, it is impossible to determine whether the caller is calling, answering, and answering command words.
Nak. Dizzy, and I have been dizzy for a long time, '_ ^. (I want to talk about it again tomorrow). I hope my friends will be able to actively participate in this field, please advise orz ^__ ^ the first byte of the appendix Protocol Rule message is the command word. For the main call frame, send the response frame after receiving it, and verify that the ACK + command word is correctly sent; the Nak is incorrectly sent with no command words. The control code format is as follows.
D7 = 0: Command frame; = 1: command response frame (ACK/Nak)
D6 = 0:ACK, = 1Nak
D5 = 0: no subsequent data frame; = 1: there is a subsequent data frame;
D4-D0: frame number
Frame No. When the data length exceeds 255 (including command words), frame separation is required. D5 = 1 indicates there are subsequent frames, and the last frame D5 = 0;
L The number of valid bytes in the data field;
Maximum Data Length: Lmax = 255. Messages exceeding this length need to be sent by frame;
Data domains include command code and data.