Pages: [1]   Go Down
Author Topic: Atmega8 is periodically resetting itself after writing bootloader  (Read 1372 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, I have a single-sided Arduino S3V.3 R.2 with an Atmega 8.
I burned the bootloader with Arduino 0007 using 9V battery power and the dapa parallel programmer cable. (http://arduino.cc/en/Hacking/ParallelProgrammer)
Also, I had to temporarily remove the resistor of pin13 LED because it drew too much current from my weak LPT1.

Then everything seemed fine:

Code:
Atmel AVR ATmega8 is found.
Writing lock bits ...
Reinitializing device
Atmel AVR ATmega8 is found.

Lock Bits set to 0xff
Atmel AVR ATmega8 is found.

Fuse Low Byte set to 0xdf

Fuse High Byte set to 0xca
Atmel AVR ATmega8 is found.
Erasing device ...
Reinitializing device
Atmel AVR ATmega8 is found.
Uploading: flash
Verifying: flash
Atmel AVR ATmega8 is found.
Writing lock bits ...
Reinitializing device
Atmel AVR ATmega8 is found.

Lock Bits set to 0xcf

But when the board is powered up or resetted, LED13 blinks shortly, as it should, then waits for approx. 9 seconds and blinks again, and so on...

Even with nothing but 9V connected to the board, Auto Reset jumper off, serial jumper off and 120ohm resistor from Reset to +5V. Reset pin is at about 4.6V constantly.

When I try to upload a sketch via COM, LED13 also blinks in the same intervals, also while TX LED is flashing - needless to say I'm getting "programmer not responding".

What could I do? I couldn't find people to have experienced this problem before here!


P.S.: Why are the lock bits for Atmega8 0xcf in Arduino 0007, but 0x0F in Arduino 0022 and the online documentation??!?

I tried to burn the bootloader in 0007 with the lock bits changed to 0x0F, but in the end I got "Warning: lock bits write=0x0F read=0xcf"
 so I did it again with 0xcf.
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Avrdude has a peculiar way of reporting back 'reserved' bits. Have a look at: http://www.engbedded.com/fusecalc

Do you have decoupling capacitors connected between Vcc and GND (100nF + 10µF) ?
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1325
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you got a 10k resistor from +5v to pin 1? if not then its floating - causing random resets.

Also the bootloader should blinks every second not every 9. You may have the wrong fuse settings. Also you don't mention a crystal/resinator in your setup, are you using one? if not you chip is running at 1Mhz - if you want to update to 8Mhz (with no crystal) or 16Mhz (with crystal), you need to change the fuse bits.  

For 8Mhz - No ext crystal
High fuse - 0xD9
Low fuse - 0x64

For 16Mhz - Ext crystal
High fuse - 0xD9
Low fuse - 0xCA

Remember lock bits - unlock=0x3F
                                 lock=0x0F


Hope this helps


Drew.
« Last Edit: April 11, 2011, 09:23:36 am by spycatcher2k » Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Pages: [1]   Go Up
Jump to: