Hello, sorry if this is a re-post.
I have been using an Ethershield ENC28J60 as a web server with arduino 2009, also using it as an NTP client. I soon found out that ATMEGA328 ran out of both FLASH and RAM space. Therefore i decided to switch to an ATMEGA1280 board. Unfortunatelly just plugging the Ethershield board on the Mega Board will not do the trick, so here's the changes that have to be done in order to have it working as i did:
The boards must NOT be plugged together. Instead connect them with wires as follows:
Ethershield GND -> MEGA1280 GND
Ethershield 5V -> MEGA1280 5V
Ethershield Reset -> MEGA1280 Reset (This is pin 5 of ICSP connector)
Ethershield 10 -> MEGA1280 53 (SS)
Ethershield 11 -> MEGA1280 51 (MOSI)
Ethershield 12 -> MEGA1280 50 (MISO)
Ethershield 13 -> MEGA1280 52 (SCK)
Changes in file "enc28j60.c" in EtherShield Libraries folder:
replace these lines:
const static uint8_t SS = 10;
const static uint8_t MOSI = 11;
const static uint8_t MISO = 12;
const static uint8_t SCK = 13;
with these:
#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
const static uint8_t SS = 53;
const static uint8_t MOSI = 51;
const static uint8_t MISO = 50;
const static uint8_t SCK = 52;
#else
const static uint8_t SS = 10;
const static uint8_t MOSI = 11;
const static uint8_t MISO = 12;
const static uint8_t SCK = 13;
#endif
That's it. You now have 8Kbytes of RAM for bigger web pages.
Have fun!