Uno Serial 0 clarification?

Hi folks, I need to use the interrupt pins on the uno for serial communication with a GPS as well as handling input from an RC receiver.

What is not clear to me is the UART connection on pins 0,1. These are accessible via the header, and today I successfully connected my GPS chip (MTK3329) to them and got it talking. Software-wise, I'm using bits of the ardupilot project's library for testing.

So how are these pins at the header connected to both the atmega328, and the USB-Serial chip? I got my GPS to work OK, AND was able to print text back to the Arduino serial monitor OK, which I didn't quite expect. I'm assuming that I can use pins 0,1 in my project without concern for the USB-Serial connection. Is this OK? The board description at isn't clear.

How is the GPS connected to the Uno? Is it connected to digital pin 0 and set to NMEA0183 mode? If so, that is why the GPS and the serial monitor output work. The GPS is on the rx pin, and the serial output is being sent to the computer on the tx pin. So in that setup, they won't interfere.

But if you try to send serial data from the computer to the Uno, there will probably be trouble. The Uno will think that is the GPS.

Digital pins 0 and 1 are connected to the tx and rx lines between the atmega328 and the usb controller IC, so you must have some concern there.

edit: If you try to use the GPS in the proprietary mode, the commands sent to the GPS will appear on the serial monitor.

Why do you need to use the interrupt pins for serial communication? The serial port in the 328 has its own interrupts for the serial port. The serial port libraries use them already, or are you trying to create your own low level communications routines? If you use pins 0 & 1 for things other than serial communication you might have some trouble getting a new sketch to load. It is best to use those pins on an Arduino for serial communications only, unless you have 2 Arduino 328 chips and can use one to run the ArduinoISP sketch.

@SurferTim, the GPS’s TX,RX is attached to the Uno’s RX,TX. When powered up, I believe I did see the special NMEA MTK command echoed to the Arduino serial monitor window. This command switches the GPS into the diydrones’s custom binary protocol instead of NMEA. So, it looks like the USB-Serial chip and the GPS are hooked in parallel to the UART.

I thought I had asked it this way, but I did not: I was wondering if there was circuitry that broke the connection between the 328 and USB-serial chip, when another connection was made directly to pins 0,1. I guess not.

@kf2qd: I am making a simple autonomous rover out of an RC truck and have a number of sensors to connect, plus the RC inputs and outputs for manual mode. I originally had the GPS connected on pins 3,4 (RX,TX) so that I could use interrupt-driven serial input through the NewSoftSerial lib (arduino < 1.0), or SoftwareSerial (arduino >= 1.0). At the default baud rate of 38400, the NMEA data I was receiving was corrupted. I then connected it to 0,1 and am now receiving data at 38400 without corruption.

The only problem I’ve seen with using 0,1 for the GPS is that when I upload a new sketch, I must disconnect the GPS. Otherwise, it works reliably.

Once this is installed in the truck, is there any harm in connecting the GPS in parallel with the USB-serial chip? When running, the USB will not be connected.

Thanks for the comments!