Go Down

Topic: Arduino Mega 2560 with Ethernet Shield with PoE (Read 1 time) previous topic - next topic

paddi

Hello.

I'm using the Ethernet Shield with PoE (A000075) with the Arduino Mega 2560 Rev03 (A000067) with the arduino 1.0 IDE. The shield fits exactly to the board, but I can't connect to the server neither to the sd card. The shield works fine with an Uno.
I've already read the topics for rewirering the ICSP-Pins from 10-13 to 50-53, but I also found in the SD2PinMap.h which is included within the compilation of the files with th sd library.
Almost at the beginning, there is a defined part for the AVR_MEGA_2560, in which the correct pins are chosen:
// SPI port
uint8_t const SS_PIN = 53;
uint8_t const MOSI_PIN = 51;
uint8_t const MISO_PIN = 50;
uint8_t const SCK_PIN = 52;

At the end for default:
// SPI port
uint8_t const SS_PIN = 10;
uint8_t const MOSI_PIN = 11;
uint8_t const MISO_PIN = 12;
uint8_t const SCK_PIN = 13;

How can I use the already defined section to properly use of the sd card slot?

THX
Paddi


SurferTim

You don't need to rewire anything for those new devices. The SPI data lines are on the ICSP connector. Digital pins 11-13 are not connected to anything on the shield.

Digital pin 10 is the w5100 SS pin, and digital pin 4 is the SD SS pin.

paddi

I know that fact,
but the sd card don't work with the mega, but with the uno. When I upload the data to the uno, the terminal comes ith the correct answers.
When I replug the shield to the mega and upload the data to the mega, the initialization fails always.

I've read sometimes that I have to change the wirering to the ICSP.
But I haven't found anything for the IDE 1.0


SurferTim

I have a Mega and an ethernet shield. I use the SD card also, and it works. Have you tried disabling the w5100 SPI before initializing the SD card? That is where it is failing for you, correct?

Code: [Select]
void setup()
{
  Serial.begin(9600);

  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);

  // you are failing here?
  if(SD.begin(4) == 0)
  {
     Serial.println("SD fail");
  }
   else
   {
      Serial.println("SD ok");
   }

  Ethernet.begin(mac,ip);
  digitalWrite(10,HIGH);

  // rest of the setup
}



paddi

Yes, I think so.

Where can I change / disable the w5100?
I've used the sd examples for general testing the new ethernet shield.

THX
paddi

Go Up