Arduino Uno/Mega + EthernetShield (with SD card) + keypad library issue

Hi All! It´s my first post, I´ve been using arduino in my project with keypad via 12C, ethernet shield with simultaneous client and server and a lot of other stuff that makes my arduino Uno run out of SRAM, but today I´ve bought and Arduino Mega 2560 and I´ve tried to use Keypad Library without PCF8574 to simplify schmematics, and for my surprise, does not work.
I´ve begun simple tests, like, change pins (rows and columns), nothing...
During the tests, when I remove the ethernet shield, the keypad begin to react to key pressed.
When the ethernet shield is plugged in, on start the arduino receive an keypress event and keypad is unresponsive.
To check if it´s a coding issue, I´ve been tested the same situations on Arduino Uno and Arduino Mega 2560 both running HelloKeypad Example on IDE 1.0.4 and I had the same results (no response).

I´ve searched in forum for similar issues, but In all cases was related to coding issues, in this case, only by pluging in the ethernet shield, the keypad begun unresponsive.

Excuse if I´ve made a gramatical mistake, english it´s not my natural language.

Thanks in advance. :sweat_smile:

Hi Guys! I´ve discovered what is wrong...

Unfortunatelly in my tests I´ve used the pins:

53, 51, 49, 47 (for rows) 52, 50, 48, 46 (for columns) on Arduino Mega, and 3,4,5,6 (for rows) 7,8,9,10 (for columns) on Arduino Uno.

Accordling to SPI documentation: SPI - Arduino Reference, the pins I´ve choosed its used for SPI and Ethernet Shield use SPI and for some reason that makes the keypad library unresponsive.

I´ve changed the pins and all works great now!

If someone got this issue, change the pins and all works great.