Parallax GPS Smart Mode
Hello,
I am trying to interface the Parallax GPS Receiver with an Arduino Duemilanove board. The Arduino itself has 2 pins for serial communications. The GPS receiver only has the single I/O pin. I have attached both the TX/RX pins of the Arduino to the single SIO pin on the GPS and have tried issuing "smart" commands by sending "!GPS" (minus the quotes) and a single byte of data equivalent to a 1 in decimal. I also have an LCD hooked up to the Arduino to display all data received on the serial RX port.
As I said before, the Arduino has 2 ports for serial communication. As such, whatever I send out on the TX port to the GPS is also read back at the RX port of the Arduino. This isn't so much of a problem as I can tell the Arduino to just disregard those first 4 bytes of information and only take the data after.
My problem, however, seems to be that the GPS is not responding to any of the requests for data that I send it. I have tested the board with the /RAW pin grounded and can see all of the RAW data come in on the Arduino's RX port so I know the GPS is working in that aspect. Does anyone have any ideas why it wouldn't be responding to my data requests?
Here is the code I am using:
I am trying to interface the Parallax GPS Receiver with an Arduino Duemilanove board. The Arduino itself has 2 pins for serial communications. The GPS receiver only has the single I/O pin. I have attached both the TX/RX pins of the Arduino to the single SIO pin on the GPS and have tried issuing "smart" commands by sending "!GPS" (minus the quotes) and a single byte of data equivalent to a 1 in decimal. I also have an LCD hooked up to the Arduino to display all data received on the serial RX port.
As I said before, the Arduino has 2 ports for serial communication. As such, whatever I send out on the TX port to the GPS is also read back at the RX port of the Arduino. This isn't so much of a problem as I can tell the Arduino to just disregard those first 4 bytes of information and only take the data after.
My problem, however, seems to be that the GPS is not responding to any of the requests for data that I send it. I have tested the board with the /RAW pin grounded and can see all of the RAW data come in on the Arduino's RX port so I know the GPS is working in that aspect. Does anyone have any ideas why it wouldn't be responding to my data requests?
Here is the code I am using:
#include <LiquidCrystal.h>
boolean requested = false;
int byteRead = 0;
LiquidCrystal lcd(12, 11, 10, 4, 5, 6, 7);
byte getValid = B00000001;
byte getVersion = B00000000;
byte getTime = B00000011;
byte getDate = B00000100;
void setup() {
Serial.begin(4800);
lcd.begin(16,2);
lcd.clear();
}
void loop() {
while (!requested) {
Serial.print("!GPS");
Serial.write(getValid);
requested = !requested;
}
while (requested) {
lcd.clear();
while (Serial.available()) {
lcd.setCursor(0, 0);
byteRead = Serial.read();
lcd.print("Received: ");
lcd.print(byteRead, DEC);
delay(1000);
lcd.clear();
}
requested = !requested;
}
}

Comments