Protocols used to talk between an embedded CPU and a PC

前端 未结 8 1939
梦谈多话
梦谈多话 2021-01-31 20:21

I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished,

8条回答
  •  我在风中等你
    2021-01-31 20:48

    My vote is for the human readable.

    But if you go binary, try to put a header byte at the beginning to mark the beginning of a packet. I've always had bad luck with serial protocols getting out of sync. The header byte allows the embedded system to re-sync with the PC. Also, add a checksum at the end.

提交回复
热议问题