Board to board communication

Hello all,
In my project I'm using 2 boards to interface a display, an encoder and an opto - sensor. Through the display on one board I'd like to change values of certain variables on the second. What is the best way to do this?. Through the RX/TX or through the wire transmission ?.
Currently the encoder board has values of x and y as 20 and 24. The user feeds data through the button/display interface on the 1st board, this boards then pings the encoder board(2nd board) to change these values to say 22 and 25.
Best way to do this ?

Thank You :slight_smile:

Best way to do this ?

How often? How far? How fast? What do you know how to do?

There really is no best way. There are good ways. There are ways that work. There are ways that you know how to implement.

How fast? About a tranfer every 2 seconds?

What do you suggest ?

vikramnayak:
What do you suggest ?

Answering the rest of the posed questions. Also, you answered how often, not how fast.

How often : Once every two seconds ?
How far : boards are right next to each other ( max about a feet away) .
How fast : 6 variables' values to transmit across to the other board. I'd assume it should take somewhere around 5 to 10 seconds ?

What I know : Serial comm is one thing I know. Also I just recently read about wire comm, where the clocks of both the boards sync to transmit well. Which is more reliable, which would you use and or are comfortable with ?

Your project actually uses very simple communication so using even the lowest baud rate for UART is fast enough for your eyes to see smooth transitions. If you're transfering media files, then that would be a totally different story. UART at 9600 is more than good enough for your project :slight_smile:

Just to confirm, the 328 has one set of UART pins right ?. Also here is how I think the logic should be ( may be fully wrong ) .

  1. Send the variable for which the value needs to be changed (ex. 'x')
  2. The 2nd board waits for the value of 'x'.
  3. The 1st board sends the value of the variable now (ex. 25)

Also, do I need confirmation from the second board that the transfer is being done right ?

vikramnayak:
Just to confirm, the 328 has one set of UART pins right ?. Also here is how I think the logic should be ( may be fully wrong ) .

  1. Send the variable for which the value needs to be changed (ex. 'x')
  2. The 2nd board waits for the value of 'x'.
  3. The 1st board sends the value of the variable now (ex. 25)

Also, do I need confirmation from the second board that the transfer is being done right ?

That might be called designing a 'protocol' and how 'robust' it might be is a function of how reliable and fool proof your requirements are. There should be some kind of protocol so that the two boards don't get 'out of sync' if a message is suppose to be sending a name or number and an acknowledgment sent back might be one means.

Lefty

Ok, it's like creating your own way of making the boards understand the transmit.

Thanks a mill :slight_smile:

Is two way communication required between the two boards, or will one board just send and the other board receive?

One way is fine, but in case you need conf that the 2nd board has received the transmit, you'll obviously require 2 way comm.