Go Down

Topic: 168 Bootloader Error (Read 6737 times) previous topic - next topic


well I think I must have done something drastic to my 168. AVR dude tells me it's having trouble communicating with the programmer and that there is an invalid device signature. I haven't even got around to trying to put the new bootloader on yet. Just out of curiosity, why would people want to use a 168 with a slower clock? Isn't the 20Mhz oscillator one of the major advantages of the 168 over the regular 16? Thanks!


Well when I changed the makefile, the only thing I changed was the oscillator frequency. I think the reason the name is so long is because it saves it according to program, product, and build parameters in the makefile. It seemed to work ok when I was just using the standard 16Mhz osciallator.


The name of the .hex file should be fine.  It's got CRUMB168 because it originally came from the crumb168, but it's been adapted to work with the Arduino.  I'm not sure what to suggest about your problems with the 168 chip though.

The ATmega168 has a number of advantages over the ATmega8: twice as much flash (program space), and extra PWMs, and the 20 Mhz clock.


That's what I thought. As for the 168 chip, could it be that while trying to use AVR studio I set some kind of fuse to require an external oscillator? I think I saw someone with that problem on AVR freaks. If it's dead then I'll just have to get another one I suppose.


If you're trying to run the ATmega168 at 20 MHz, then, yes, you need an external oscillator.  It's likely that you've set the fuses to require one, as most of the documentation tells you to, and the scripts do so.


I was hoping that because the chip gets it's clock from the programmer during programming, I could still use the arduino007 environment to program it. It's likely that I screwed up the order and set the fuses to take a 20MHz clock before I updated the bootloader. Now I can't get the chip to talk to anything. I don't know how to set the fuses back or get the updated bootloader on there. Any ideas?


If you set the fuses to take a 20 MHz clock, you need to connect it to a 20 MHz clock (or a 16 MHz clock).


I haven't built any kind of USB or serial interface for the breadboard. Even if I did, all I've got are oscillators and not an actual external clock. I think it's time to just get a new chip and start using the new make file from the very beginning.


Sorry, the oscillators should be fine.  Do you have an Arduino board?  If so, the chip should work in that, since it has the 16 MHz oscillator/clock.


ya, I have the arduino usb board with the built in 16Mhz clock. It was working in that until I tried to put the new bootloader on it. I don't think I even got the new recompiled bootloader on there before I did something to break the chip and prevent anything from connecting to it.


Hi amsmnptarks,

I got a 20 MHz bootloader loaded successfully on a 168 on an Arduino NG.  I compiled the same thing you did, then put it on a virgin 168 using AVRStudio and my Dragon.  I moved the chip to an Olimex P28 with a 20-MHz crystal, and it ran and I was able to download a program to it.  However, when that program tried to do serial output to my PC, it didn't work - obviously the clock messed up the baud rate.  I run Arduino on my P28 all the time at 16 MHz and it works fine - maybe I'm forgetting something.

It would be nice to be able to use all the speed the 168 is capable of!  I'm not sure if this would work on the Arduino board if I changed the crystal - I didn't want to unsolder it.



   Once you get the fuses set right youl breze through the rest. Youve just got to make sure youve got the right file after that. Try find a toutorial based on the software your useing. I can send you a 168 with a bootloader on it for 7.00 or you can send me your chip and $2 to program for you if you like. The offer stands for anyone who needs it. Im in the high power rocketry club and we should have a section set up on our website for this offer soon. (www.ncsuhpr.co.nr). We now have paypal too  8-)

Joshua McCoy
aerospace engineering student


drd: did you change the build.f_cpu setting in your Arduino preferences file?  Otherwise, the Arduino sketch will expect to run on a 16 MHz clock, and the serial timing will be off.  See: http://www.arduino.cc/en/Hacking/OtherHardware


Thanks, mellis!  That was it - now everything works fine at 20 MHz.


I am having a hard time find exactly how to burn the bootloader.  I have a STK500 board, Arduino with 168.  Having the STK500 seems to be an advantage but I can't find the what fuses need to be set and should I use AVR studio or AVRdude or the Arduino software.  I have all the tools I just need some help getting this done.

"Who left the fridge open?"
-Tugg Speedman
(Scorcher VI - Global Meltdown)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131