You are not going to believe this!

i tried a test program, disabled analog, turns all ports to output, sets all ports to low and then enters the same loop to toggle the LED... SIMPLE!
It failed and locked up...

so i asked myself, what is the diference between the 3mm red LED on PORTB.7 and the one on PORTD.0? so i switched them over... same result...

Just for the hell of it, i switched the resisters over and tried it... and it works!
I switched the resisters back and it locks up...

I took the suspect resister out and stuck it on my multimeter... it read less than 1ohm!
The resisters are supposed to be 68 ohms... this one is a faulty one...

So, the problem must have been caused by too much current through one of the IO lines...
I have lost 4 days trying to debug a problem caused by a 5 pence component that i would have never suspected if i was anywhere near sane!

So now i'm going to re-enable all my code and try it... god darn it!