Hello!
I'm trying to catch interrupts generated by Ethernet Shield sockets, but apparently I miss something.
So after initializing all the stuff I have 2 sockets S0 and S1, the first is UDP multicast socket, and the second is TCP listening on port80. At this moment the register states are:
EIFR:0x0 IR:0x0 S0_IR:0x0 S1_IR:0x0
Then I telnet to port 80 and the S1 and it invokes interrupts properly on the w5100 but mega2560 External Interrupt Flag register is empty:
Socket1 status: 0x17
EIFR:0x0 IR:0x2 S0_IR:0x0 S1_IR:0x1
Description page http://arduino.cc/en/Main/ArduinoEthernetShield for the shield says that
"The jumper connects the INT pin of the W5100 to digital pin 2 of the Arduino. "
. Pin map of Mega2560 says that digital pin 2 is PORTE4 and it is INT4 external interrupt, so I set the flags as follows:
sei(); //enable external interrupts;
DDRE &= ~(1<<4); // set the pin 4 onPORT E on input
EIMSK = 0b00010000; //Set the External Interrupt Mask Register
SPI_Write (IMR,0xFF); //enable all interrupts in w5100
And as showed previously the interrupts in Ethernet Shield still are not concidered by mega, however I can invoke the interrupt by explicitly writing low to that ping like.
What do I miss to catch w5100 interrupts?