---
title: "How to Build an Industrial CAN-to-Ethernet Controller with WIZnet W5500 on STM32F105?"
url: "https://maker.wiznet.io/gavinchang/projects/how-to-build-an-industrial-can-to-ethernet-controller-with-wiznet-w5500-on-stm32f105/"
markdown_url: "https://maker.wiznet.io/gavinchang/projects/how-to-build-an-industrial-can-to-ethernet-controller-with-wiznet-w5500-on-stm32f105/md"
type: "UCC: User Created Content"
author: "庞少东"
author_url: "https://blog.csdn.net/weixin_28256233/article/details/165633462?ops_request_misc=elastic_search_misc&request_id=4e3b880ef6acd493d41cbf266a65c252&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~ElasticSearch~search_v2-1-165633462-null-null.142^v102^pc_search_result_base4&utm_term=w5500%20CAN&spm=1018.2226.3001.4187"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "庞少东"
original_url: "https://blog.csdn.net/weixin_28256233/article/details/165633462?ops_request_misc=elastic_search_misc&request_id=4e3b880ef6acd493d41cbf266a65c252&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~ElasticSearch~search_v2-1-165633462-null-null.142^v102^pc_search_result_base4&utm_term=w5500%20CAN&spm=1018.2226.3001.4187"
published: "2026-11-19"
language: "en"
likes: 0
views: 7
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to Build an Industrial CAN-to-Ethernet Controller with WIZnet W5500 on STM32F105?

> The STM32F105-W5500-CAN-232-485 project describes a multi-interface industrial communication controller combining an STM32F105 microcontroller,

Original author: 庞少东 (source: https://blog.csdn.net/weixin_28256233/article/details/165633462?ops_request_misc=elastic_search_misc&request_id=4e3b880ef6acd493d41cbf266a65c252&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~ElasticSearch~search_v2-1-165633462-null-null.142^v102^pc_search_result_base4&utm_term=w5500%20CAN&spm=1018.2226.3001.4187)

## Article

## **How to Build an Industrial CAN-to-Ethernet Controller with WIZnet W5500 on STM32F105?**

### **1. Summary**

The STM32F105-W5500-CAN-232-485 project describes a multi-interface industrial communication controller combining an STM32F105 microcontroller, WIZnet W5500 Ethernet controller, dual CAN interfaces, RS232, and RS485. The W5500 provides hardware TCP/IP processing through SPI, eliminating the need for the MCU to run a full software TCP/IP stack. The design is relevant to commercial industrial gateways, distributed controllers, and data acquisition equipment that must communicate across CAN, serial, and Ethernet networks.

### **2. What the Project Does**

Industrial communication equipment often needs several interfaces simultaneously. A controller might collect motor-drive information over CAN, communicate with legacy instrumentation through RS485, support local maintenance through RS232, and deliver operating data to a supervisory computer over Ethernet.

The CSDN article describes a hardware platform designed for this type of integration, rather than a standalone CAN-to-Ethernet converter.

Its primary controller is the STM32F105R, a 72 MHz Arm Cortex-M3 microcontroller with two integrated CAN controllers. The hardware uses W5500 for Ethernet, external CAN transceivers for differential bus communication, and UART transceivers for RS232 and RS485.

Communication architecture described in the article

#### **STM32F105R**

72 MHz Cortex-M3 · Two CAN controllers · SPI · USART

**SPI → W5500**

Ethernet TCP/UDP

HR911105A RJ45

**CAN1 / CAN2**

CAN transceivers

Industrial CAN buses

**USART2**

RS232 transceiver

Local service interface

**USART3**

RS485 transceiver

Field device network

Functional connections are based on the original article. Actual MCU pin assignments and board net connections require confirmation against the Altium schematics.

The article describes a two-board structure: a 35 × 21 mm controller board and a 93 × 61 mm baseboard, both using two-layer PCB construction. The associated downloadable package is described as containing 226 files, approximately 3.44 MB, including Altium Designer schematics, PCB layouts, C firmware sources, header files, and supporting documentation.

The author states that the design has been fabricated and used in a real project. However, the complete project archive was not supplied with the article text, so the physical implementation and production validation cannot be independently confirmed.

For commercial applications, the design offers a useful reference for building an industrial communication concentrator that collects CAN data, exchanges commands over Ethernet, and maintains compatibility with serial field equipment.

### **3. Where WIZnet Fits**

[products — ページ　263 — スイッチサイエンス](https://images.openai.com/static-rsc-4/BjeQ17HhDcBHOGaikSB14SK_Mdriux2OP6U97xQOKwQKDbSIgnyy_84XK02L9ZBETlXHh7fqAuUxiYyg4Gy2R_U_Q_8nuRM4hv2Mrk6ctpYfC_Lt--0LyFVHrBFoRd5ytVKfLiH-gNaQ0fNWBCeiyST3QeMr72p6AabuLjLmpro?purpose=inline)

**WIZnet W5500**

The W5500 is the Ethernet communication controller in this design. It communicates with STM32F105 over SPI and performs TCP/IP networking in hardware. This avoids running an lwIP-based TCP/IP implementation on the host MCU for the W5500 interface.

The W5500 incorporates a 10/100 Mbps Ethernet MAC and PHY, eight independent hardware sockets, and 32 KB of internal socket memory divided into 16 KB for transmission and 16 KB for reception. Its SPI interface supports modes 0 and 3.

WIZnet

#### **Why this matters for STM32F105**

The STM32F105 must manage CAN receive queues, serial interrupts, protocol processing, and supervisory control functions. Running these alongside a complete software networking stack would increase firmware complexity and resource demand.

The W5500 moves TCP/IP processing into dedicated silicon, while the MCU remains responsible for opening sockets, exchanging application payloads, and converting communication formats.

The gateway can therefore separate three major tasks:

**CAN acquisition:** Capture frames from CAN1 and CAN2, including identifiers, data, and error conditions.

**Protocol conversion:** Package CAN data into a defined TCP or UDP message structure and validate incoming commands.

**Ethernet transport:** Use W5500 hardware sockets to communicate with servers, supervisory systems, or remote clients.

The original article suggests a TCP server for command communication and a UDP socket for device discovery or reporting. These are described as possible gateway configurations, not as verified running features of the supplied firmware.

#### **Hardware connections**

The article provides the following example STM32F105-to-W5500 wiring:

| W5500 signal | STM32F105 pin | Function |
| --- | --- | --- |
| SCS | PA4 | SPI1 chip select |
| SCLK | PA5 | SPI1 clock |
| MISO | PA6 | SPI1 data into MCU |
| MOSI | PA7 | SPI1 data from MCU |
| INTn | PB0 | Ethernet interrupt |
| RSTn | PB1 | Hardware reset |

These are source-described wiring assignments, not independently verified connections from the actual schematic.

The article also identifies the HR911105A integrated-magnetics RJ45 connector, a 25 MHz clock source for the W5500, and an external reset circuit.

On the CAN side, the STM32F105 provides the CAN controllers, while external transceivers such as SN65HVD230 translate logic-level CAN signals to differential CAN_H and CAN_L signaling. The article discusses 120 Ω termination at the physical ends of a CAN bus, along with transient protection and optional isolation for industrial wiring.

These arrangements make the W5500 part of a larger industrial interface system. It handles Ethernet, but not CAN arbitration, CAN physical signaling, or the application-level conversion between CAN frames and Ethernet messages.

### **4. Implementation Notes**

The original article includes W5500 register-access code, CAN initialization settings, and RS485 transmission logic. These provide insight into the proposed firmware structure, although the full downloadable source archive is unavailable.

#### **W5500 SPI register access**

The article presents the following code inside `w5500_read_reg()`:

Original article — `w5500_read_reg()` excerpt; source filename unspecified

```plaintext
buf[0] = (uint8_t)(addr >> 8);
buf[1] = (uint8_t)(addr & 0xFF);
buf[2] = (block << 4) | (rwb << 2) | 0x01;
SPI_CS_LOW();
HAL_SPI_Transmit(&hspi1, buf, 3, 100);
HAL_SPI_Receive(&hspi1, &data, 1, 100);
SPI_CS_HIGH();
```

The function constructs a W5500 SPI transaction containing an address phase, control phase, and data phase. The chip-select signal must remain asserted throughout the transaction.

The implementation is important because SPI register access forms the foundation of Ethernet initialization, socket configuration, and packet transfer.

**A technical correction is necessary before reusing this code.** The W5500 control byte uses five block-select bits in positions 7:3, a read/write bit at position 2, and two operation-mode bits at positions 1:0. The article's `(block << 4)` construction does not match that layout, and the block-selection and operation-mode descriptions contain inconsistencies. The register read/write operations should be checked against the official W5500 datasheet or replaced with WIZnet ioLibrary functions.

docs.wiznet.io+1

#### **CAN controller initialization**

The article provides STM32 HAL configuration for CAN1, including the following settings.

Original article — CAN initialization excerpt; source filename unspecified

```plaintext
hcan1.Init.Prescaler = 3;
hcan1.Init.Mode = CAN_MODE_NORMAL;
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan1.Init.TimeSeg1 = CAN_BS1_6TQ;
hcan1.Init.TimeSeg2 = CAN_BS2_5TQ;
hcan1.Init.AutoBusOff = ENABLE;
```

The code configures normal CAN operation, bit timing, and automatic bus-off management.

CAN timing is especially important in commercial gateway equipment because incompatible bit rates and sampling points result in communication errors regardless of Ethernet performance.

The original article associates its timing example with a 500 kbps CAN bus, but the calculation is inconsistent. With a 36 MHz peripheral clock, a HAL prescaler of 3, and 12 time quanta per bit, the resulting bitrate is:

\[ \frac{36\,000\,000}{3(1+6+5)} =1\,000\,000\ \text{bit/s} \]

The article also gives a 750 kbps intermediate calculation. Neither matches the stated 500 kbps target. Actual timing settings must be recalculated for the selected clock and CAN network before deployment.

#### **Ethernet and CAN integration**

The proposed runtime structure can be divided into three independent activities: CAN reception, application protocol processing, and W5500 socket servicing.

CAN frames should enter an MCU-managed receive queue before network transmission. This prevents TCP connection delays or Ethernet link interruptions from directly blocking CAN interrupt handling.

For a commercial device, the CAN-to-Ethernet application protocol must specify the CAN channel, standard or extended identifier, payload length, payload bytes, and any timestamp or error metadata. TCP stream framing or UDP datagram structure must also be defined explicitly.

The original article does not provide a verified complete CAN-to-Ethernet message-conversion routine. Consequently, its exact transport protocol and end-to-end behavior cannot be established from the available material.

#### **W5500 versus ENC28J60 for this board**

The Microchip ENC28J60 is a relevant alternative because both devices connect to the STM32F105 through SPI, but they divide network-processing responsibilities differently.

| Design criterion | W5500 | ENC28J60 |
| --- | --- | --- |
| Ethernet capability | 10/100 Mbps | 10 Mbps |
| TCP/IP processing | Hardware offload | MCU software stack |
| Internal network memory | 32 KB | 8 KB |
| Hardware TCP/UDP sockets | 8 | None |
| MCU software requirements | Socket API and application protocol | Ethernet driver and TCP/IP stack |
| Fit for this gateway | Reduced MCU networking workload | More flexible host-managed networking |

The ENC28J60 integrates Ethernet MAC/PHY functionality and an 8 KB packet buffer, but does not implement the W5500's hardware TCP/IP socket engine.

microchip.com+1

For the described STM32F105 board, the W5500 reduces the need to maintain a host TCP/IP stack while CAN and serial communication operate concurrently.

ENC28J60 remains an alternative if the software networking stack is already available and the additional firmware integration is acceptable. A final commercial selection should also account for component pricing, availability, protocol requirements, security architecture, and measured system performance.

### **5. Practical Tips / PitfallsVerify SPI timing and control-byte encoding.** The source's W5500 register-access example contains inconsistencies. Validate reads and writes against known registers before implementing network sockets.

**Check CAN termination and transceiver voltage.** Use 120 Ω termination at the bus endpoints, select transceivers compatible with MCU voltage levels, and account for cable length and common-mode requirements.

**Recalculate CAN timing.** The article's bitrate example contains errors. Confirm the APB clock, prescaler, sample point, and actual bitrate with a CAN analyzer.

**Allocate W5500 socket memory deliberately.** The device provides 16 KB each for TX and RX. TCP reporting, command reception, and UDP discovery may require different buffer allocations.

**Review PCB signal integrity.** The article describes a two-layer implementation but also recommends four layers for improved grounding and routing. Final stackup, Ethernet impedance, magnetics layout, and EMC behavior require board-level validation.

**Implement fault recovery.** Monitor Ethernet link state, TCP timeouts, CAN bus-off conditions, and queue overflow. Watchdog resets must leave external equipment in a defined safe state.

**Validate commercial operating conditions.** Perform sustained simultaneous CAN, Ethernet, and serial communication tests, including power cycling, surge/ESD assessment, electrical noise exposure, and network disconnection.

### **6. FAQQ1. Why is the W5500 suitable for an STM32F105 industrial CAN gateway?**

The W5500 performs TCP/IP processing in hardware, reducing the software networking workload on the STM32F105. This allows MCU resources to be concentrated on dual CAN reception, serial communication, protocol conversion, and application logic. Its eight hardware sockets and dedicated TX/RX buffers are useful when the controller must maintain multiple network functions simultaneously.

**Q2. How does the W5500 connect to STM32F105 in the original design?**

The article specifies SPI1 connections using PA4 for chip select, PA5 for clock, PA6 for MISO, and PA7 for MOSI. PB0 is assigned to the W5500 interrupt signal and PB1 to reset. The Ethernet interface uses external magnetics and an RJ45 connector, with HR911105A identified in the hardware description. These assignments require confirmation against the original schematic.

**Q3. What role does the W5500 play in CAN-to-Ethernet communication?**

The W5500 transports network messages using TCP or UDP. The STM32F105 receives CAN frames through its integrated CAN peripherals, processes their identifiers and payloads, and prepares network data for transmission. The W5500 then handles the corresponding Ethernet communication. CAN-to-TCP/UDP message mapping remains the responsibility of the MCU firmware.

**Q4. Can beginners reproduce the STM32F105-W5500-CAN design?**

Developers familiar with STM32 HAL, SPI, CAN bit timing, UART, and basic TCP/IP can use the article as an architectural reference. Reproducing the complete board requires additional PCB, power-supply, and signal-integrity knowledge. The provided code excerpts also need correction and testing, so they should not be treated as a ready-to-flash commercial firmware package.

**Q5. Why choose W5500 instead of ENC28J60 for this commercial controller?**

The principal difference is hardware TCP/IP offloading. The W5500 implements TCP/UDP socket processing internally, whereas the ENC28J60 requires the MCU to manage the TCP/IP software stack. In a controller simultaneously servicing CAN and serial interfaces, the W5500 can reduce firmware complexity and networking overhead. ENC28J60 may still be suitable where 10 Mbps Ethernet is sufficient and a maintained software TCP/IP implementation is available.

### **7. SourceOriginal article:** [STM32F105-W5500-CAN-232-485 Industrial Communication Board — CSDN](https://blog.csdn.net/weixin_28256233/article/details/165633462?utm_source=chatgpt.com)

**Original author:** 庞少东 (CSDN: `weixin_28256233`)

**License:** Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0), as stated in the article's copyright notice.

**Technical documentation:**

[WIZnet W5500 Datasheet](https://docs.wiznet.io/img/products/w5500/w5500_ds_v106e_141230.pdf?utm_source=chatgpt.com)

[WIZnet ioLibrary Driver](https://github.com/Wiznet/ioLibrary_Driver?utm_source=chatgpt.com)

[Microchip ENC28J60 Product Documentation](https://www.microchip.com/en-us/product/enc28j60?utm_source=chatgpt.com)

The source provides detailed hardware and firmware examples, but the underlying Altium projects and complete firmware archive have not been inspected. The article's SPI and CAN timing examples contain issues that must be resolved before implementation.

### **8. Tags**

#W5500 #STM32F105 #WIZnet #CANBus #CANtoEthernet #IndustrialEthernet #IndustrialIoT #RS485 #RS232 #ENC28J60 #HardwareTCPIP #EmbeddedSystems

### **4. 구현 방법**

원문에는 W5500 SPI 레지스터 접근 코드, CAN 초기화 코드, RS485 송신 코드가 포함되어 있다.

전체 펌웨어 프로젝트 파일은 제공되지 않았지만, 공개된 코드로 주요 설계 의도를 파악할 수 있다.

#### **W5500 SPI 레지스터 접근**

원문 `w5500_read_reg()` 함수 발췌 — 실제 소스 파일명 미확인

```plaintext
buf[0] = (uint8_t)(addr >> 8);
buf[1] = (uint8_t)(addr & 0xFF);
buf[2] = (block << 4) | (rwb << 2) | 0x01;
SPI_CS_LOW();
HAL_SPI_Transmit(&hspi1, buf, 3, 100);
HAL_SPI_Receive(&hspi1, &data, 1, 100);
SPI_CS_HIGH();
```

이 코드는 W5500 레지스터 읽기 동작을 위해 SPI 트랜잭션을 구성하는 부분이다.

W5500은 SPI 통신에서 주소, 제어 바이트, 데이터 순서로 정보를 전송한다. MCU는 이를 이용해 네트워크 설정 레지스터와 소켓 관련 레지스터에 접근한다.

여기서 주의할 점은 원문 코드의 제어 바이트 구성이다.

W5500 제어 바이트는 블록 선택 필드, 읽기/쓰기 비트, 동작 모드 비트로 구성된다. 원문에서 사용한 `(block << 4)` 연산은 공식 제어 바이트의 필드 배치와 일치하지 않을 수 있다.

따라서 실제 펌웨어에서는 W5500 데이터시트와 비교해 SPI 명령을 검증하거나, 공식 [WIZnet ioLibrary Driver](https://github.com/Wiznet/ioLibrary_Driver?utm_source=chatgpt.com)를 활용하는 편이 안전하다.

#### **CAN 초기화 및 비트레이트 설정**

원문 CAN 초기화 코드 발췌 — 실제 소스 파일명 미확인

```plaintext
hcan1.Init.Prescaler = 3;
hcan1.Init.Mode = CAN_MODE_NORMAL;
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan1.Init.TimeSeg1 = CAN_BS1_6TQ;
hcan1.Init.TimeSeg2 = CAN_BS2_5TQ;
hcan1.Init.AutoBusOff = ENABLE;
```

이 설정은 STM32F105의 CAN 컨트롤러를 일반 통신 모드로 초기화하고, CAN 비트 타이밍과 Bus-Off 관련 동작을 구성한다.

CAN 통신에서는 모든 노드의 비트레이트가 일치해야 한다. 설정값이 맞지 않으면 이더넷 연결이 정상이어도 CAN 프레임을 수신할 수 없다.

원문에서는 500 kbps CAN 통신의 예시로 이 값을 소개하지만, 실제 계산에는 불일치가 존재한다.

STM32 HAL에서 Prescaler 값이 3이고, APB1 클록이 36 MHz이며, 한 비트가 12개의 타임 퀀텀으로 구성된다면:

\[ \text{CAN Bitrate}=\frac{36\,000\,000}{3(1+6+5)} \]

\[ =1\,000\,000\ \text{bps} \]

따라서 이 설정은 해당 클록 조건에서 500 kbps가 아니라 1 Mbps에 해당한다.

상용 장비에 적용할 때는 실제 MCU 클록 설정과 CAN 네트워크 요구사항을 기준으로 비트레이트 및 샘플링 포인트를 다시 계산해야 한다.

#### **CAN-to-Ethernet 데이터 처리 구조**

이 프로젝트를 CAN-to-Ethernet 게이트웨이로 활용하려면 펌웨어에서 다음 세 가지 처리를 구분하는 것이 적절하다.

**1. CAN 프레임 수신**

CAN1/CAN2 인터럽트 및 수신 FIFO

**2. STM32F105 데이터 처리**

프레임 필터링 · 큐 관리 · 메시지 변환

**3. W5500 TCP/UDP 전송**

SPI 레지스터 및 소켓을 통해 데이터 송신

CAN 수신 인터럽트에서는 가능한 한 빠르게 프레임을 MCU의 수신 큐에 저장해야 한다. 이후 별도의 처리 루틴에서 CAN 데이터를 네트워크 메시지로 변환하고 W5500으로 전달하는 방식이 유리하다.

이렇게 분리하면 TCP 재접속이나 네트워크 일시 장애가 발생해도 CAN 수신 처리가 장시간 차단되는 문제를 줄일 수 있다.

다만 원문에는 완전한 CAN-to-Ethernet 메시지 변환 함수가 포함되어 있지 않다. 따라서 실제 사용한 메시지 포맷과 통신 프로토콜까지 확인된 것은 아니다.

### **5. 실제 구현 시 주의사항SPI 제어 바이트를 검증한다.** 원문에는 W5500 SPI 제어 비트 설명과 코드 사이에 불일치가 있다. 소켓 통신을 구현하기 전에 레지스터 읽기/쓰기부터 검증해야 한다.

**CAN 비트레이트를 다시 계산한다.** APB1 클록, Prescaler, 시간 세그먼트 및 샘플링 포인트를 확인하고 CAN 분석기로 측정해야 한다.

**CAN 종단저항을 올바르게 구성한다.** 120 Ω 종단저항은 일반적으로 버스 양 끝에만 배치한다. 모든 노드에 종단저항을 연결하면 정상 통신에 문제가 발생할 수 있다.

**W5500 소켓 버퍼를 적절히 분배한다.** TCP 명령 수신, CAN 데이터 전송, UDP 장치 검색 등 통신 목적에 따라 TX/RX 버퍼 용량을 조정해야 한다.

**PCB 신호 무결성을 검토한다.** 원문에는 2층 PCB 설계가 소개되지만, 실제 상용 제품에서는 이더넷 차동 임피던스, 접지, 전원 노이즈, EMI 등을 별도로 검토해야 한다.

**통신 장애 복구 기능을 구현한다.** 이더넷 링크 해제, TCP 연결 종료, CAN Bus-Off, 수신 큐 오버플로, 시스템 리셋 상황에 대한 복구 절차가 필요하다.

**산업 환경 테스트를 수행한다.** CAN, TCP/UDP, RS232, RS485를 동시에 동작시키면서 장시간 안정성, 전원 변동, ESD, 서지 및 통신 장애를 검증해야 한다.

### **6. FAQQ1. STM32F105 기반 CAN 게이트웨이에서 W5500을 사용하는 이유는 무엇인가요?**

W5500은 TCP/IP 처리를 하드웨어에서 수행하므로 STM32F105가 별도의 소프트웨어 TCP/IP 스택을 실행할 필요가 없다. STM32F105는 듀얼 CAN과 UART 통신도 동시에 처리해야 하므로, W5500을 이용하면 네트워크 프로토콜 처리 부담과 펌웨어 복잡도를 줄일 수 있다. 또한 8개의 하드웨어 소켓을 활용해 여러 네트워크 기능을 구성할 수 있다.

**Q2. W5500은 STM32F105와 어떻게 연결하나요?**

원문에서는 STM32F105의 SPI1을 사용한다. PA4는 칩 선택, PA5는 SPI 클록, PA6는 MISO, PA7은 MOSI에 연결하며, PB0과 PB1은 각각 인터럽트와 리셋 신호에 사용한다. W5500의 이더넷 물리 인터페이스는 마그네틱스와 RJ45 커넥터를 통해 외부 네트워크에 연결한다.

**Q3. CAN-to-Ethernet 게이트웨이에서 W5500은 구체적으로 어떤 역할을 하나요?**

STM32F105의 CAN 컨트롤러가 CAN 프레임을 수신하면 MCU 펌웨어가 해당 데이터를 TCP 또는 UDP 메시지로 변환한다. W5500은 이 메시지를 이더넷 네트워크로 전송하는 역할을 담당한다. 반대로 서버에서 수신한 명령을 MCU가 해석해 CAN 메시지로 전송하는 양방향 게이트웨이도 구성할 수 있다. 단, W5500 자체가 CAN 프로토콜을 처리하지는 않는다.

**Q4. 초보 개발자도 STM32F105와 W5500을 이용해 CAN-to-Ethernet 게이트웨이를 구현할 수 있나요?**

STM32 HAL, SPI, CAN 비트 타이밍, UART 및 TCP/IP에 대한 기초 지식이 있다면 단계적으로 구현할 수 있다. 우선 W5500 이더넷 통신과 CAN 송수신을 각각 검증한 뒤, 두 기능을 연결하는 애플리케이션을 작성하는 방식이 적절하다. 다만 상용 제품 수준으로 개발하려면 PCB 설계, 통신 오류 복구, 절연 및 EMC 검증 등이 추가로 필요하다.

**Q5. W5500과 ENC28J60 중 산업용 CAN 게이트웨이에 더 적합한 제품은 무엇인가요?**

W5500은 하드웨어 TCP/IP 스택을 제공하고 10/100 Mbps 이더넷 및 8개 소켓을 지원한다. ENC28J60은 10 Mbps 이더넷 MAC/PHY를 제공하지만 TCP/IP 프로토콜 처리는 MCU 소프트웨어에 의존한다. CAN과 UART를 동시에 처리하는 STM32F105 시스템에서는 W5500이 네트워크 처리 부담과 펌웨어 복잡도를 줄이는 데 유리할 수 있다. 반면 기존 소프트웨어 TCP/IP 스택을 유지해야 하거나 네트워크 프로토콜을 직접 제어해야 한다면 ENC28J60도 고려할 수 있다.

### **7. 원문 및 참고 자료원문:** [STM32F105-W5500-CAN-232-485 산업용 통신 제어 보드 — CSDN](https://blog.csdn.net/weixin_28256233/article/details/165633462?utm_source=chatgpt.com)

**원문 작성자:** 庞少东 (CSDN 계정: `weixin_28256233`)

**라이선스:** Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). 원문에 명시된 라이선스로, 저작자 표시 및 동일조건변경허락 조건을 따른다.

**기술 참고 자료:**

[WIZnet W5500 공식 제품 문서](https://docs.wiznet.io/Product/Chip/Ethernet/W5500?utm_source=chatgpt.com)

[WIZnet ioLibrary Driver](https://github.com/Wiznet/ioLibrary_Driver?utm_source=chatgpt.com)

[Microchip ENC28J60 제품 문서](https://www.microchip.com/en-us/product/enc28j60?utm_source=chatgpt.com)

이 프로젝트는 STM32F105와 W5500을 활용한 산업용 다중 인터페이스 통신 제어 보드의 설계 사례다. 원문에서 하드웨어 구성과 주요 펌웨어 예시를 확인할 수 있지만, 전체 Altium 설계 파일과 완전한 펌웨어는 직접 검토되지 않았다.

특히 W5500 SPI 제어 바이트와 CAN 비트레이트 계산에 대한 원문 설명에는 수정이 필요한 부분이 있으므로, 실제 상용 제품에 적용하기 전에 공식 데이터시트와 개발 환경을 기준으로 검증해야 한다.

### **8. 태그**

#W5500 #STM32F105 #WIZnet #CANBus #CANtoEthernet #IndustrialEthernet #IndustrialIoT #RS485 #RS232 #ENC28J60 #HardwareTCPIP #EmbeddedSystems

---

Source: https://maker.wiznet.io/gavinchang/projects/how-to-build-an-industrial-can-to-ethernet-controller-with-wiznet-w5500-on-stm32f105/
