Uploading a sketch with another device attached to hardware serial

Hey all, I have small issue that I bet there is a really easy solution to. I'm creating a wireless APRS GPS tracker and as the name implies, I'm using a GPS for position data. Now, I'm using an ATMega328p and I was just going to use software serial for the GPS, but I found that when the APRS data (which comes out as an audio signal) is transmitting and the GPS tries to send data, the audio becomes distorted and doesn't get decoded by the receiving software. Even when this didn't happen, I found software serial to be unreliable at best. I tried to disable the software serial port when I started transmitting but for some reason that didn't work either. I connected the GPS to the hardware serial port and everything worked great, with one problem, I had to short a pin on the GPS to disable it whenever I wanted to upload a new sketch, or else it would shoot me an error. Now, that's fine and all but I am trying to make this into a product, and the GPS module that I want to use doesn't have a disable pin, so I was wondering if there was an easy software/hardware fix to this.

Thanks!

Try adding resistors into the connection between the GPS and your TX/RX of the ATMega328p.

This will allow the signal of the GPS to be overpowered during sketch download. Start with 1KOhm and work your way down when the GPS does not work reliably anymore.

Because the input of the ATMega pins have a small capacitance it will limit the speed of the serial connection a bit (your resistor and the cap will form a RC filter), but the serial signal is quite slow compared to other signals like SPI, PWM and so on. So, you should be fine.

Noah517:
Now, that’s fine and all but I am trying to make this into a product, and the GPS module that I want to use doesn’t have a disable pin, so I was wondering if there was an easy software/hardware fix to this.

Thanks!

So if you want to make it into a product, then why would the customer need to reprogram the Arduino? The original code works fine, so why do you want to program it again? That’s why you need to short the GPS module.

… Arnav

Software serial will cause the type of problems you describe, and its fairly easy to avoid, with properly written software.

But as this is a commercial product, its probably wise to avoid using softwareserial in the first place.

Simple. There is a writeup on here that I did recently on using quad tri-state buffers like the 74HC125 and 126.

https://forum.arduino.cc/?topic=687167#msg4623295