Page 1 of 1

Sending and receiving RS232

Posted: Fri Mar 11, 2011 7:27 am
by jollybv
Hi Guys

What i am trying to do is send data from one chip to another Via RS232 "Which is not a problem" read it the other side, once red send an instruction of sum sort to send the next string of data and so on. Is there any examples of how to do this or can someone tell me how to do this..???

Brian

Re: Sending and receiving RS232

Posted: Fri Mar 11, 2011 10:41 am
by Benj
Hello Brian,

When doing something like this I generally design my own protocol that is fit for purpose.

Normally along the lines of something like this.

One node is Master and one node is slave doesn't matter which way round.

The slave node sits and waits for incoming data.

The master node sends a command byte eg print data to a LCD could be command 1, the master then sends the length of the string and then sends the bytes from the string.

The slave node receives the command byte and then switches to process command 1. Command 1 consists of receiving the size byte and then looping for the specified number of data bytes printing out the byte values to the LCD.

Re: Sending and receiving RS232

Posted: Mon Mar 14, 2011 4:29 pm
by jollybv
Hi Ben

Thanks for the response but now you have totally lost me maybe im having a blond moment but will play around and see what i can come up with.