Atmega328 ADC conversion

Hi All,
I have the following code running on an Atmega328 (it is an experiment)

#define F_CPU 16000000
#define __AVR_ATmega328P__

#include <avr/io.h>
#include <util/delay.h>
#include <util/atomic.h>

#define ANALOG_INPUT_PORT 5

ISR(ADC_vect) { // Executed every time an ADC conversion finishes
                // The next ADC conversion restarts immediately
    uint8_t read;

    read = ADCH; // reads first 8 bit, bits are left allined, so ADCH contains the 8MSB
    // last two bits are discard. read goes from 0 (0V) to 255 (5V)

    if (read >= 100)
        PORTD |= _BV(PIND7); // switch on the led
    else
        PORTD &= ~_BV(PIND7); // switch off the led
}

int main() {
    cli(); // clears interrupts

    DDRD |= _BV(PIND7); // led is on pin 7

    // Inits ADC
    ADCSRA = 0; // Resets ADC
    ADCSRB &= ~(_BV(ADTS2) | _BV(ADTS1)| _BV(ADTS0)); // sets in free running mode
    ADCSRA |= _BV(ADEN) | _BV(ADATE); // Enable the ADC, enables auto triggering
    ADCSRA |= _BV(ADPS0) |  _BV(ADPS1) | _BV(ADPS2); // Set prescaler to 128 (one ADC conversion will need about 104us)
    ADCSRA |= _BV(ADIE); // enables interrupts for ADC
    ADMUX |= _BV(REFS0)*1 | _BV(REFS1)*0; // Uses Vcc as reference voltage
    ADMUX |= _BV(ADLAR); // Right justify the result
    ADMUX |= ANALOG_INPUT_PORT; // Sets ADC Port

    DIDR0 = 0; // disable input on ADC pins (leaving enabled the ADC muxer)

    sei(); // sets interrupts

    ADCSRA |= _BV(ADSC); // starts conversion

    while (1) { // main loop
        asm("nop\n\t"); // does nothing
    }
}

This is a simple ADC conversion in free runnning mode.

The idea is to read ADC, if it is greater than 100 it should switch on a led, and if it is lower switches the led off.
But instead what I get is the led is always off, even if I connect the ADC input to the 5V line (this way it should read 255). Only sometimes, in the instant I connect the ADC input to the 5V, the led swithces on.

Any solution?
Thank you in advice.

Solve you problem by a process of elimination.

Is you actual led broken ? Make the sketch turn the led on and off, before it starts running the adc stuff, to make sure the led works.

Double check that what you have done replaces the functionality of the pinMode( ) function properly.

It is not a led problem, the code uploads successfully (the blink example works perfectly), and the led is in output mode.

Connected the ADC input to the wrong pin

The above code works perfectly