GPS logging with PA1010D and M0

GPS PA1010D UART M0

Pre-requisites

Use GPS module PA1010D with Arduino M0 to turn on the LOCUS built-in datalogger.

Code

Download code
#include <Adafruit_GPS.h>

#define GPSSerial Serial1

Adafruit_GPS GPS(&GPSSerial);

#define GPSECHO  true

void setup() {
  SerialUSB.begin(115200);
  while (!SerialUSB) { }

  delay(1000);
  SerialUSB.println("Adafruit GPS logging start test!");
  GPS.begin(9600);

  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
  GPS.sendCommand(PGCMD_ANTENNA);
  GPS.sendCommand(PMTK_Q_RELEASE);

  SerialUSB.print("\nSTARTING LOGGING....");
  if (GPS.LOCUS_StartLogger())
    SerialUSB.println(" STARTED!");
  else
    SerialUSB.println(" no response :(");
}

void loop() {
  if (GPSSerial.available()) {
    char c = GPSSerial.read();
    SerialUSB.write(c);
  }
}

Makefile

BOARD?=arduino:samd:mzero_bl
PORT := $(shell ls /dev/cu.usbmodem*)

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright,-whitespace/line_length,-readability/casting *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD) ./

clean:
	rm -f .*.bin
	rm -f .*.elf
	rm -f .*.hex

Serial console

Serial output from the firmware.

GPS logging with PA1010D and M0 serial console

References