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 ?
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
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 ) .
Send the variable for which the value needs to be changed (ex. 'x')
The 2nd board waits for the value of 'x'.
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.