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

  • DHCP was simplified by example i found in web, but it works incorrect. It needs to rewrite with using timer to Discover DHCP packets. Ping doesnt work now too. Now it works wiyh static IP only. IN Socket.c i rewrite some unimportant places, but it does not matter. In general, you only need next files: socket, w5100, tcpclient. They do not affect the code.You need only redefine SPI pins in NRF5x_SPI and rows in structure with ip, sn, gw in main.c. Here is example of using tcp client:

        if(tcpclient_open(s, ip, port))
    {
    	return true;
    }
    else
    {
    	return false;
    }
    
        if(tcpclient_sendbytes(s, packet, length))
    {
    	....		
    }
    else{
               ....
    }
    
        if(tcpclient_recivedata(s, data_buf_rx, data_buf_len))
    {
                 ...
    }
    else
    {
                ...
    }
    
Related