# atmega328p keeps resetting

i program my atmega with USBasp ,and i set the fuse bits hfuse:0xC9 and lfuse :0xff. when i upload my simple code

int main(void)
{
DDRB |= 1<< PINB1 ;

PORTB|= 1<<PINB1;
while (1)
{

}
}


the MCU keeps resetting(led keeps blinking), i tried using usbasp as power supply and also i tried using 9v volt battery with regulator but still the same problem ( and i have 0.1uf capacitor between vcc and ground and pullup resistor in the reset pin). i also bought a new atemga328p ( i thaught the other is dead) but always the same problem.

• Is the watchdog (de-)activated? – Janka Jan 22 '18 at 10:52
• thanks man , i changed hfuse to 0xD9 then reset it and it worked fine – Mourad Jan 22 '18 at 11:20
• @Janka your comment was spot-on. Perhaps you could post an answer so that OP can choose whether to accept it – clabacchio Jan 22 '18 at 15:09
• It was a lucky guess … nothing more. – Janka Jan 22 '18 at 15:31