This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Wiznet5100 ethernet shield on nRF52840

Dear Nordic Devzone,

I want to run an Arduino Ethernet Shield with the Wiznet5100 on the nRF52840. I was wondering if there was an easier way to do this then having to rewrite the SPI code by myself.

www.arduino.cc/.../ArduinoEthernetShieldV1

Currently I am using the Keil IAR /uVision to compile my code and can easily compile and run all the examples included. I am just a bit lost on how to use the ethernet shield with the nRF52840.

I thought I would be able to use some Arduino library to easily get it working.

Any help or direction in which to start would be much appreciated.

ToasTer

  • I was able to find the wizchip_conf.c file and change the wiznet chip to the 5100.

    Now I am getting contino printf("Unknown PHY Link stauts.\r\n"); from the user_ethernet.c file at line 68.

    Will try to trouble shoot this.

  • Looking at the function wizphy_getphylink() in wizchip_conf.c line 575, it seems that if you have defined the board to be anything else than 5500 or 5200, it will return -1, and you will get the Unknown PHY Link stauts printed.

    In wizchip_conf.h line 589, you also have this comment "get the link status of phy in WIZCHIP. No use in W5100".

  • Hi Sigurd, thanks again.

    Yep I just figured that out before you messaged, I am sorry. Right now I am using this as well as a kind of logbook for what I have done.

    So now it is still printing out

    === W5100 NET CONF ===
    MAC: FF:FF:FF:FF:FF:FF
    SIP: 255.255.255.255
    GAR: 255.255.255.255
    SUB: 255.255.255.255
    DNS: 8.8.8.8
    ======================
    

    in the network_init(); function on user_ethernet.c line 81 the gWIZNETINFO variable is filled before setting the ctlnetwork(CN_SET_NETINFO, (void*)&gWIZNETINFO); function. But after the set & get ctlnetwork(CN_GET_NETINFO, (void*)&gWIZNETINFO); gWIZNETINFO is empty again.

    So will trouble shoot that now.

    Really seems like I am getting somewhere at least. Thanks again Sigurd for all your help up till now.

  • Found this image of the wiz5100 ether net shield link text

    Using this layout I changed the pins to correspond to that layout:

    #define ARDUINO_13_PIN              NRF_GPIO_PIN_MAP(1, 15)  // Digital pin 13
    #define ARDUINO_12_PIN              NRF_GPIO_PIN_MAP(1, 14)  // Digital pin 12
    #define ARDUINO_11_PIN              NRF_GPIO_PIN_MAP(1, 13)  // Digital pin 11
    #define ARDUINO_10_PIN              NRF_GPIO_PIN_MAP(1, 12)  // Digital pin 10
    
                            .Pin_SCK                = ARDUINO_13_PIN,
                            .Pin_MOSI               = ARDUINO_11_PIN,
                            .Pin_MISO               = ARDUINO_12_PIN,
                            .Pin_CSN                = ARDUINO_10_PIN};	
    

    now the print out of my terminal has changed, to :

    === W5100 NET CONF ===
    MAC: 00:00:00:00:00:00
    SIP: 0.0.0.0
    GAR: 0.0.0.0
    SUB: 0.0.0.0
    DNS: 8.8.8.8
    ======================
    
  • going to get myself a logic analyzer and check the pins. Have to make sure the nRF52840 is sending out data.

Related