Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 26 to 50 of 75

Thread: Wiznet W5500 support

  1. #26
    Senior Member
    Join Date
    Jan 2013
    Posts
    121
    Quote Originally Posted by markonian View Post
    @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.

  2. #27
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    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-ENC2...-/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.

    Click image for larger version. 

Name:	wiz850io.jpg 
Views:	224 
Size:	154.7 KB 
ID:	8846
    (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.

  3. #28
    How do i change CS from 10 to 15? I want to free up serial 2.
    For SCLK it's
    Code:
    SPI.setSCK(14);
    right?

  4. #29
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    424
    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.

  5. #30
    Oh i did not see the one on the back.
    How do i define them?

  6. #31
    Moderator MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,504
    Quote Originally Posted by MrGlasspoole View Post
    Oh i did not see the one on the back.
    How do i define them?
    https://forum.pjrc.com/threads/32261...8102#post98102

    This board is probably the easiest board to get access to the bottom pins: https://oshpark.com/shared_projects/0T6ZdhhG

  7. #32
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Quote Originally Posted by MrGlasspoole View Post
    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).

  8. #33
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    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.

  9. #34
    SCK, MOSI, MISO are changeable but CS not?
    In the 3.2 pinout picture i see CS on Pin 9, 15, 20 and 21.

  10. #35
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    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.

  11. #36
    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.

  12. #37
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    424
    I did some testing on the Chinese Wiz850io's you can buy really cheap on Ebay or Aliexpress. They seem to be China Export versions of the Wiznet reference design, working just as good but cheaper. The Ethernet library in TD 1.32 supports them perfectly.

  13. #38
    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 by MrGlasspoole; 01-20-2017 at 04:48 AM.

  14. #39
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    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.

  15. #40
    The W5500 has a MAC if I'm right?
    How do i read it?

  16. #41
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    First, by "MAC" I'm going to assume you mean 48 bit ethernet address.

    Quote Originally Posted by MrGlasspoole View Post
    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.

  17. #42
    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.

  18. #43
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,346
    Use the one that your teensy has.

  19. #44
    Moderator MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,504
    Quote Originally Posted by Frank B View Post
    Use the one that your teensy has.
    Here is a post that describes how to get a MAC address from the Teensy (note, read the whole thread for 3.5/3.6 information): https://forum.pjrc.com/threads/91-teensy-3-MAC-address.

    And here is FrankB's library: https://github.com/FrankBoesing/TeensyMAC.git

  20. #45
    @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...

  21. #46
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    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.

  22. #47
    By possible i meant if this function is there - if the chip has some kind of output/detection.

  23. #48
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    15,711
    Look at page 42 in the W5500 datasheet, documenting the PHYCFGR register.

  24. #49
    Junior Member
    Join Date
    Sep 2016
    Posts
    16
    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

  25. #50
    Senior Member
    Join Date
    Nov 2012
    Location
    Salt Lake City, UT, USA
    Posts
    246

    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 by bboyes; 03-03-2017 at 11:48 PM. Reason: Correct Wiz820io issue - seems to be damaged unit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •