chipKIT® Development Platform

Inspired by Arduino™

Really strange and weird problem about UART Serial.Read() :(

Created Thu, 25 Dec 2014 19:42:52 +0000 by devrirobotik


Thu, 25 Dec 2014 19:42:52 +0000

It is a really weird problem. I am using Serial Port 4. I mean U5. (I activated it on libraries.)

And my code is the simplest MultiSerial code. (Serial4->Serial and Serial->Serial4)

void setup() {
  // initialize both serial ports:

void loop() {
  // read from port 1, send to port 0:
  if (Serial4.available()) {
    int inByte =;
  } if (Serial.available()) {
    int inByte =;

And my library is the simple library (that without the interrupt function.)

And sometimes It works properly.

But many times It gives different characters.

(By the way I used all the baudrates and It is definitely not a Serial.Write problem. I am positive it is a problem)

For example:



$VNIdgsgsglgkchnlskfjg(weird charactes)VNIdgsdfgdf$VNalgfkdsjg


$VNINS,0035(null)(null)(null)(null)(null)(null) (I mean it gives 0xFFs.. )

and so on....

but It should give: $VNINS,,333811.902862,1694,0004,+009.500,-004.754,-000.225,+32.95602815,- 096.71424297,+00171.195,-000.840,-000.396,-000.109,07.8,01.6,0.23*5F

I really dont understand the problem. :S:S

I checked the input and output pins with some logic analyzer many times and there's nothing wrong on hardware side.

I don't know what should I do :S

Thank you so much for your helps..

Jacob Christ

Fri, 26 Dec 2014 17:19:03 +0000

Sounds like software timing issue.

I don't think this is related but why do you do Serial1.begin(9600) in setup() and not Serial4.begin(9600)?