# Is my microcontroller damaged?

I tried the simplest code with a blinking LED, but it is not working.

I connected the LED to PB0 through a 1k resistor. The software (AVRDUDESS) is detecting the microcontroller (ATmega16) fine, but when I run the program, the code is not working. The LED stays OFF.

The MCU was working till recently, is it possible it's damaged even though the program recognizes it?

I checked the LED and it's not damaged, so don't see a reason why it wouldn't work.

The code:

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

int main(void)
{
DDRB = 0xFF;
while(1)
{
PORTB |= (1<<PB0); //TURN LED ON
_delay_ms(1000);
PORTB &= ~(1<<PB0); //Turns OFF LED
_delay_ms(1000);
}


• Do you need to config the clock in the code? I'm not sure, though, maybe there are some pre-defined configurations in a bootloader-like config file. May 19 at 15:50
• @VictorGrounds has it right. Please check here for more info. May 19 at 15:55