RS232 Communication with MCU
August 22, 2009
So I am making my own CNC - PCB Miller. It is communicating with the computer using RS232 (UART), but in my testing, I find that I don't always get the correct characters, even at 1200baud. Does anyone have a method to suggest for error-checking an incoming data string over serial? I was thinking of doing something like this:
CPU sends data to MCU 4 times.
MCU checks to make sure the data is repeated exactly 4 times.
--If yes->send "OK" 4 times
--If no->send "NOT OK" 4 times
If CPU receives OK, queue up the next data to send
If CPU receives NOT OK, resend the previous data.
Since it's milling, I don't think I'll need it to go too quickly, 1200baud hopefully is fast enough.
Any suggestions on this method or a completely different proven method? I need it to be 100% correct data.
Thanks in advanced for your advice.