This is supposed to be easy, but I've been banging my head on it. Please help me figure out what I'm doing wrong!
I've got a weather station that sends out data at 2400 and I'm using an Arduino Mega 1280 board. When the weather station is hooked up to an old usb/serial converter I've got then I can capture the correct data on a PC, but when I connect it directly to the Mega's RX2 (in this case) I can't make sense of the data.
I've got the Mega programmed with a simple pass-thru serial program that reads from Serial2 and writes to Serial to try and see what's going on.
Trial and error along with a DSO showed that a "signal indicator" LED w/1K resistor on the line is needed to get a good square wave. Without that little circuit, the Mega just sees junk, with that circuit it sees repeating junk, which is only arguably better!
Here's what I should see (and do see on the PC):
!!00000080----0000----------------0000005A00000000
Here's what I see on the Mega instead (byte values, comma delimited):
111,111,246,246,246,246,246,246,159,165,165,165,165,159,159,159,159,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,229,235,0
There's no obvious logic that could change the 111 into 33 (ascii '!') and also change the other digits into 48 (ascii '0'), and I really don't know what else to try.
Any help is appreciated.