Post by mutantcaterpillar on Dec 15, 2016 12:08:27 GMT
Hi everybody,
I'm trying to use the serial port to read bytes of data. The serial port is configured correctly to 8N1, the baud rate is correct.
I have a device on the serial bus pumping out regular data - it's always 153,42,xx,137,42,yy (where xx and yy are variable - the rest is static). I'm using a DECimal print-out because I made it exactly the same as an Arduino sample code snippet.
The code is a simple entry in loop() that goes:
The output I get is this:
(Apologies for the large code-block - I need to show how it changes from OK to bad)
Using a logic analyser shows the data across the serial bus is constant - it continues to push correct data, but the ShieldBuddy sketch just starts to ignore the last byte, and from then on in, never shows that last byte.
Does anyone know what may be causing this?
Thanks!
I'm trying to use the serial port to read bytes of data. The serial port is configured correctly to 8N1, the baud rate is correct.
I have a device on the serial bus pumping out regular data - it's always 153,42,xx,137,42,yy (where xx and yy are variable - the rest is static). I'm using a DECimal print-out because I made it exactly the same as an Arduino sample code snippet.
The code is a simple entry in loop() that goes:
if ( Serial.available() > 0 )
{
incoming_byte = Serial.read();
SerialASC.print( "I received: ");
SerialASC.println( incoming_byte, DEC );
}
The output I get is this:
I received: 153
I received: 42
I received: 104
I received: 137
I received: 42
I received: 73
I received: 153
I received: 42
I received: 121
I received: 137
I received: 42
I received: 65
I received: 153
I received: 42
I received: 115
I received: 137
I received: 42
I received: 53
I received: 153
I received: 42
I received: 102
I received: 137
I received: 42
I received: 68
I received: 153
I received: 42
I received: 112
I received: 137
I received: 42
I received: 60
I received: 153
I received: 42
I received: 117
I received: 137
I received: 42
I received: 74
I received: 153
I received: 42
I received: 115
I received: 137
I received: 42
I received: 59
I received: 153
I received: 42
I received: 125
I received: 137
I received: 42
I received: 153
I received: 42
I received: 137
I received: 42
I received: 153
I received: 42
I received: 137
I received: 42
(Apologies for the large code-block - I need to show how it changes from OK to bad)
Using a logic analyser shows the data across the serial bus is constant - it continues to push correct data, but the ShieldBuddy sketch just starts to ignore the last byte, and from then on in, never shows that last byte.
Does anyone know what may be causing this?
Thanks!