Ublox-Nina Minimum pins

Hi,

On the Arduin MRK-WIFI101 is a Ublox Nina module for enabling WiFi Support. I want to design my own circuit and use the Nina Module with another Processor. When looking at the schematic, i discovered that alot of pins are connected to the Nina Module. As far as i've seen there is UART, SPI and I2C there, but i'm sure you could use just one of the Interfaces...

I discovered that there is an arduino sketch that allows to update the firmware on the Nina Module.

Does anyone here have knowlege what the minium pins are for operating this module? The Processor should just communicate with the module for WIFI. GPIO functionality is not needed. For updating the firmware i can use a programmer or something else.

Is the library communicating by UART or SPI?

Thanks for any info..

I did run Nina firmware successful on an ESP32 with WiFiNina library in attached MKR Zero.
The required pins are SPI pins
in firmware source:

SPISClass(spi_host_device_t hostDevice, int dmaChannel, int mosiPin, int misoPin, int sclkPin, int csPin, int readyPin);
SPISClass SPIS(VSPI_HOST, 1, 12, 23, 18, 5, 33);

readyPin is not really a spi pin. it is a pin to signal from slave to master that the slave has data to send. you can choose a different pin
for some reason the spi pins are mixed from two spi interfaces of the esp32. I used the documented VSPI pins. (I build the firmware from the source)

in library source

static uint8_t SLAVESELECT = 10; // ss
static uint8_t SLAVEREADY  = 7;  // handshake pin
static uint8_t SLAVERESET  = 5;  // reset pin

and NINA_GPIO0 is used, but not defined in library (boards have it in variant). you can choose this pin on the 'host' mcu.
SLAVERESET pin of host should be connected to reset of the esp32

gpio0 is used to put the esp32 into flashing mode for firmware update
and it is used as 'heartbeat' signal of the firmware, so it must be wired

RX, TX are wired for firmware update and are used in Bluetooth mode too.
Bluetooth mode is selected with pin 5 of the esp32.
I didn't test firmware update and Bluetooth

So this means you only need 4-Wire SPI plus ACK and RESET?

If GPIO0 is for use of update, it can be wired to a jumper or external signal, right? It don’t need to be on the MCU itself.

I’ve attached the orginal schematic part from the “Arduino UNO Wifi Rev2” and removed the pins i think that are not needed for operating the board, sure i will connect them to pogo pin pads for use.

Can you confim that this is correct?

sgt_johnny:
So this means you only need 4-Wire SPI plus ACK and RESET?

If GPIO0 is for use of update, it can be wired to a jumper or external signal, right? It don't need to be on the MCU itself.

I've attached the orginal schematic part from the "Arduino UNO Wifi Rev2" and removed the pins i think that are not needed for operating the board, sure i will connect them to pogo pin pads for use.

Can you confim that this is correct?

io 0 is used for heartbeat (periodic "I am alive" signal). you must wire it.

I still have the esp32 board in breadboard with wires plugged in,.

here is the photo

the red wire is not connected.
the orange wire is connected as reset to EN with a wire under the board
down-right is io 0
VSPI pins 5, 18, 19, 23 (I changed 12 to 19 in firmware)
I used 22 as readyPin (originally 33)

20190228_175419.gif

Okay. This looks fine :slight_smile:

One last thing i noticed, i created the schematic symbol for my pcb from datasheet of ublox.

Looks like in the arduino schematic, the following are wrong:

Pin 1 is named “MISO” or “SPIV_DI” - but according to W102 datasheet pin numer 1 is SPI_V_MOSI. !!

and

MOSI (should be MISO) is connected to pin 36, which is a gpio, instead of pin 21 which is SPI_V_MISO!

And remote reset is wired to pin 21…

Why?

sgt_johnny:
Okay. This looks fine :slight_smile:

One last thing i noticed, i created the schematic symbol for my pcb from datasheet of ublox.

Looks like in the arduino schematic, the following are wrong:

Pin 1 is named "MISO" or "SPIV_DI" - but according to W102 datasheet pin numer 1 is SPI_V_MOSI. !!

and

MOSI (should be MISO) is connected to pin 36, which is a gpio, instead of pin 21 which is SPI_V_MISO!

And remote reset is wired to pin 21...

Why?

I guess remote reset is to reset the AVR chip for OTA upload. It is not implemented yet.

I noticed some errors too. I used the MKR1010 schematics.

I still don't understand why the arduino MRK1010 has wired the "MOSI" to the pin 36.

Pin 36 has following functions:

  • GPIO_36
  • JTAG_TDI
  • SPI_H_MISO
  • SDIO_D2
  • TOUCH_5

All other SPI pins are on the "SPI_V" interface, which has mosi (or miso if seen from module side) on the pin 21

Pin 21 has the following functions:

  • GPIO 21
  • UART_RTS
  • RMII_TXDO
  • SPI_V_MISO

I see that they use uart, but does the uart really, like really need RTS/CTS? Isn't there any way to use pin 21 to MISO/MOSI

sgt_johnny:
I still don't understand why the arduino MRK1010 has wired the "MOSI" to the pin 36.

Pin 36 has following functions:

  • GPIO_36
  • JTAG_TDI
  • SPI_H_MISO
  • SDIO_D2
  • TOUCH_5

All other SPI pins are on the "SPI_V" interface, which has mosi (or miso if seen from module side) on the pin 21

Pin 21 has the following functions:

  • GPIO 21
  • UART_RTS
  • RMII_TXDO
  • SPI_V_MISO

I see that they use uart, but does the uart really, like really need RTS/CTS? Isn't there any way to use pin 21 to MISO/MOSI

In comment #4 I wrote that I used VSPI pins. I use io numbers in code of course.

physical pin 36 is io 12 and pin 21 is io 19

Oh, sorry for the fuss, i think i understand now, so the Nina is NOT a simple Module, its a own Microcontroller.

So this is the sketch thats on the NINA?:

Now its much clearer! Thank you!

sgt_johnny:
Oh, sorry for the fuss, i think i understand now, so the Nina is NOT a simple Module, its a own Microcontroller.

So this is the sketch thats on the NINA?:
nina-fw/sketch.ino.cpp at master · arduino/nina-fw · GitHub

Now its much clearer! Thank you!

yes, it is an esp32 (single core version?). the firmware is compiled with Espressif IDF toolchain.

Sorry for digging this thread up, but could you maybe confirm if the attached schematic is correct?

I connected SPI like in the MKR1010 schematic, but moved MOSI to pin 21 (ESP32 PIN 19), and removed all un-necessary pins except 22/23 which will go to a jumper to upload the firmaware by FT323 Board.

Will this work? Would be sad to waste a 20$ module :frowning:

sgt_johnny:
Sorry for digging this thread up, but could you maybe confirm if the attached schematic is correct?

I connected SPI like in the MKR1010 schematic, but moved MOSI to pin 21 (ESP32 PIN 19), and removed all un-necessary pins except 22/23 which will go to a jumper to upload the firmaware by FT323 Board.

Will this work? Would be sad to waste a 20$ module :frowning:

you see the photo. I had it wired to MKR Zero and it worked with nina-fw and WiFiNINA library.
there is nothing to go wrong with digital pins used only for communication

attachment

nina-fw.zip (483 KB)