SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By Yodel
#120186
Hey all, first time poster here.

I recently purchased the Copernicus DIP Module for use in a high altitude balloon project, having heard that it is known to function at over 100,000 ft. In the enourmous datasheet for this module, Trimble outlines the structure and function of their proprietary communication protocol, TSIP (Page 97). Being a relative newbie to this sort of thing, I was surprised at how easy it was to receive any data at all from it-- all I had to do was connect a handful pins to the Arduino Mega 2560 I'm using: a few to 3.3v Vcc, one to ground, and two for TX-A and RX-A*.

However, the data that I'm getting from the Copernicus doesn't seem to follow the format for TSIP packets which is described in the datasheet. At least, if it does, I can't see it. Here's the Arduino sketch I threw together to format the data nicely:

*(R/TX-A communicates with TSIP, while R/TX-B uses the standard NMEA protocol)
Code: Select all
int newInput = 0;   //The most recent thing read by serial3.
double clock;      //Time read from Arduino's internal clock.
int prevClock;     //Stores the last time valid data was recieved.
void setup()
{
  Serial3.begin(4800);
  Serial.begin(9600);
  clock = millis();
}

void loop()
{
  newInput = Serial3.read();  //Reads data from Copernicus pin TX-A.
  if (newInput != -1)
  {
      prevClock = clock;      
      Serial.print(newInput, HEX);  //Prints the decimal data as hex digits.
      Serial.print(" ");
  } 
  clock = millis();  //Records the time. 
  if (newInput == 255 || ((clock - prevClock) < 2 && newInput != -1) )  //Makes a new line if most recent data recieved was the
      Serial.println("\n");                                             // hex number FF, or if there was a significant gap in the data transmission.
}
Here's a sample of what I'm getting:
Code: Select all
63 2 0 0 2 40 0 0 E0 16 82 E1 48 10 0 1A FF 
63 2 0 0 2 40 2 0 E0 56 82 E1 40 0 0 18 FF 
3 2 40 0 2 0 2 2 E0 76 82 E2 3 0 2 7 FF 
3 62 40 0 2 40 2 0 E0 56 82 B0 D0 0 2 7 FF 
3 62 40 0 2 40 2 0 E0 36 82 D1 62 0 0 1A FF 
3 62 40 0 2 40 2 0 E0 5E A2 C1 60 40 0 7 FF 
3 40 40 0 2 2 2 0 E0 3A C0 E2 44 40 0 1A FF 
3 42 40 0 2 40 42 0 E0 56 82 E1 44 0 40 1A FF 
3 2 40 0 42 40 2 0 E0 16 82 E1 40 10 2 1A FF 
63 62 0 0 2 40 2 0 E0 5E 83 E1 48 10 0 1A FF 
3 2 40 0 2 40 2 0 E0 16 82 D1 60 0 0 7 FF 
3 2 40 0 2 40 2 0 E0 76 83 D1 60 0 0 7 FF 
3 0 40 0 2 0 2 2 E0 E 83 C1 60 0 0 1A FF 
23 62 40 0 2 40 2 0 E2 66 82 E1 48 0 0 18 FF 
3 2 0 0 2 40 2 0 E2 8 C0 E0 44 0 0 7 FF 
3 2 2 0 0 40 2 40 E0 4E 83 D1 60 0 0 17 FF 
3 2 0 0 2 40 2 0 E0 8 C0 E3 44 0 0 7 FF 
1 2 0 0 2 40 0 0 E0 4E 82 C1 60 2 0 7 FF 
1 2 0 0 2 40 2 0 E2 2E 82 C1 60 2 0 7 FF 
23 2 40 2 2 0 2 0 E0 46 82 C1 60 0 0 1A FF 
63 2 40 0 2 40 2 0 E0 26 82 E1 44 2 0 7 FF 
23 62 40 0 2 40 2 0 E0 4A C0 E3 44 40 0 1A FF 
1 2 40 0 2 40 2 0 E2 E 22 11 6A 0 2 93 3 62 40 0 2 40 2 0 E0 4A A2 E1 40 10 0 1A FF 
3 2 2 0 2 40 2 40 E0 1E 83 B0 D0 2 40 7 FF 
3 62 40 0 2 40 42 0 E0 7E A2 C1 60 2 40 7 FF 
3 62 40 0 2 40 2 0 E0 16 83 E0 44 0 0 1A FF 
3 62 40 2 2 40 2 0 E0 46 82 E1 44 0 0 1A FF 
3 62 40 0 2 40 42 0 E0 6 82 C1 60 0 0 1A FF 
3 2 2 0 0 40 2 40 E0 46 22 51 D2 0 0 7 FF 
1 2 2 0 2 40 2 40 E0 E 83 C1 44 40 0 17 FF 
3 2 40 0 2 40 2 0 E0 4A C0 62 48 0 40 1A FF 
3 2 0 0 2 40 2 40 E0 3A C0 62 48 0 40 1A FF 
1 2 0 0 2 40 2 40 E0 46 82 D1 60 0 0 7 FF 
3 42 40 0 2 40 42 0 E0 26 2 51 D0 0 0 7 FF 
1 2 0 0 2 C0 2 0 E0 5E 82 D1 E0 0 2 17 FF 
1 2 40 0 2 40 2 0 E0 16 83 D1 60 0 40 7 FF 
1 2 40 0 2 40 2 0 E0 56 82 E3 44 40 0 1A FF 
41 2 40 40 2 0 2 0 E0 18 C0 62 48 0 0 1A FF 
41 2 40 40 2 0 2 0 E0 78 C0 60 44 0 0 1A FF 
63 2 0 0 2 40 0 0 E0 16 82 D1 E0 40 0 7 FF 
41 2 0 0 2 40 0 0 E0 76 82 E1 40 0 0 1A FF 
1 2 40 40 2 0 2 0 E0 18 C0 E3 41 0 0 7 FF 
3 2 40 0 2 40 42 0 E0 58 C0 E3 44 0 0 1A FF 
3 2 0 0 2 40 2 40 E0 46 82 B0 D0 2 40 7 FF 
3 2 40 0 2 0 2 0 E0 48 C0 60 44 0 0 1A FF 
3 0 40 0 42 40 2 0 60 6D F0 E3 44 2 40 7 FF 
63 2 0 0 2 40 0 0 E0 26 22 1 6A 0 0 93 23 62 40 0 2 2 2 2 E0 26 2 51 D0 0 0 7 FF 
63 2 0 0 2 40 2 0 E0 6 22 51 2A 0 2 93 3 62 40 2 2 40 2 0 E0 46 82 E0 44 0 0 7 FF 
63 2 0 0 2 40 2 0 E0 4E 82 E0 44 0 0 1A FF 
3 42 40 0 2 40 42 0 E0 8 C0 60 44 0 40 7 FF 
23 2 40 0 2 2 2 0 E0 68 C4 62 44 40 0 1A FF 
3 40 40 0 2 2 2 0 E0 76 82 60 44 0 0 7 FF 
23 2 40 0 2 2 2 0 E0 76 82 C1 60 0 0 1A FF 
3 2 40 0 42 40 2 0 E0 16 82 E1 48 0 0 1A FF 
3 62 40 0 2 40 2 0 E0 5E 82 C1 62 0 0 1A FF 
3 62 2 0 0 40 2 0 E0 1A 22 51 D0 40 0 17 FF 
3 2 0 0 2 40 2 40 E0 56 82 D1 60 0 2 7 FF 
3 2 40 0 2 40 42 0 E0 26 82 D1 60 0 2 7 FF 
3 2 40 0 2 40 42 0 E0 4E 40 B2 D0 40 0 7 FF 
3 2 2 0 0 40 2 40 E0 2A C0 E1 44 40 0 1A FF 
1 2 40 0 2 40 2 0 E0 46 83 E1 44 0 40 1A FF 
3 2 40 0 42 40 2 0 E0 16 A2 C1 60 0 0 7 FF 
1 2 40 0 42 40 2 0 E0 56 83 E1 48 0 0 1A FF 
23 62 0 0 2 40 2 0 2 7 44 1 3 2 60 F4 3 2 40 0 2 40 2 0 E2 7E 83 D1 60 0 0 7 FF 
3 2 0 0 2 40 2 0 E2 5E 40 B0 D2 0 2 17 FF 
3 62 40 0 2 40 42 0 E0 78 C0 E1 44 0 2 7 FF
Every line in the data above was transmitted at intervals of one second, and seemed to end relatively reliably with the hex digit FF (the times when it didn't are shown as longer data strings). Trimble's manual states that every packet of information begins with the "<DLE>" byte (0x10), and ends with an odd number of <DLE> bytes followed by an "<ETL>" byte (0x03). I don't see this anywhere in the data above... can anyone tell me what's going wrong here?

Thanks,
Yodel
By Yodel
#120285
byteworks wrote:The datasheet says (page 17) default settings for serial A are 38400 8N1, so maybe a baudrate mismatch?
Ahah, that seemed to do it! I am now getting data packets which reliably begin with 0x10, and end with 0x03. Thanks so much!
By MNM363
#145400
I am doing a very similar project, and am new to this also, and I was wondering if you could post your updated code. Also, I am using an Arduino Uno, would I need to change the code at all? If so to what? Thank you, in advance, for your time; I would really appreciate it.