[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-chat] Endless loop in AVR?
From: |
Wojtek Dabrowski |
Subject: |
[avr-chat] Endless loop in AVR? |
Date: |
Sat, 28 Jul 2007 10:04:49 +0200 |
User-agent: |
Thunderbird 2.0.0.5 (X11/20070716) |
Hello everybody!
I have a funny problem here. This is the testing code that I tried to
put onto my ATtiny2313:
int main(void) {
DDRD = 0xff;
PORTD = 0xff;
while(1) {
}
return(0);
}
The way I understand it, after a reset, all the diodes on port D should
light up and stay on - I've got an infinite loop there, right?
Funny thing is, the diodes light up when I press the reset button, but
as soon as I let go, they go off again. It looks like the uc is so fast
that it finishes an infinite loop in a fraction of a second ;)
It can't be the optimization - I've compiled it with -O0, and the same
thing still happens.
Any idea what I may be doing wrong?
Thanks a lot in advance,
-Wojtek
signature.asc
Description: OpenPGP digital signature