0

I am developing application with serial communication with arduino due.

Like this:

while(1)
{
  if(Serial2.available() > 0){
  byte l_byData = Serial2.read ();
  Serial.println(l_byData,HEX);
  }
}

But I am getting "0xFF" from serial very frequently.

I am using Arduino 1.6.6 IDE.

Can anyone help on this?

  • When you say you are "getting 0xFF", do you mean that's what is displayed in the serial monitor? – The Guy with The Hat Dec 21 '15 at 16:38
  • Maybe that's what's being sent. What code are you using to send the data and do the baud rates match on both devices ? – Bra1n Dec 21 '15 at 16:49
  • Yes. it was displayed in the serial monitor. – hariprasath Dec 21 '15 at 16:57
  • Baud rate is same on both the devices. – hariprasath Dec 21 '15 at 16:58
  • Is there is any bug in the serial library? – hariprasath Dec 21 '15 at 16:59
1

Check baud rate, voltage levels. Better check your signals with a oscilloscope or at least check it with a serial dongle like this https://www.sparkfun.com/products/11814

0

Is it possible you've accidentally enabled the pull-up resistor on that GPIO or have it wired to vcc by accident? A constant high signal will resent as all 1s (0xFF)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.