I need to use STX, ETX, Length, Data, Checksum , CMD(Command) bytes in my protocol structure. Data and Length will be variable fields where length refers to length of data. I am new to Embedded c and just need an idea, where i can start as I am confused that, what kind of data(structure of data) user should sent over uart to initiate communication with micro controller. The protocol structure I am trying to develop is as follows:
STX|CMD|LENGTH|DATA|CHECKSUM|ETX.
Thanks in advance.
Review chapters on how Asynchronous Serial works, levels, start bits, stop bits, parity, data bits etc. Some books/datasheets from the 1970's or 80's might be illuminating.
Review chapters of data representations, structures, binary numeric forms, etc. Pretty foundational stuff. If you don't grasp this stuff building protocols is going to be a bit difficult.
Discuss with professor/tutor, or review any number of texts on computer architectures, micro-controller design, etc.