SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By countxero
#154152
Hello Everyone,

I am trying to get the SiRF Demo 3.87 software to interface with the EM-406A through a Arduino Uno and the latest version of the Sparkfun GPS shield so that I can perform a factory reset on the EM-406A. Has anyone been able to do that successfully? I tried setting the GPS shield UART/DLINE switch to UART and loading the sketch below in hopes that the SiRF Demo software could connect but no such luck. Any help would be greatly appreciated.

void setup(){
pinMode(0,INPUT);
digitalWrite(0,LOW);
pinMode(1,INPUT);
digitalWrite(1,LOW);
}

void loop(){
while(1);
}

Thank you,
Russell
By ezflyr
#154218
Hi Russell.

The SiRFDemo software is intended to work when the EM-406A GPS module is connected to a serial port on your PC. Once you do that, the software communicates directly with the module. I know next to nothing about the Arduino, but I'm virtually certain that putting it "in the mix" (at least for what you describe doing) is not going to work! To connect the EM-406A to the serial port on your computer, you'll need a TTL-to-RS232 converter to adapt the higher signal voltages of the PC to the lower signal voltages of the EM-406A. Don't skip this step as you'll most likely destroy the module!

When you finish with the PC, and want to reconnect the EM-406A to your Arduino, you won't need the converter any longer. The only caveat is that the Tx pin on the EM-406A only swings to 2.85V and this may not be enough to trigger the Arduino input. You'll need to check on this!

Having said all this, what exactly do you want to configure on the EM-406A. It does not have a "reset" command, so you'll need to elaborate on what you mean! All of the commands that the EM-406A accepts can be sent by the Arduino, so you may be able to forgo the PC and SiRFDemo? When power is removed from the EM-406A for several days, it will automatically reset everything anyway, and then default to 4800 baud, NMEA mode. In my project that uses the EM-406A (PIC based), the first thing my code does is configure the selection and frequency of the NMEA sentences being broadcast. It's pretty easy to do!

I hope this help?

John
By countxero
#154220
Hi John,

I was hoping to use the Arduino as a TTL to RS232 converter instead. The Arduino is capable of receiving TTL from the EM-406A as I have used it to capture NMEA messages. I've also used the Arduino to output the NMEA messages from the EM-406A to my PC where the SiRF demo software received them and displayed the message parameters graphically. The only thing I wasn't successful at was getting the SiRF demo software to send commands to the EM-406A via the Arduino.

NMEA command RF104 has a factory reset bit in the command that I was attempting to utilize with the SiRF Demo Software. I was attempting to use that bit as I set the baud rate of the EM-406A (via a serial command from the Arduino) to 115200 (which I read was possible with this unit) but the Arduino wasn't decoding the NMEA messages correctly after setting the baud rate. I tried commanding the EM-406A to another baud rate initially and failed hence my posting here for resetting the unit. However, after playing with the commanding and baud rate parameters of the Arduino and the EM-406A, I was able to set the EM-406A baud to 38400 and get the Arduino to decode the NMEA messages correctly.

At this point I would still like to use the Arduino as a pass through if the need ever arises again.

Thank you,
Russell

Below is the Arduino code I used to write the NMEA messages to my PC. This uses the software serial library of the Arduino which is some what flaky for something like this (much higher BER). I suppose I could extend this for transmitting from the PC (SiRF Demo) to EM-406A but I was hoping instead to use the built in UART of the Arduino.

#include <SoftwareSerial.h>

#define TERMBAUD 115200
#define GPSBAUD 38400

#define RXPIN 2
#define TXPIN 3

SoftwareSerial gps_serial(RXPIN, TXPIN);

void setup()
{

Serial.begin(TERMBAUD);
Serial.flush();

gps_serial.begin(GPSBAUD);

}

void loop()
{
while(gps_serial.available())
{
Serial.print((char)gps_serial.read());
}
}
#154223
Hi Russell,

OK, glad you got something to work! I considered that you might be trying to implement a kind of pass-thru mode with the Arduino, but I dismissed it because I didn't see and serial commands in the code you posted originally!

What is your project?

John