sketch not executing

I’ve recently been playing around with some old atmega168. I program them using ftdi bitbang. I’ve been trying to run a simple code (turn an led on) but it doesnt seem to work. uploading is successful but the led does not turn on. It almost seems that none of the ports will output a high voltage. I attach an led to the port and then to ground (no resistor). I double checked that I got the the right pins on the led by short-circuiting to vcc…its bright. but not when I connect it to any of the ports

fuse bits:

lfuse: 0xe2

hfuse: 0xdf

efuse: 0x1

The following is the code;


#define F_CPU 8000000

#include <avr/io.h>

#include <util/delay.h>

int main(void)

{

DDRD = 0xFF;

while(1)

{

PORTD = 0xFF;

_delay_ms(500);

PORTD = 0x00;

_delay_ms(500);

}

return 0;

}


Any help would be great!