I have been leaning about uCs and messing around with an ATmega 168 trying to get the uart working. I am running a little 'hello world' code blinking an led and messed with the delay time for the output. I slowed it down so it blinked once a second or so, very slow. But when I tried to talk to the AVR after I slowed the code down, I could only get a successful init every 1/10 tries or so.
I changed the code back to the shorter delay and after pounding on the up-arrow and enter a few dozen times, it finally initialized, re-flashed and is acting normally.
Could I not init/talk to the uC because I kept hitting it when it was in the long delay? Is there a flag I can use to fix this problem, or is that just really bad code?
If it matters, I'm using a usbtiny programmer.
I'm just looking for a little explanation on what exactly was going on and maybe gain a little knowledge. Thanks a ton!
I changed the code back to the shorter delay and after pounding on the up-arrow and enter a few dozen times, it finally initialized, re-flashed and is acting normally.
Could I not init/talk to the uC because I kept hitting it when it was in the long delay? Is there a flag I can use to fix this problem, or is that just really bad code?
If it matters, I'm using a usbtiny programmer.
I'm just looking for a little explanation on what exactly was going on and maybe gain a little knowledge. Thanks a ton!