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

Parents
  • Hi,

    You can find a nRF5x SPI library for the WIZnet 5500 chip at this github page. This should be a good starting point.

    Also see this blog post about WIZnet's BLE to TCP Gateway.

  • Dear Sigurd,

    Using the link you provided I am now able to compile the whole library and functions.

    In the user_spi.c I changed the spi0_master_init() function to correspond with the SCK, MOSI, MISO, CSN pin layout on the nRF52840 :

    void spi0_master_init()
    {
        SPIConfig_t spi_info = {.Config.Fields.BitOrder = SPI_BITORDER_MSB_LSB,
                            .Config.Fields.Mode     = SPI_MODE3,
                            .Frequency              = SPI_FREQ_8MBPS,
                            .Pin_SCK                = SER_APP_SPIM0_SCK_PIN,
                            .Pin_MOSI               = SER_CON_SPIS_MOSI_PIN,
                            .Pin_MISO               = SER_CON_SPIS_MISO_PIN,
                            .Pin_CSN                = SER_APP_SPIM0_SS_PIN};	
        spi_master_init(SPI0,&spi_info);
    }
    

    Although at this moment I am kind of lost. I followed the example and also called :

    	user_ethernet_init();
    	network_init();
    

    But I can't ping the board. Any tips to help me ?

Reply
  • Dear Sigurd,

    Using the link you provided I am now able to compile the whole library and functions.

    In the user_spi.c I changed the spi0_master_init() function to correspond with the SCK, MOSI, MISO, CSN pin layout on the nRF52840 :

    void spi0_master_init()
    {
        SPIConfig_t spi_info = {.Config.Fields.BitOrder = SPI_BITORDER_MSB_LSB,
                            .Config.Fields.Mode     = SPI_MODE3,
                            .Frequency              = SPI_FREQ_8MBPS,
                            .Pin_SCK                = SER_APP_SPIM0_SCK_PIN,
                            .Pin_MOSI               = SER_CON_SPIS_MOSI_PIN,
                            .Pin_MISO               = SER_CON_SPIS_MISO_PIN,
                            .Pin_CSN                = SER_APP_SPIM0_SS_PIN};	
        spi_master_init(SPI0,&spi_info);
    }
    

    Although at this moment I am kind of lost. I followed the example and also called :

    	user_ethernet_init();
    	network_init();
    

    But I can't ping the board. Any tips to help me ?

Children
No Data
Related