Wiznet makers

gunn

Published March 13, 2026 ©

66 UCC

0 VAR

0 Contests

0 Followers

0 Following

Original Link

ESP32+W5500以太网硬件设计与MicroPython驱动实现

ESP32+W5500 이더넷 하드웨어 설계 및 MicroPython 드라이버 구현

COMPONENTS
PROJECT DESCRIPTION

This article is a practical technical document covering the **hardware design** and **MicroPython driver implementation** of a wired Ethernet system combining the ESP32 and W5500. The main contents are as follows:

**Hardware Connection Design**: Explains the SPI 6-pin mapping (SCLK/MOSI/MISO/SS/INT/RST), the importance of setting the falling edge interrupt on the INT pin, and the correct usage of RJ45 connectors and network isolation transformers.

**Power Domain Isolation**: Presents a real-world example demonstrating that if digital (VDD) and analog (AVDD) are not separated by separate LDOs, power ripple during ESP32 Wi-Fi/BT operation affects the W5500 PHY, causing the link to disconnect.

** **PCB Layout Constraints**: Detailed design rules are presented, such as SPI trace width (10 mil), PHY differential pair impedance control (100 Ω), and the location of the AGND/DGND single ground connection. A failure case is also shared where neglecting these rules resulted in EMC radiation exceeding 12 dB.

**MicroPython Driver**: It explains that since the W5500 is not officially supported, the driver must be implemented directly using a direct register control method, and that SPI registers must be manipulated directly at the hardware level due to DMA buffer partitioning issues with the `write_readinto()` method.

**Debugging and Production Considerations**: Problems encountered during actual production, such as soldering defects, I²C address conflicts, and spring stress relief, are documented in detail as solutions.

---

## The Role of the W5500 in This Article

In this article, the W5500 is defined as the **Ethernet interface extension chip for the ESP32**. Specifically, it performs three roles.

First, it is the **TCP/IP protocol offload engine**. By handling the entire network stack—including ARP, ICMP, IPv4, UDP, TCP, DHCP, and DNS—with an embedded ASIC, the ESP32 is able to focus solely on its core functions, such as sensor data collection, local algorithms, and UI processing.

Second is the **Ethernet controller with an embedded PHY**. Since the physical layer (PHY) is integrated within the chip, it enables 100Mbps full-duplex wired connections using only an RJ45 connector, without the need for an external PHY chip.

Third is the **SPI-based network bridge**. It connects to the ESP32 solely via an SPI interface and manages packets using an internal 16KB transmit/receive buffer. However, this article particularly emphasizes that the stability of this SPI communication (clock speed, power isolation, PCB layout) becomes a bottleneck for overall network performance.

> Compared to the previously analyzed article on the ESP32-S3, both articles identify the W5500's **hardware TCP/IP offload** as a core value and agree on the conclusion that SPI stability determines overall system reliability.

===

글 요약

이 글은 ESP32와 W5500을 결합한 유선 이더넷 시스템의 하드웨어 설계MicroPython 드라이버 구현을 다루는 실전 기술 문서입니다. 주요 내용은 다음과 같습니다.

하드웨어 연결 설계: SPI 6핀 매핑(SCLK/MOSI/MISO/SS/INT/RST), INT 핀의 하강 에지 인터럽트 설정의 중요성, RJ45 커넥터와 네트워크 절연 변압기의 올바른 사용법을 설명합니다.

전원 도메인 분리: 디지털(VDD)과 아날로그(AVDD)를 별도 LDO로 분리하지 않으면 ESP32의 Wi-Fi/BT 동작 시 전력 리플이 W5500 PHY에 영향을 줘 링크가 끊긴다는 실제 사례를 제시합니다.

PCB 레이아웃 제약: SPI 트레이스 폭(10mil), PHY 차동 쌍 임피던스 제어(100Ω), AGND/DGND 단일 접지 연결 위치 등 세부 설계 규칙을 제시하며, 이를 소홀히 했을 때 EMC 방사가 12dB 초과했던 실패 사례도 공유합니다.

MicroPython 드라이버: W5500이 공식 지원되지 않아 레지스터 직접 제어 방식으로 드라이버를 직접 구현해야 하며, write_readinto() 메서드의 DMA 버퍼 분할 문제로 인해 SPI 레지스터를 하드웨어 수준에서 직접 조작해야 함을 설명합니다.

디버깅 및 양산 고려사항: 납땜 불량, I²C 주소 충돌, 스프링 응력 완화 등 실제 양산에서 겪은 문제와 해결책이 구체적으로 기록되어 있습니다.


이 글에서 W5500의 역할

이 글에서 W5500은 ESP32의 이더넷 인터페이스 확장 칩으로 정의됩니다. 구체적으로는 세 가지 역할을 합니다.

첫째, TCP/IP 프로토콜 오프로드 엔진입니다. ARP, ICMP, IPv4, UDP, TCP, DHCP, DNS 등 전체 네트워크 스택을 내장 ASIC에서 처리하여, ESP32는 센서 데이터 수집·로컬 알고리즘·UI 처리 등 본래 역할에만 집중할 수 있게 합니다.

둘째, PHY 내장형 이더넷 컨트롤러입니다. 물리 계층(PHY)이 칩 내부에 통합되어 있어 외부 PHY 칩 없이 RJ45 커넥터만으로 100Mbps 전이중 유선 연결이 가능합니다.

셋째, SPI 기반 네트워크 브리지입니다. ESP32와 SPI 인터페이스로만 연결되며, 내부 16KB 송수신 버퍼를 통해 패킷을 관리합니다. 단, 이 SPI 통신의 안정성(클럭 속도, 전원 분리, PCB 레이아웃)이 전체 네트워크 성능의 병목이 된다는 점을 이 글은 특히 강조하고 있습니다.

앞서 분석한 ESP32-S3 글과 비교하면, 두 글 모두 W5500의 하드웨어 TCP/IP 오프로드를 핵심 가치로 꼽고 있으며, SPI 안정성이 전체 시스템 신뢰성을 좌우한다는 결론도 일치합니다.

Documents
Comments Write