🛠 Advanced Startup: UEXT-CH390 and Raspberry Pi Pico

Olimex UEXT-CH390: SPI to Ethernet 10/100 Mbps Module for Microcontrollers · avance · Guide technique pour l'intégration du module Ethernet CH390 sur une carte RP2040 via SPI.

Objectives

This tutorial aims to initialize wired 10/100 Mbps Ethernet communication between an RP2040 microcontroller and the UEXT-CH390 module. Unlike beginner approaches, we focus here on precise SPI interface configuration and SRAM buffer optimization to ensure reliable network stability.

Required Materials

Steps

  1. Hardware Verification: Inspect the UEXT-CH390 module. Ensure the pUEXT connector pins (1.0 mm pitch) align with the Pico's SPI pins. The module operates at 3.3V; never connect to 5V.
  2. SPI Connection: If not using a dedicated UEXT connector, connect the Pico's SPI pins to the module. Use the default SPI0 bus for standard software compatibility. Verify polarity and phase for SPI modes 0 or 3, supported up to 72 MHz.
  3. Software Configuration: In your IDE, select the "Raspberry Pi Pico" board. Import the specific CH390 driver library developed for RP2040. Define the CS (Chip Select) pins and MISO/MOSI lines in the code.
  4. Initialization: In the setup() function, call the CH390 initialization routine. The integrated MAC/PHY controller requires a precise reset sequence to load internal registers and activate the 16KB SRAM for packet buffering.
  5. Link Test: Connect an RJ45 Ethernet cable from the module to your router. The link LED should light up. Display the factory-programmed MAC address via the serial port to confirm hardware detection.

Verification

Open the serial monitor at 115200 bauds. You should see a message confirming CH390 initialization and the display of the MAC address. If the message fails, check the 3.3V power supply and SPI connections. Once initialization is successful, attempt a ping to the DHCP-assigned IP address to validate the network layer.

To Go Further

Explore integration with ESPHome for automatic Home Assistant discovery. For maximum performance, study the lwIP driver for the Pico SDK to manage OTA updates and the local web interface directly on the microcontroller.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials