0

Challenger NB RP2040 WiFi

The Challenger RP2040 WiFi is an Arduino/Micropython compatible Challenger NB format micro controller board based on the Raspberry Pico chip. The Challenger NB form factor is largely based on the Feather format developed by Adafruit but we have removed the battery connector and the charging circuit and added some well needed extra IO pins.

When we designed this board we took our existing Challenger RP2040 WiFi board and simply applied the new form factor, keeping most of the good stuff on board such as the powerfull RP2040 micro controller from the Raspberry Pi foundation as well as the WiFi chip and antenna.

WiFi

Just like the Challenger RP2040 WiFi it has a  ESP8285 WiFi chip. For those of you that is unfamiliar with this device, it is basically an ESP8266 device with an integrated 1MByte of flash memory. This allows us to have an AT command interpreter inside this chip that the main controller can talk to and connect to you local WiFi network. The communications channel between the two devices is an unused UART on the main controller and the standard UART on the ESP8285. As simple as it can be.

The ESP8285 chip comes pre-flashed with Espressif’s AT command interpreter stored in the internal 1MByte of the ESP8285. This interpreter support most of the operating and sleep modes of the standard ESP8266 framework which makes it easy to work with. Talking to the device is as easy as opening the second serial port (Serial2), resetting the ESP8285 and start listening for events and sending commands

I2C Flexibility

On this board we are also introducing our own take on the popular Groove format from Seeed Technologies. We wanted to make it easier to build highly integrated stuff using our boards and cables normally take up a lot of room and are messy to deal with. And with the experience from another project we decided to used a FPC connector that will allow you to use a flex cable that is only 2.5mm wide and 0.13mm thick. The cable can be bent and shaped to fit you enclosure exactly and the taped into place taking up in practice no place at all.

USB Type C

In the recent years we have noticed that we are seeing more and more USB Type C cable laying around the lab due to the fact that all new phones and accessories use them. As of yet we haven’t seen any shortage of micro USB cables but we are not getting any new ones any more and old ones do break occasionally. So we decided to go for a USB Type C connector for this board. A bonus of this is that they are quite bit more durable and you don’t have to fiddle with the cable before plugging it in.

Weight 0.009 kg
Dimensions 5.07 × 2.28 × 0.72 cm

Using the Arduino environment

We’ve teamed up with Earle F. Philhower over at his Github page to provide Arduino support for our Raspberry Pi Pico based boards. All instructions on how to install the board support packaged as well as multiple examples on how to use the Raspberry Pi Pico processor.

MicroPython

The Challenger RP2040 WiFi board is fully compatible with both the micropython package found at the Raspberry Pi site as well as Adafruits CircuitPython. Instruction are available on how to install the python interpreter of your choice is available on respective web site.

Short initialization example

To simplify the hardware aspect of the WiFi modem we have included a small helper class in the Arduino IDE that is always available to you as a developer. This new class replaces the previous examples on how to do a proper reset and sync.

So this is basically all you need to do before starting the WiFi manager.

if (Challenger2040WiFi.reset())
    Serial.println(F("WiFi Chip reset OK !"));
else
    Serial.println(F("Could not reset WiFi chip !"));

After these step the modem is initialized and is ready to accept your commands.

The reset() function of the built in Challenger2040WiFi library will perform a HW reset of the WiFi modem and wait for it to return the “ready” prompt. After this a WiFi manager can be started and start communicating with the modem.

Here at iLabs we use the WiFiEspAT library and initializing the stack is as easy as

WiFi.init(Serial2);

At this point you can also do a check to make sure that the data link is setup properly.

if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
}

You are now good to go, so doing something like this:

Serial.println("Waiting for connection to WiFi");
while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print('.');
}
Serial.println();
Serial.println("Connected to WiFi network.");

will work as expected.

Changing the baudrate

The default baudrate between the RP2040 micro controller and the ESP8285 WiFi modem is 115200 and while this is probably good for most IoT applications that normally don’t send very much data it can sometimes be useful to increase the baudrate.

The Challenger2040WiFi contains a method for doing this and again it is super simple to use. Just do the following and the baud rate will be altered on both systems and the devices will be synced up.

Challenger2040WiFi.changeBaudRate(921600);

After this you can proceed to communicate with the device as normal.

Sending and AT command

After the modem has been initialized and it has reported that it is ready you can now send a command to it. Here’s an example on how a simple command can be sent.

Serial2.println("ATE0");

This command simply tells the modem not to repeat everything back that you send to it. If you want to enable this again you would simply send the following command:

Serial2.println("ATE1");

Pin assignments

Pins are assigned as described in the picture below. When working in an Arduino environment (or Platform IO) use the blue pins when writing your code. When working with Micropython use the orange marked pin assignments. For circuitpython we support both notations, just make you don’t mix and match cause it will confuse you in the end =)

Pin description

Power pins are specifically for powering the Challenger in order to make it do anything. The normal use case is that you will power the unit from the USB port, in which case you can also upload and debug your code for the system. But this is not the only way to power the Challenger. You can also connect an external power source such as a LiPo battery or any other type of +5V to the PWR pin. With this pin connected it will supply the unit as soon as you remove the USB cable.

There is also the possibility to power the unit from a 5V power source via the USB power pin. If you know you are going to plug in the USB cable at the same time, make sure you tie a 100ohm resistor in series with your external 5V supply. This will eliminate excessive current draw from/to the device. Finally you can also provide the unit directly with 3.3V to the 3.3V pin. In this case you must pull the EN pin low to disable the internal LDO. Note that when pulling the EN pin low the battery function is completely disabled.

External control pins

There are two control pins available on the board, RESET and EN. Pulling the reset line low will reset the system and restart the applikation. It is equivalent to pressing the reset button on the board. The EN pin is used to disable the internal LDO (Low Dropout Regulator) in order to put the entire board in a low power state. This pin can also be used when an external 3.3V supply is used to power the unit.

Analog and digital IO pins

The rest of the pins are analog and/or digital IO pins that can be used for whatever purpose you need. A number of different hardware peripherals are available. The RP2040 datasheet is an excellent source for detailed information on this.

Connection between MCU and ESP8285 WiFi controller.

The board uses the second UART (UART 1) of the MCU to connect to the ESP8285 as well as two GPIO pins that allows the RP2040 to reset and put the ESP8285 in flash mode. The pins used are as follows.

  • GPIO4 acts as UART1 TXD
  • GPIO5 acts as UART1 RXD
  • GPIO19 is connected to ESP8285 reset and is active low (PIN_ESP8285_RST in the arduino IDE).
  • GPIO13 Is connected to the mode pin of the ESP8285. If it is pulled low at the same time the reset signal is going high the chip will enter flash mode (PIN_ESP8285_MODE in the arduino IDE).

Main Processor

  • Raspberry Pi Pico Dual Core Cortex-M0 @ 133MHz
  • 8 MByte FLASH Memory.
  • 264 KByte SRAM Memory.
  • 1 Hardware I2C channel.
  • 1 Hardware SPI channel.
  • 1 Hardware UART for the user (Serial1).
  • 1 Hardware UART connected to the network processor (Serial2 @ 1Mbit/s)
  • 12 Bit ADC.

Network Processor

  • ESP8285 with internal 1MByte FLASH Memory
  • WiFi (2.4GHz)
  • Espressif AT interpreter
  • Communicates with 921600 bits/s

Board functions

  • Neopixel LED
  • USB Type C connector

Add relevant documents in list form

Reviews

There are no reviews yet.

Be the first to review “Challenger NB RP2040 WiFi”