Seeed Ethernet + Mega 2560 ICSP

Hi All,

I've explored a number of posts related to this topic, but I'm not able to solve the issue at hand.

I first tested the shield on my UNO by simply stacking - all worked fine. I was using some simple code posting sensor readings to plot.ly. I wanted to incorporate into my MEGA2560 project, but first explored the ability to switch CS pins. I was able to successfully wire the shield via ICSP on the UNO, and switch the CS pin by modifying the w5100.h file.

I tried a few iterations, all of which were successful in posting data to the plot.ly API.

I've since been completely stumped when trying to get this to work on the MEGA. I followed the exact same steps - wiring through ICSP, double, triple checking pin arrangement - and moving the CS pin around via the w5100.h file and the pin mapping found here:

Currently my CS is set to digital pin 48, using this code in the .h file:

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  inline static void initSS()    { DDRL  |=  _BV(1); };
  inline static void setSS()     { PORTL &= ~_BV(1); };
  inline static void resetSS()   { PORTL |=  _BV(1); };
#elif defined(__AVR_ATmega32U4__)

48 is connected to shield digital pin 10. I've tried all iterations of writing 53 as an output, high low, and writing 10 as an output, high and low.

I'm completely stumped. Can anyone lend me a hand as to how I can get this circuit functioning?

I appreciate the help. I have done a plethora of reading on this subject over the past 3 days, and am unable to solve.

As I said, im using the MEGA 2560, seed ethernet shield:

I figure if I was successful at the UNO that should be transferable as long as I move CS pin to the right location. ICSP shouldnt differ?
Thanks!

-Justin

If you are using the ICSP pins for the SPI data lines, then all should be the same as the Uno. D10 is still the w5100 slave select.

I'm not sure what you mean by d10 is still the slave select. The slave select should be whatever I set it to correct?Or does the slave select remain regardless of what the chip select is?

Regardless, even when I write 10 as an output it still isnt working.

The W5100 slave select for that unit is D10.

The default slave select for the SPI on the Uno is D10. The default slave select for the Mega is D53. But that does not change the slave select for the W5100. It is still D10 on that shield.