Connect Arduino ethernet Shield to Arduino Mega2560

Hello every one,

i just got my arduino ethernet shield and pluged it in my arduino uno to if it works. After uploading the NTP example scretch everything worked fine. Because the shield was originally planned for my mega board i pluged it inside the mega and start reading in the documentation, how the hack wors, to get the pins connecte. Accidentplay i uploaded the old uno scretch on the board and it had no problems connectin to the internet and getting the NTP time????

Doesn't i have to do the hack anymore? if not which pins on the mega are used now?

CL

The newer Ethernet shields use the ISP header and that's connected the same way on the UNO and the Mega. So no hacks are necessary anymore.

Ah very nice, but still got two problems....

  1. Which pins are now used? The 11, 12, and 13 or is ervything going through the us and all pins are free to use?
  1. I can not initialize the SD-Card? i guess the Problem is the hardware SS pin which is 10 on uno and 53 on mega. Whe i change this in the scretch it still does not work. Anyone any idea what i can do about this?
  1. is solved after i unplaged and reinserted the sd Card everything worked fin.

Is it normal thet the Wiz-Net Prozessor gets hot when it is powered? Should i cool it somehow?

CL

Only MISO, MOSI and SCK (on the UNO 11, 12 and 13, where on the Mega it's 50, 51 and 52) are taken from the SPI connector. SS is connected to pin 10 but this shouldn't be a problem because the chip select is not handled in hardware. Chip select of the SD card is on pin 4.

You haven't provided a sketch, so I cannot comment on that.

Ok that is good to know.

My skretch is a very siple one :smiley:

#include <SPI.h>         
#include <Ethernet.h>

byte mac[] = {  
  0x90, 0xA2, 0xDA, 0x0D, 0x1B, 0x4C };

void setup() 
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  // start Ethernet and UDP
    Serial.print("Requesting Ethernet-Adress: ");
    
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    for(;;)
      ;
  }
  Serial.println(Ethernet.localIP());
  Serial.println(Ethernet.subnetMask());
  Serial.println(Ethernet.gatewayIP());
  Serial.println(Ethernet.dnsServerIP());
}
  void loop()
{
  
}

You should handle the CS lines yourself:

// enable CS of Wiz5100
pinMode(10, OUTPUT);
digitalWrite(10, LOW);
// disable CS of SD card
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);

Ok

thank you for the advice