GPS With Adafruit Feather M0

I'm trying to get my NEO-6M GPS working with my Adafruit Feather M0. Since I cant use software serial, its become a lot harder. I can't get any readings to print out. I know the GPS is working because the red light is flashing on the GPS, indicating its sending data.

I've tried using SERCOM but it's not working. I've included the code below.


#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(115200);

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


void loop() {
  while(Serial2.available())
  {
    gps.encode(Serial2.read());
  }
  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(10);

  }
 }

This is my first time trying to use SERCOM, any advice or help would be much appreciated.

The default speed is 9600 baud. Are you sure your module sends at 115200 baud?

I would say that this definition is wrong pad 0 and 1 of sercom 2 are not on pin 10 and 11 on the Feather M0.

Why don't you just use Serial1 to connect the GPS?

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