Forum: µC & Digital Electronics Algorithm for interpreting command packets over serial port.

Author: maverick (Guest)
Posted on:

Rate this post
0 useful
not useful
I am designing communication architecture between two processors for my 
hobby project and they communicate using Serial Port with no buffers and 
so the code should process one byte at a time.
The processors communicate using a pre-defined packet structure. For 
example it will have a start packet byte, end packet byte, sequence 
number, command, command parameters of length 'n' and CRC.
I have written some code to process the packets and it is working fine. 
But it is not robust enough. Let's say if half of the packet is lost and 
the next packet started after that, it will lose the next packet e.t.c.

Is there any algorithm for command processing. I guess network 
processors use these a lot. I would be really grateful if someone can me 
to the resources about sequential processing of network packets 
preferably with examples.

I am uisng Stellaris LM3S processor and programming using C.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.