Wiznet makers

gunn

Published September 13, 2026 ©

109 UCC

6 VAR

0 Contests

0 Followers

0 Following

Original Link

Regarding ESP32 Ethernet Design

Regarding ESP32 Ethernet Design

COMPONENTS
PROJECT DESCRIPTION

1. Summary of URL Content (`[https://devicein.tistory.com/177](https://devicein.tistory.com/177)`)

This document (Part 2 of the ESP32 Ethernet design series) covers the design considerations and pin connection requirements for connecting the ESP32 series MCU to Ethernet at the hardware level.

* When using the ESP32's internal MAC (Direct connection to a PHY chip)
* RMII Interface: Basic pins such as TX_EN, TX0, TX1, RX0, RX1, and CRS_DV are fixed; pin assignments cannot be changed.
* REF_CLK Pin: Can be selected from GPIO0, GPIO16, or GPIO17; however, since GPIO0 is also a bootstrap pin for firmware flashing, the design must incorporate a sufficient delay to prevent accidental entry into flashing mode.
* SMI (MDC/MDIO): Pin assignments can be freely changed.
* Reset Pin: Must be connected to one of the ESP32 GPIO pins for hardware reset during initialization.


* When using an external SPI Ethernet controller (SPI connection)
* An SPI connection is used when there is no internal MAC or when flexible pin assignment is required.
* SPI pins are not fixed and can be configured via firmware.
* Major supported SPI Ethernet controller chips: W5500, DM9051, KSZ8851SNL, ENC28J60, CH390, etc.

 

 

2. Summary of the W5500's Role

The W5500 is an SPI-to-Ethernet controller chip with an embedded hardware TCP/IP stack, developed by WIZnet. * Standalone Ethernet Communication: Enables easy addition of wired Ethernet (LAN) capabilities using only an SPI interface (CLK, MOSI, MISO, CS), even if the MCU lacks an integrated Ethernet MAC or PHY.
* Reduced MCU Load: Handles the hardware TCP/IP protocol stack (TCP, UDP, IPv4, ICMP, ARP, IGMP, PPPoE, etc.) directly within the chip, significantly reducing CPU resource and memory consumption for the main MCU (e.g., ESP32).
* Design Convenience: Operates via SPI pin connections, minimizing GPIO pin usage and simplifying circuit design.

[Q&A]

Q: When implementing Ethernet communication on a microcontroller (MCU) like the ESP32, what are the main reasons for using an external SPI Ethernet controller (such as the W5500) instead of directly connecting an external PHY chip to the built-in MAC?

A:
The primary reasons are pin utilization flexibility and the conservation of MCU resources.

Flexibility in Pin Assignment: When using the ESP32's built-in MAC to connect a PHY chip (via RMII), key communication pins (e.g., GPIO21, 19, 22) are fixed and cannot be changed, and hardware constraints—such as specific requirements for handling GPIO0—arise. In contrast, the W5500 uses an SPI interface, allowing pin assignments to be freely configured in firmware, which offers much greater flexibility in circuit design.

Reduced CPU Load via Hardware TCP/IP Stack: The W5500 features a hardware-implemented TCP/IP protocol stack. Consequently, the MCU does not need to process network protocols in software, leading to a dramatic reduction in CPU and RAM usage. Compatibility with MCUs lacking an integrated MAC: Wired Ethernet functionality can be easily added—using only an SPI connection—even to the latest target chipsets that do not have an internal Ethernet MAC, such as the ESP32-S2/S3 and ESP32-C3/C6.

=========================

 

1. URL 내용 요약 (`[https://devicein.tistory.com/177](https://devicein.tistory.com/177)`)

해당 문서(ESP32 Ethernet 설계 관련 2편)는 ESP32 시리즈 MCU를 하드웨어적으로 이더넷(Ethernet)에 연결할 때 필요한 설계 및 핀 연결 주의사항을 다루고 있습니다.

* ESP32 내부 MAC 사용 시 (PHY 칩 직접 연결)
* RMII 인터페이스: TX_EN, TX0, TX1, RX0, RX1, CRS_DV 등 기본 핀이 고정되어 있어 핀 번호 변경이 불가능합니다.
* REF_CLK 핀: GPIO0, GPIO16, GPIO17 중 선택할 수 있으나, GPIO0은 펌웨어 라이팅 보드 부트스트랩(boot strap) 핀이므로 라이팅 모드로 잘못 진입하지 않도록 충분한 지연(Delay) 설계가 필요합니다.
* SMI (MDC/MDIO): 핀 번호를 자유롭게 변경 가능합니다.
* Reset 핀: 초기화 시 하드웨어 리셋을 위해 ESP32 GPIO 중 하나에 연결해야 합니다.


* 외부 SPI Ethernet 컨트롤러 사용 시 (SPI 연결)
* MAC이 없거나 핀 할당을 유연하게 하려는 경우 SPI 방식으로 연결합니다.
* SPI 핀은 고정되어 있지 않으며 펌웨어에서 조정이 가능합니다.
* 지원되는 주요 SPI 이더넷 컨트롤러 칩: W5500, DM9051, KSZ8851SNL, ENC28J60, CH390 등.

 

 

2. W5500의 역할 요약

W5500은 위즈넷(WIZnet)에서 개발한 하드웨어 TCP/IP 내장 SPI 이더넷 컨트롤러(SPI-to-Ethernet Controller) 칩입니다.

* 독립형 이더넷 통신 제공: MCU에 이더넷 MAC이나 PHY가 없더라도 SPI 인터페이스(CLK, MOSI, MISO, CS)만을 이용해 유선 이더넷(LAN) 통신 기능을 손쉽게 추가할 수 있게 합니다.
* MCU 부하 경감: 하드웨어 TCP/IP 프로토콜 스택(TCP, UDP, IPv4, ICMP, ARP, IGMP, PPPoE 등)을 칩 내부에서 직접 처리하므로, 메인 MCU(ESP32 등)의 CPU 리소스와 메모리 소모를 대폭 줄여줍니다.
* 설계 편의성: SPI 핀 연결만으로 작동하므로 GPIO 핀 사용을 줄이고 회로 설계를 간소화할 수 있습니다.

 

 

[Q&A]

Q: ESP32와 같은 마이크로컨트롤러(MCU)에서 이더넷 통신을 구현할 때, 내장 MAC과 PHY 칩을 직접 연결하는 방식 대신 W5500 같은 외부 SPI 이더넷 컨트롤러를 사용하는 주요 이유는 무엇인가요?

A:
가장 큰 이유는 핀 활용의 유연성과 MCU의 리소스 절감 때문입니다.

핀 배치 및 선택의 자율성: ESP32의 내장 MAC을 이용해 PHY 칩을 연결(RMII 방식)할 때는 주요 통신 핀(GPIO21, 19, 22 등)이 고정되어 있어 변경할 수 없으며, GPIO0 처리 등 하드웨어 제약이 발생합니다. 반면 W5500은 SPI 인터페이스를 사용하므로 핀 번호를 펌웨어에서 자유롭게 지정할 수 있어 회로 설계가 훨씬 유연해집니다.

하드웨어 TCP/IP 스택을 통한 CPU 부하 경감: W5500은 칩 내부에 TCP/IP 프로토콜 스택이 하드웨어로 구현되어 있습니다. 따라서 MCU가 소프트웨어로 네트워크 프로토콜을 처리할 필요가 없어 CPU 및 RAM 메모리 소모를 획기적으로 줄일 수 있습니다.

내장 MAC이 없는 MCU 호환성: ESP32-S2/S3, ESP32-C3/C6 등 내부 이더넷 MAC이 없는 최신 타깃 칩셋에서도 SPI 핀 연결만으로 간단하게 유선 이더넷 기능을 추가할 수 있습니다.

Documents
Comments Write