Wiznet W5500 support

@forum-readers, I'm curious and want to learn... I've used the WIZ820io only. What are you using that needs W5500 support? Should I consider that for new designs?

Ok, I realize my question was kind of vague and uninformed. I'll try to answer my own question.

WIZ820io module uses W5200 chipset

W5500 chipset can be found in:
Wiznet: WIZ550io
Adafruit: Ethernet Shield for Arduino - W5500 Chipset
Sparkfun: Arduino Ethernet Shield 2
presumably other Maker sources

I found one person's comment that the W5500 is "far faster" than the W5100.

and from the WIZnet site, features the WIZ550io has that the WIZ820io doesn't:
- Built-in MAC Address (48bit Global Unique ID)
- Auto-Network configuration with default IP address
- No MCU programming for PING check

Additional info and corrections are welcome but I think I get the gist of the differences.
 
W5500's main advantages are lower price and lower power consumption. It's only slightly faster than W5200. Both are a tremendous improvement W5100 with SPI. (but W5100 does perform well with its 8 bit parallel interface)

Wiznet's product page now shows the W5200 chip as "not recommended for new design".

http://www.wiznet.co.kr/product/tcpip-chip/

If you've been using the WIZ820io module, there's good news. They're now making a WIZ850io module that's a direct pin compatible replacement. That's the hardware I've been using for testing the Ethernet library.

http://www.wiznet.co.kr/product-item/wiz850io/

Cheap clones have also appeared on Ebay and Aliexpress. For example:

http://www.ebay.com/itm/USR-ES1-ENC...thernet-Converter-TCP-IP-Module-/201560299414

Even though this item's description says "USR-ES1 ENC28J60 W5500 Chip SPI", it is indeed the Wiznet W5500 chip and does not actually have the Microchip ENC28J20 chip.

From the top side, the clone looks virtually identical to the Wiznet WIZ850io, except for the PCB color and different marking on the RJ45 connector. But if you look at the bottom side, it's definitely not the same PCB design.

wiz850io.jpg
(click for full size)

I have personally tested both boards shown in this photo. Both work fine. I also retested a WIZ820io and WIZ812MJ with the latest library running on Teensy 3.6. All of them work now.
 
The SPI pins are hardcoded in the Ethernet library. Pretty sure you can change them there, but could give problems with compatibility. Search this forum for threads on this. Using the Serial2 pins on the back of Teensy is also an option.
 
How do i change CS from 10 to 15?

With the very latest code, which today is only on github (but will likely to become the default in Teensyduino 1.32), you can change the CS pin with Ethernet.init(pin), before Ethernet.begin().

Using the older Ethernet library, you can only change the CS pin by editing code within w5100.h inside the library.

The other 3 signals are changeable with SPI.setSCK(pin), SPI.setMOSI(pin) and SPI.setMISO(pin).
 
BTW, Ethernet.init(pin) is an Adafruit extension, which they added to their copy of Ethernet2, which Adafruit forked from Arduino.org, which Arduino.org forked from a very old copy of Ethernet from Arduino.cc... back before they had accepted my addition of SPI transactions within the socket layer. Adafruit has since re-added SPI transactions, but at the lowest SPI access level, which is much less efficient.

The normal Arduino convention is to select things like chip select pins in a begin() function, or sometimes in C++ constructors. My guess is the Arduino devs won't like this init(pin) API, only because it doesn't follow their naming conventions. But because Adafruit did this, I intend to maintain compatibility with Adafruit's extension in Teensyduino. When/if the Arduino devs publish their own API for different CS pin, I'll support that too.
 
The old Ethernet library (still in 1.31 and 1.32-beta1) did not support changing the CS pin. Well, at least not unless you edit the code.

Yes, you read that correctly. It's a software matter. Even though the hardware supports several pins for CS, the old Ethernet library software was hard-coded to just pin 10.
 
So the libraries need to support it?
I thought its like a changeover switch (on the Teensy) and the other side doesn't know about it.
 
How do i set the pins on the 3.5 for ethernet to SPI1?
For CS it's "Ethernet.init(31)" - but the rest?

On SPI0 i have a RFM69.
This is for the RFM69 - so defaults to SPI0:

Code:
/**************************************************************
* CONNECTION TEENSY 3.5                                       *
***************************************************************
RFM69 MOSI <> D11 MOSI0
RFM69 MISO <> D12 MISO0
RFM69 DIO0 <> D2  IRQ
RFM69 NSS  <> D15 CS0
RFM69 SCK  <> D14 SCK0

W5500 MOSI <> D0  MOSI1
W5500 MISO <> D2  MISO1
W5500 NS   <> D31 CS1
W5500 SCLK <> D32 SCK1
**************************************************************/

uint8_t rfmClockPin = 14; // Teensy alternative SCK since first SCK is the LED
uint8_t rfmIrqPin = 2;    // RFM69 IRQ on for Teensy
uint8_t rfmIrqNum = 2;    // RFM69 IRQ on Teensy
uint8_t rfmCsPin = 15;    // RFM69 pin for SPI CS on Teensy

RFM69_ATC radio(rfmCsPin, rfmIrqPin, isRFM69HW, rfmIrqNum);

void setup() {
  SPI.setSCK(rfmClockPin);   // Alternative SCK pin for RFM69
  pinMode(rfmIrqPin, INPUT); // Enable INPUT mode on RFM69 IRQ pin
}
 
Last edited:
You don't. The Ethernet lib is hard coded for SPI, not SPI1. It also uses the FIFO, which only exists on SPI. SPI1 and SPI2 lack the FIFO.
 
First, by "MAC" I'm going to assume you mean 48 bit ethernet address.

The W5500 has a MAC if I'm right?

No, sadly you're not right, the W5500 doesn't. Well, at least not until you (the Ethernet library) initializes the W5500. Then it has whatever mac address was given to it during initialization.

Perhaps you're thinking of the WIZ550io module? It has a PIC microcontroller with the 48 bit address permanently stored in the PIC's non-volatile memory. At startup or upon a reset pulse, the PIC chip initializes the W5500 with its 48 bit address. That module has a RDY pin which tells you want the PIC chip is done loading the address into the W5500. The address isn't actually stored in the W5500. It's in the PIC chip.

The much more commonly used WIZ850io (and cheap clones) do not have this PIC chip.
 
Ok, then i still have to use a Dallas DS18B20 or the Teensy serial.
I thought i was reading somewhere the W5500 has one by default.
 
@Michael, thank you - I'm already in that thread.

Another question comes up as I'm looking on some old code i did on an Arduino.
Is it now possible with the W5500 to check if there is physical connection?
On the old Arduino ethernet shield i did solder a cable to the link LED and connected it to an digital input.
The problem was if you lose connection you need to do Ethernet.begin again.
I did check the LED on powering up the Arduino once and then again in a loop every 5 seconds.
If the cable is connected (LED on) i then ping my server.
If the server is there i connect to my MQTT server.
It does not make sense the devices try like crazy to get NTP time or tries to connect to MQTT if ethernet is not working for some reason.
I find the code really complex with allot of true and false...

I wonder how this is handled with the ESP8266. Its more likely you lose WiFi connection...
Who wants to walk around and restart all the Teensys/Arduinos because you did unplug your switch/Wlan access point...
 
This is another question where the answer depends on the meaning of "possible".

No, it's not possible to do using only the library that exists today.

Yes, it is possible if you have the skill and time to make substantial changes to the Arduino Ethernet library. But very few people have this ability. That library has some complex code, including tricky use of the C preprocessor.
 
I made my own library based on the Ethernet2 lib. It is only for Wiznet w5500 chip and give additional functions:
- completely different init procedure
- multicast support
- PHY support
- socket RAM size
- MAC Address
- CS and RST pin
- soft- and hardware reset
there is no deeper optimization like on pauls lib, but i will add it in the next months.
You can fin the library here:
https://github.com/sstaub/Ethernet3
there is also my TeensID library to give you a MAC address and other IDs
 
How to query which WIZnet chip is in use by Ethernet library?

Is there a way to query which WIZnet chip is in use? I stumbled around in the source code a bit but no joy. I have some test code running great with T3.2, the PJRC uSD/WIZnet adapter, and Wiz850io, but if I plug in the older Wiz820io it quietly fails... and I would expect examples like DHCP and NTP to just work<Update - the problem appears to be some damaged WIZ820io modules, others work as expected... apologies for the false alarm>. Here is the repo with all my test code and docs: https://github.com/systronix/W5500_Test Thanks!
 
Last edited:
Back
Top