Hi PJALM

I don't have any examples in PIC as I am an 8051 major. I have done a couple of projects on PIC but no comm stuff yet.. So, from the 8051 side this is how I did it.

A typical command packet would be something like

STX id cmd arg1 arg2.... ETX where


STX = 02h, ETX = 03h, id is the slave ID, cmd is the function you want the slave to execute.

This packet would be received in the background by an interrupt routine, buffered in a RX buffer. This would then be retreived by the mainline program. The mainline will identify the id byte to be its own and formulate a response to send. So, if you see, there is a delay between the complete packet being available to the slave/many slaves and the Id'ed one responding. We have to account for this delay to receive the response successfully.

I hope this will lead you to a positive solution

Jerson