---
title: "Using Two Chips Simultaneously"
url: "https://maker.wiznet.io/forum/15669"
markdown_url: "https://maker.wiznet.io/forum/15669/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Technowaga"
created: "2025-04-02T22:09:18+09:00"
last_activity: "2025-04-15T11:07:50+09:00"
language: "en"
views: 9
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Using Two Chips Simultaneously

## Question

Asked by Technowaga on 2025-04-02 in Ethernet Chips.

I have two W5500s with different SPIs but on the same host. seems ioLibrary 4.0 does not support instantiation , how can I use two chips independently?

## Replies

### Reply 1 by TheoIm, 2025-04-15

Hi,

There is an STM32 example that demonstrates how to use **two W5100S chips with a single MCU**. You can refer to the maker site link for detailed implementation.

##### [**1 MCU, 2 WIZnet Chips: Dual SPI Networking on STM32**](https://maker.wiznet.io/TheoIm/projects/1%2Dmcu%2D2%2Dwiznet%2Dchips%2Ddual%2Dspi%2Dnetworking%2Don%2Dstm32/)

The key difference between the W5100S and W5500 is the **number of available sockets**, which must be considered in your implementation. The setup itself isn't complex. You can control each chip individually using a **dedicated Chip Select (CS) pin**, which allows you to operate both chips using **a single shared set of functions** instead of separate ones.

However, you must account for **global variables that are socket-number dependent**. For example, in `iolibrary/Ethernet/socket.c`, you'll find definitions like:

```c
static uint16_t sock_io_mode = 0;
static uint16_t sock_is_sending = 0;
static datasize_t sock_remained_size[_WIZCHIP_SOCK_NUM_] = {0, 0, ...};
static uint8_t sock_pack_info[_WIZCHIP_SOCK_NUM_] = {0, 0, ...};
```

The code snippet I referred to is located in the **WIZnet ioLibrary at **`**iolibrary/Ethernet/socket.c**`.

These variables operate **independently per socket**, either bit-wise or as arrays. Therefore, you must ensure that they are **allocated to cover the total number of sockets used across all connected chips**.

For instance, when using **two W5500 chips**, you'll have **16 total sockets**, so these variables need to be expanded accordingly. The example code already reflects this, so you can use it as a reference during implementation.

---

Source: https://maker.wiznet.io/forum/15669
