Atmega328 rapidly resetting itself, parallel upload

I upload a simple sketch via parallel programmer to my atmega328-pu ( notice it is not atmega328p ) with proper "flash verified" and "Done uploading." inputs. My sketch simply sets pin 12 mode to output and writes it high but what happens is that the led blinks with a frequency of about 5Hz. I believe the board is resetting itself very fast and that is why the blinking. The sketch is following.

void setup( )
{
     pinMode( 12, OUTPUT );
     digitalWrite( 12, HIGH );
}

void loop( )
{

}

I am out of ideas so all help is appreciated, thanks.

(deleted)

spycatcher2k:
have you tied pin 1 to +5v with a 10k resistor, and got caps on the power lines?

Drew.

Yes, I do. After my further testing this just got much more interesting. With following sketch I got 2Hz blinking led:

setup( )
{
     delay( 500 );
     pinMode( 12, OUTPUT );
     digitalWrite( 12, HIGH );
}

And with following 1/3 Hz blinking led:

setup( )
{
     delay( 3000 );
     pinMode( 12, OUTPUT );
     digitalWrite( 12, HIGH );
}

What came to me first was obviously that the setup was treated like loop. After that I realized that could it be somehow possible that the high on the pin 12 would cause the reset, no idea though how could this happen as I have not tied the pin 12 to pin 1. Reset would need though be tied to GND and as I leave the pin12 high that does not make sense either. This seems more than weird. I am going to test this with another digital pin, just to make sure.

Do you have a series resistor with the LED?

Did you change the clock source (via fuse settings)?

[quote author=Coding Badly link=topic=63807.msg464123#msg464123 date=1307906874]Do you have a series resistor with the LED?
[/quote]
Yes, I do.

Fuses are default.

I tested this with another digital pins and they acted the same. So I can now pretty much verify it is not my circuit doing this but the software somehow resets the chip after setup. Can this be because of the incompatibility of atmega328 and atmega328p?

(deleted)

Coding Badly, you saved my day.

It was my circuit, have to admit. Your series resistor with the led did it. I obviously had a resistor ( 220 Ohms ), I do not know what is up with the led but that was not enough. I threw there 33K resistor and the circuit stopped resetting and led is slightly dimmed. I just measured the resitor and it came 227 Ohms. I do not know what is up with these leds, probably better buy some decent ones next time. Thank you.