analogReference(EXTERNAL)

yesh that is mistake

No, it isn't. There is no way to set the mode for analog pins, because they are input only, by design.

When you use the analogReference() function, with EXTERNAL as the argument, the ADC compares the measured voltage on the analog pin to the voltage on the VRef pin. What do you have supply voltage to the VRef pin? What voltage is it?