GPS GT-U7 with Adafruit Feather M0 Express

Hello all,

I am trying to read and output GPS data using my Adafruit Feather M0 and GPS GT-U7 without using the SoftwareSerial library. So far, I've been using the implementation found in this previous post:

I changed the baud rate to 9600 but I'm not sure why there's no output at all. (Below is the output that I see). Am I doing something wrong? I'm also not sure of the difference between Serial 1 and Serial 2.

Thank you all for your help!

Have you opened the serial monitor?
Hard to tell from your screenshot.

Yes, the monitor looks blank.

and why it says 115200 baud?

Thanks for checking that, it remained blank at 9600 baud.

This keyhole view of your code isn't helping

try printing something to it from loop to see if it works

Here's my full code:

#include <Arduino.h>   // required before wiring_private.h
#include "wiring_private.h" // pinPeripheral() function
#include "TinyGPS++.h"

TinyGPSPlus gps;

Uart Serial2 (&sercom2, 10, 11, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void SERCOM2_Handler()
{
  Serial2.IrqHandler();
}

void setup() {
  Serial.begin(9600);

  Serial2.begin(9600);
  
  pinPeripheral(10, PIO_SERCOM_ALT);
  pinPeripheral(11, PIO_SERCOM_ALT);
}


void loop() {
  while(Serial2.available())
  {
    gps.encode(Serial2.read());
  }
  Serial.println("Test");
  if(gps.location.isUpdated())
  {
    Serial.println("Time: ");
    Serial.println(gps.time.value());
    Serial.println("Satellite Count: ");
    Serial.println(gps.satellites.value());
    Serial.println("Lat: ");
    Serial.println(gps.location.lat(), 6);
    Serial.println("Long: ");
    Serial.println(gps.location.lng(), 6);
  
  delay(1000);

  }
 }

A println("Test") check successfully outputs infinite tests.

remove this line, what does it show?

After commenting the line out and reformatting some of the prints, it returns all 0's.

What about logging the result of Serial2.read() just to see if you receive anything from the module

The GPS should be sending characters\data, but not necessarily time\location data, when it just powered.

The LED can be off, but the GPS should still be sending characters\data.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.