Home > other >  Serial data, etc
Serial data, etc

Time:09-30

STM32 microcontroller serial port in accordance with the agreement of their data sent slide, code should be how to write, including frame head frame, data bits, parity, stop bits, such as this:
Assumes that the frame head of 0 XFFFF, black and white parity bits a stop bit, tail frame 0 xfffe, how to design code? Confused, genuflect is begged me for two days

CodePudding user response:

By the way, have data length

CodePudding user response:

You confusing the upper protocol and the underlying protocol, the underlying protocol is parity, stop bits, the upper protocol is frame head, you said frame tail, you want to realize the upper-layer protocol, the underlying protocol set up, directly in order to send you the content of the agreement,

CodePudding user response:

That is to say, if I only send data directly, need not send frame head frame tail?

CodePudding user response:

Tail frame head frame is an abstract concept, is subjective definition, said is like you sent: x45 x58 XBB xaa 0 0 0 0 0 x30, you could say that 0 xaa is frame head, also can say 0 xaa 0 XBB is frame head, is your own subjective definition,

CodePudding user response:

reference whales, 4/f, niko response:
tail frame head frame is an abstract concept, is a subjective definition, said is like you sent: x45 x58 XBB xaa 0 0 0 0 0 x30, you could say that 0 xaa is frame head, or 0 xaa 0 XBB is frame head, is your own subjective definition,
you define this agreement, only need to just go, in turn, these data,

CodePudding user response:

reference 5 floor whale niko reply:
Quote: whales, niko reference 4 floor response:

Tail frame head frame is an abstract concept, is subjective definition, said is like you sent: x45 x58 XBB xaa 0 0 0 0 0 x30, you could say that 0 xaa is frame head, also can say 0 xaa 0 XBB is frame head, is your own subjective definition,
you define this agreement, only need to put these data in turn issued just go,
every frame data to take the frame head frame tail to?

CodePudding user response:

If you don't want to use, also can need not, premise is you agreement also is very perfect, I say the role of the frame head frame tail, you know, the role of the agreement, both parties to a communication, mutual support, attention to both sides to recognise and support at the same time, since it is both sides, there is bound to be the sender and the receiver, for the sender, without any limitation, only need to send in turn, so there is no problem, but for the receiver, due to the asynchronous serial port communication, data what time to come, the receiver does not know; Data is what time to start, the receiver also don't know, and so on, so abstract agreement this concept, we define subjective, frame head, let the beginning of the receiver determines the data; Defines the tail frame, let the receiver to determine the end of the data, and so on, actually agreement basic to the receiver, so to speak, and the emergence of a product,

CodePudding user response:

refer to 7th floor whale niko response:
if you don't want to use, also can need not, premise is you agreement also is very perfect, I say the role of the frame head frame tail, you know, the role of the agreement: are people on both sides of the communication, mutual support, attention to both sides to recognise and support at the same time, since it is both sides, there is bound to be the sender and the receiver, for the sender, without any limitation, only need to send in turn, so there is no problem, but for the receiver, because is asynchronous serial port communication, data what time to come, the receiver does not know; Data is what time to start, the receiver also don't know, and so on, so abstract agreement this concept, we define subjective, frame head, let the beginning of the receiver determines the data; Defines the tail frame, let the receiver to determine the end of the data, and so on, actually agreement basic to the receiver, so to speak, and the emergence of a product,
hard, I seem to see

CodePudding user response:

No, said above, is the upper protocol, the underlying protocol, I suggest you take a look at this: https://wenku.baidu.com/view/40083cf3284ac850ac024224.html, then to connect the bottom and top see, know well,

CodePudding user response:

references 9/f, whales, niko response:
no, said above, is the upper protocol, the underlying protocol, I suggest you take a look at this: https://wenku.baidu.com/view/40083cf3284ac850ac024224.html, then to connect the bottom and top see, know well,
well, thank you