Atmega1284P with custom built ethernet port

Good day,

I am developing a board with the Atmega1284P-U. The board needs to be able to send and receive data via internet.

The tutorial i saw online is this one:

I am trying to build the exact same thing but instead of the Atmega328P i am using the Atmega1284P and ofcourse i use the correct pins on the Atmega1284 (PB2 on the Atmega328P = PB2 on the Atmega1284P etc...)

I have used multiple example codes but none of them seem to work. I always get IP: 0.0.0.0. When the internet cable is connected to my router i can see the router RJ45 led on but it won't work.

I am not exactly sure i have used the right RJ45 pins because i cannot find what pins are number 1 till 8 but i tried to figure it out looking at reference pictures (https://docstore.mik.ua/univercd/illus/h/18/h5318.gif)

I was uning another connector but i cannot find any information about that one, and when i try to measure resistance, multiple pins are connected to the same wire (SI-52007-F) => (https://componentsearchengine.com/footprintPreview.php?partID=239837&u=0)

For example, pin 9 on the schematic above is connected to wire 7 AND 8??

This is the code i am using with the UIPEthernet library, but i also tried other examples (forgot which ones)

/*
 * UIPEthernet EchoServer example.
 *
 * UIPEthernet is a TCP/IP stack that can be used with a enc28j60 based
 * Ethernet-shield.
 *
 * UIPEthernet uses the fine uIP stack by Adam Dunkels <adam@sics.se>
 *
 *      -----------------
 *
 * This Hello World example sets up a server at 192.168.1.6 on port 1000.
 * Telnet here to access the service.  The uIP stack will also respond to
 * pings to test if you have successfully established a TCP connection to
 * the Arduino.
 *
 * This example was based upon uIP hello-world by Adam Dunkels <adam@sics.se>
 * Ported to the Arduino IDE by Adam Nielsen <malvineous@shikadi.net>
 * Adaption to Enc28J60 by Norbert Truchsess <norbert.truchsess@t-online.de>
 */

#include <SPI.h>
#include <UIPEthernet.h>

EthernetServer server = EthernetServer(1000);

void setup()
{
  Serial.begin(9600);

  uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05};
  IPAddress myIP(192,168,0,6);

  Ethernet.begin(mac,myIP);

  server.begin();
}

void loop()
{
  size_t size;

  if (EthernetClient client = server.available())
    {
      while((size = client.available()) > 0)
        {
          uint8_t* msg = (uint8_t*)malloc(size);
          size = client.read(msg,size);
          Serial.write(msg,size);
          free(msg);
        }
      client.println("DATA from Server!");
      client.stop();
    }
}

Does the light on the switch mean the wires are correct? Or can it be something else?
Thanks for the help

my first question is: is your RJ-45 connector a MAGJACK? does it contain the transformers?

The first one i tried is (MagJack bel magnetics pattented SI-52007-F) but i can never find the pin numbering?
The other one i tried isn't, i used a cheap rj45 coupler and cut the wires to get 8 wires i could connect. If i have to use the MAGJACK connector that would be fine for me but i don't know how to wire it.

Also, i am not sure if i am correct but i think i have to set the mac address in code. The device i am building is going to be sold and needs to have a unique mac address per device, is there an option to not change the code everytime i am burning the atmega1284?

Maybe the enc28J60 has a better and more easy alternative where the mac is already set?
Thanks

Will this be the right RJ45 connector? RJ45 MagJack Breakout Sparkfun 13021 - vanallesenmeer

bluebirdsoftware:
Will this be the right RJ45 connector? RJ45 MagJack Breakout Sparkfun 13021 - vanallesenmeer

I don't know. I use complete enc28j60 modules. Most Arduino Ethernet modules and shields use HanRun RJ-45 connectors with integrated transformers. Some use plain RJ-45 connectors and a large component with the transformers. Study the existing shield or modules with open hardware schematics.

Well, for me it is better to use the USR-ES1 i think. I cannot find any distributor who sells the HanRun RJ45 connector in the Netherlands and the USR-ES1 is a complete chip which i can connect to the Atmega1284 if i am correct.

The next thing i need is a valid MAC address. I have found out that this chip has a MAC address in it: 25AA02E48
The only unknown thing for me is if it is possible to read the data through the Atmega1284.
Here is the documentation: http://www.farnell.com/datasheets/2243923.pdf?_ga=2.72956819.1233142090.1584556248-2094823423.1577435890

I have searched for information about reading data from an EEPROM but the pins are different on the examples. Would this be possible and is it the right way to do so?

you can communicate with any SPI device with Arduino. only check the logic level voltage

I have checked the datasheet (https://cdn.sparkfun.com/datasheets/Dev/Arduino/Shields/W5500_datasheet_v1.0.2_1.pdf) and it says 3.3V operation with 5V I/O signal tolerance

So that means i am okay?

I have received the Microchip 25AA02E48 and would like to read the MAC address, i have downloaded this library: GitHub - akafugu/Microchip_25AA02E48: Arduino library for Microchip 25AA02E48/25AA020A

The only problem is it doesn't show how to connect the EEPROM to the Atmega328p (i am using the Atmega328p to connect to the internet so it is different than the 1284P i said previously).

I used this tutorial to connect the EEPROM to the Atmega but i can't get it to work, this is my output:

EUI48 (hw address): 00-00-00-00-00-00
EUI64: 00-00-00-FF-FE-00-00-00
Wrote 0xCC to address 64.
Read from address 64: 0x0

I connected the EEPROM like this (got it here https://www.arduino.cc/en/Tutorial/SPIEEPROM):

I have to mension that this Atmega328p will take care of the internet connection so i have also connected the W5500 module to it (it shares the miso, mosi etc...), if i disconnect these wires, i get this result:

EUI48 (hw address): FF-FF-FF-FF-FF-FF
EUI64: FF-FF-FF-FF-FE-FF-FF-FF
Wrote 0xCC to address 64.
Read from address 64: 0xFF

W5500 module: Amazon.com