Go Down

Topic: Another case of bootloader problem (Read 736 times) previous topic - next topic

Ro-Bot-X

Hello all, I am a Bascom-AVR user (not very experienced...) and I wanted to start working with a C environment and Arduino looks like a good transition, since it is eazy to work with. I have a board made by me for a mobile robot a couple of years ago that uses ATmega8 and is Arduino compatible. I have a STK200 dongle that I am using with Bascom with no problems. I have also built the Parallel programmer from your website. Now here is the story:

I set the fuses to work with a 16MHz crystal in Bascom (using the STK200 dongle). Then I uploaded a simple Led Blink hex file and it worked great. I changed the dongle with the Parallel programmer and opened Arduino(v.10) and tryed to upload the bootloader for the ATmega8 (older board w/atmega8). It didn't work. After looking through the bootloader files, I have found a batch file with commands to burn the bootloader using uisp. I tryed the burnpara.bat file but it didn't work. I have opened a cmd window and read the uisp help file and found that I can use my STK200 dongle. I have changed the burnpara.bat file and it burned the bootloader. The LED started to flicker fast then a few seconds pause and repeat. I connected the serial dongle and tryed to upload the sample LED Blink sketch. It didn't work, saying wrong signature. Then I tryed to burn the blink.hex file using uisp. It worked. But no more bootloader... So I uploaded the bootloader again, verified corectly. But I still wasn't able to use the Arduino environment. Then I tryed with Bascom and surprise, it couldn't read the chip!!! Same thing like avrdude, device ID=ffffff... But I am able to use uisp to upload any hex file I made in Arduino!

Thinking that I will be better if I will get a ATmega168, I bought one and did the same as with the mega8! Set the fuses in Bascom, worked for a while with uisp to load the hex files since I was afraid not to loose this one too, then I wanted to try the bootloader again since it is a pain to click on the button to upload to the board, wait for the error message, go to a command window and upload using uisp... So, I changed the burnpara.bat file to work with atmega168 ant to write the corect values for the fuses as per instructions on your website (lock fuse to 0x3F, e=0x00, h=DD, l=0xFF and the lock fuse to 0x0F) and uploaded the ng bootloader. It verified corectly. But it happened the same thing as with the mega8, it didn't work from the Arduino environment and the chip doesn't give the corect signature again...

Reading the fuses with uisp I get this:
D:\Robotics\RoboProjects\Arduino\CDbot>uisp -dprog=stk200 -dpart=ATmega168 -dlpt=0x378 --rd_fuses
Atmel AVR ATmega168 is found.

Fuse Low Byte      = 0xff
Fuse High Byte     = 0xdd
Fuse Extended Byte = 0xff
Calibration Byte   = 0xbc  --  Read Only
Lock Bits          = 0xcf
   BLB12 -> 0
   BLB11 -> 0
   BLB02 -> 1
   BLB01 -> 1
     LB2 -> 1
     LB1 -> 1

So, the extended fuse is wrong. I can't see the signature fuse, but I suppose it is wrong too. I can modify all fuses except the extended fuse. This is the reason it still works with uisp (I guess). Is there any way to modify the fuses back to factory values? Reading the datasheet I get that they should be like this: e=0xF9, h=0xDF, l=0x62. The low and high fuses changed but the extended fuse is still 0xFF.

Any ideeas how to fix these 2 chips?
Any help is greatly appreciated!
Thanks in advance!

adilson

You said you used Arduino 0010.
I've had problems with device signature with 0010/Atmega8/PC WinXP/Parallel Port Programmer. And another problem: the bootloader delayed 10minutes.

But with the same hardware configuration and 0011 version to burn bootloader works fine.

Can you try the 0011 to burn the bootloader?

Ro-Bot-X

I can set the high and low fuses with uisp, I can program the bootloader with it, but avrdude does not recognize the chip. Oh well, I'll wait another month or so untill I'll be able to buy a Diecimila loaded mega168.

Mean while, is there any possibility to change the avrdude with uisp in IDE? So that when I press the upload button the uisp loads the generated hex file into my chip? It would be a blast!

Thank you for your help!

Go Up