Keypad not working on standalone Arduino

In my project using a Mega2560, I have attached a 4x4 keypad directly to A0-A7 pins.
(No pull up resistors or other paraphernalia)
Using the keypad library, its working.

When I built a standalone version of the same on a PCB, its not working any more.
The Mega2560 is getting programmed. I have verified by taking the .hex for the blink program and uploading it. There is no problem.

This is the code I'm using to test :
(I want to toggle an LED, everything a button is pressed. This code is working fine on the arduino board)

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {A7, A6, A5, A4}; 
byte colPins[COLS] = {A3, A2, A1,A0};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

int statuspin=0;
int led = 2;

void setup(){
     pinMode(led, OUTPUT);     
}

void  loop(){  

 keypad.waitForKey();
 
 digitalWrite(led, !digitalRead(led));
 
}

When I built a standalone version of the same on a PCB, its not working any more.

What did you build, a keypad or an Arduino mega?

suhasm:
[Snip...] its not working any more.

I can't think of anything in the code that would cause the sketch to fail like this. Is anything happening at all, even though it may not be right? Or does it just look completely dead? Would you mind posting pictures of your schematic and board layouts?

@HazardsMind

The Mega2560 is standalone.

@mstanley

I have connected PORTF ie. pin97-pin90 to the keypad pins directly.
There is contact between the uC pins and the keypad. I have tested it.
Other pins of the uC are connected to other things like an LCD, RTC etc

Schematic :