Raspberry Pi released PICO board with their first Microcontroller in early 2020. Its a very powerful platform with inhouse built microcontroller having dual ARM core running at max. 133MHz.
It has a lot of peripherals which could be utilized to create amazing projects and products.
Once you have a powerful platform whether it is a microcontroller or a processor, its always interesting to see how we can add high end interfaces like SD Card, Displays (TFT, HDMI), Ethernet, etc.
In this article we will see how we can add Ethernet capability to Raspberry Pi PICO platform.
Raspberry Pi PICO uses RP2040 microcontroller and it doesn’t have inbuilt ethernet interface like MII or RMII so how one can add ethernet?
Well there two possible ways.
External Ethernet PHY Chip
Raspberry PICO RP2040 has a very unique logic block called programmable IO which could be used to implement a lot of peripherals which are not available natively and we can use the same PIO to interface Ethernet PHY like LAN7820.
Here is an article which shows how to add ethernet on Raspberry Pi PICO with step by step instructions.
You will need:
- LAN7820 breakout board
- ethernet cable
- and jumper wires
to connect breakout board with your Raspberry PI PICO board.
External SPI to Ethernet Chip
Raspberry Pi PICO has SPI interface and there are a lot of SPI to Ethernet chips and their breakout boards available in the market which can be used to add the ethernet interface.
For examples two of the most popular ones are:
- ENC28J60 from Microchip
- W5500/W5100 from Wiznet
and breakout board using above chips are widely available in the market.
To further reduce the effort, here is another solution:
Wiznet’s Raspberry Pi PICO Clone
Wiznet has recently developed a Raspberry PI PICO board which is nothing but Raspberry PI PICO + Ethernet on the same board and gives access to all pins which are available on Raspberry PI PICO Board.
- RP2040 microcontroller with 2MByte Flash
- Dual-core cortex M0+ at up to 133MHz
- 264kByte multi-bank high performance SRAM
- External Quad-SPI Flash with eXecute In Place (XIP)
- High performance full-crossbar bus fabric
- 30 multi-function General Purpose IO (4 can be used for ADC)
- 1.8-3.3V IO Voltage (NOTE. Pico IO voltage is fixed at 3.3V)
- 12-bit 500ksps Analogue to Digital Converter (ADC)
- Various digital peripherals
- 2 × UART, 2 × I2C, 2 × SPI, 16 × PWM channels
- 1 × Timer with 4 alarms, 1 × Real Time Counter
- 2 × Programmable IO (PIO) blocks, 8 state machines total
- Flexible, user-programmable high-speed IO
- Includes W5100S
- Supports Hardwired Internet Protocols: TCP, UDP, WOL over UDP, ICMP, IGMPv1/v2, IPv4, ARP, PPPoE
- Supports 4 Independent Hardware SOCKETs simultaneously
- Internal 16 Kbytes Memory for TX/ RX Buffers
- SPI Interface
- Micro-USB B port for power and data (and for reprogramming the Flash)
- 40 pin 21×51 ‘DIP’ style 1mm thick PCB with 0.1″ through-hole pins also with edge castellations
- 3-pin ARM Serial Wire Debug (SWD) port
- 10 / 100 Ethernet PHY embedded
- Supports Auto Negotiation
- Full / Half Duplex
- 10 / 100 Based
- Built-in RJ45(RB1-125BAG1A)
- Built-in LDO (LM8805SF5-33V)
Wiznet Raspberry PI PICO Clone Pinout
It is very easy to interface W5100S SPI to Ethernet Chip, you only need 4 wire SPI pins i.e CS, MOSI, MISO and Clock and Interrupt pin and Reset pin which gives you extra control to implement the interface efficiently.
|I||GPIO16||Connected to MISO on W5100S|
|O||GPIO17||Connected to CSn on W5100S|
|O||GPIO18||Connected to SCLK on W5100S|
|O||GPIO19||Connected to MOSI on W5100S|
|O||GPIO20||Connected to RSTn on W5100S|
|I||GPIO21||Connected to INTn on W5100S|
The board is available as Open source:
Learn more from Wiznet’s product page
What is the difference in both approach?
The two approaches mentioned above are very different.
In the 1st one where we are using Ethernet PHY chip the whole ethernet stack is implemented on the microcontroller itself.
On the other hand in case of SPI to Ethernet the stack is implement in the chip and user need to only configure the registers to work in particular way and send data and receive data. This makes life easy for a developer where they need to understand the internals of how ethernet works. Other the other hand in both the case an external chip is required for the implementation.
I hope you found this project interesting.
If you like the post, please share it with others. Any suggestions or comments, let me know here.
Read my other articles on embedded systems design.