Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- But I don't understand what are "escape characters"(0x4D) for? What are "Idle characters"(0x4A) for? --- Quote End --- Idle is a control character which is transmitted when there's actually no data to be transmitted, so the receiver simply drops it. Clearly if you need to transmit 0x4A data you can't do it directly, since it would be dropped by receiver. Then the escape code is used to bypass this limitation. Whenever data matching a control code is to be transmitted, you must actually transmit a 2 code sequence, the escape code and the data XORed with 0x20 Since 0x4D is itself a control code, you eventually must escape both 4A and 4D codes. Example: data not a control code : transmit as is data=any control code : transmit escape code, followed by (data XOR 0x20) 0x4A : transmit 0x4D + 0x6A 0x4D : transmit 0x4D + 0x6D Receiver knows this rule and will decode escape characters and retrieve the original data