ZED-F9R problem with SPI

Hello

I have the “SparkFun GPS-RTK Dead Reckoning ZED-F9R Kit” and also a “SparkFun IoT RedBoard - ESP32” (selected because has already an SD Card). The two are then connected through Qwiic connection.

First started using the GPS board with the U-Center and worked fine, also with some library example of the “SparkFun_u-blox_GNSS_Arduino_Library” with the Readboard-ESP32.

Also the example for the SD Card worked fine once adapted with the Redboard in Arduino IDE: log file are properly created.

I so wanted to increase the default measurement rate from 1 to 5/10/20 Hz. In U-Center it works once also the UART and internal register settings are adapted with an higher rate of the default. I so can create some proper log file.

Problem came once I went back to the coding with the Redboard-Arduino IDE: there I noticed that when the rate is not more just 1 Hz but higher then the buffer between GPS and Redboard started to get full until it crashes. with the i2c protocol set to 400’000 kbs it works only for little longer.

I so unterstood I need to work with the SPI which has much higher speed and should be enough.

So I tried to use and adapt the SPI code example for the GPS ZED-F9R (after soldering the SPI jumper). unfortunately also trying to use the second SPI (because the first is hardwired and used from the SD Card) I couldn’t never start a connection with the GPS.

https://docs.espressif.com/projects/esp … aster.html

I tried to implement the HSPI so defined

SPIClass hspi = SPIClass(HSPI); // HSPI: according to esp32-hal-spi.h HSPI is 2

#define HSPI_MISO 12
#define HSPI_MOSI 13
#define HSPI_SCLK 14
#define HSPI_SS 15

later in setup

...
  //spiPort.begin();
  hspi.begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_SS);  //SCLK, MISO, MOSI, SS
  pinMode(hspi.pinSS(), OUTPUT);                         //HSPI SS
...
  while (!myGNSS.begin(hspi, GNSS_CS, 4000000, 20)) {  
...

I set these pins because from the schematic the other SPI is only accessible in the JTAG pins and yet I have not solder or connect it.

I left the Qwiic for the supply (anyway the i2c should be disabled because I soldered the SPI jumper).

I searched between the hookup guide and forum but there isn’t much about the ZED-F9x and SPI, just this topic

viewtopic.php?f=116&t=56532&hilit=zed+f9+spi&start=15

but also if I tried to use the example codes suggested still never seen a reply from the GPS.

thought that maybe I do something wrong in using the ESP32 so wanted to test it on a simple Arduino Uno (just the SPI without logging) with his proper SPI default pins. but also there nothing and maybe isn’t the best way because also if I supply the GPS with the +3.3 V then the MISO output stil at TTL level… anyway tested the GPS in U-Center and still works fine.

So maybe can someone point me if I’m doing something wrong, is the Redboard ESP32 not the best board for this application?

Thank you in advance

Dan

Hi Dan,

There are data logging examples in the library that may help:

https://github.com/sparkfun/SparkFun_u- … ta_Logging

It depends how much data you are trying to log, but I2C should be able to keep up at 5Hz. Maybe 10Hz. But not 20Hz.

Also, the GNSS will be able to share a single SPI bus with the microSD card. You just need to provide a different Chip Select pin and all should be well.

I hope this helps,

Paul

Also, we have a new version of the u-blox GNSS library which is dedicated to the newer modules like the F9 and M10. It uses the u-blox Configuration Interface instead of the older (deprecated) UBX-CFG interface. I updated the data logging examples in that library a couple of weeks ago - and used the ESP32 FS library instead of the generic Arduino SD library. You should be able to re-use those examples as-is. The only thing you’ll need to change is the CS pin.

The library itself is here:

https://github.com/sparkfun/SparkFun_u-blox_GNSS_v3

The data logging examples are here:

https://github.com/sparkfun/SparkFun_u- … ta_Logging

An SPI example is here:

https://github.com/sparkfun/SparkFun_u- … tomSPI.ino

Use jumper wires to hook up:

3.3V → 3.3V

GND → GND

PICO → PICO

POCI → POCI

SCK → SCK

Your-chipselect → CS

Hi Paul

Thanks for the prompt reply and the information about the correct library (_v3).

Once used the _v3 and example, just with a dedicated CS pin (like first tried before), SPI works fine also on the Redboard ESP32.

For Info it works also with the Qwiic connected but from now on will just leave it out on the GPS board.

I wish this Information (_v3) was already in the ZED-F9R Hookup guide (and imagine for all the other GPS board too). I suggest Sparkfun do it ASAP to avoid similar problems and time loss for future users.

Thanks

Cheers

Dan

Hi Dan,

Glad that’s working for you.

Point taken about the hook-up-guide. I will add some information there. This issue has only appeared very recently though. Up until the latest firmware, the F9 supported both the Configuration Interface and messages like UBX-CFG-MSG. Now only the Configuration Interface is supported. But, just to make it more complicated, the M8 does not support the Configuration Interface, so M8 users need to keep using v2 of the GNSS Library… We will continue to support both.

Best wishes,

Paul