chipKIT® Development Platform

Inspired by Arduino™

Trouble connecting a device to the Serial1 port on the Uno32

Created Fri, 30 Sep 2011 22:33:43 +0000 by brewkc


brewkc

Fri, 30 Sep 2011 22:33:43 +0000

Edit: Whoops. It appears that I had the rx and tx from the gps hooked up to the rx and tx of the Uno32, respectively, instead of the other way around. That's a bit embarrassing. At least if someone else makes the same mistake, they won't have to write a forum post about it.

I've been using a serial GPS module for a project with an Arduino Uno for quite some time, and have recently run into a situation where I need to use double precision. I picked up an Uno32, and began to rewrite my code to leverage all of the new features. One of which was the second serial port. I had been using the newSoftSerial library to communicate with the GPS module, and it worked without a hitch. However, as soon as I try to migrate over to the Uno32's extra UART, I run into problems. I'm certain that the module is sending data as soon as it gets power. I've checked it twice with the Arduino. But all I get out of Serial1.read() is -1. Is there some major difference between newSoftSerial and the hardware serial library that I'm not accounting for?

Here is the relevant bit of code, without all of the superfluous GPS bits.

void setup(){
  Serial1.begin(9600);
  Serial.begin(115200);
  Serial.println("GPS module testing");
  
}

void loop(){
 
  byte inchar;
  inchar = Serial.read();
  if (inchar == 'q'){
    Serial.print(Serial1.read());
  }
    
}

vance.walsh

Thu, 21 Aug 2014 05:09:31 +0000

So I just made the same mistake you did, accidentally connected rx to rx and tx to tx.

Very happy that doesn't cause any damage to the chip!

Wanted to let you know that your post saved me pondering for the next few hours, thanks!


Jacob Christ

Tue, 26 Aug 2014 20:20:29 +0000

This happens to the best of us...

Jacob