How would I go about doing that?
You can download the code from: http://www.arduino.ws/. Go to upload > software > bootloader_v5. You need to change AVR_FREQ in the Makefile and recompile with make. You'll also need to make sure the avr tools are in your path.
I am a bit confused due to the sometimes conflicting information.
Which ISP programmer will work and which one won't? Can I get away with using a quick and dirty parallel programmer? What about all those non-Atmel programmers which claim to be STK500 or AVR ISP compatible (but sometimes have additional features, like USB)? Don't want to spend lots of money on an Atmel serial programmer when I can get a compatible one with USB for a fraction of the money. And then it supposedly seems to depend on which OS and programming software you use... Too much input.
So what's the consensus for the most reliable and cheapest idiot-proof programmer out there? Can't hurt if it's available locally so it doesn't need to be ordered abroad which usually adds a lot of taxes and postage.
I did the easy part and changed the makefile, but I don't know what you mean my recompiling with make. What is make? and which avr tools are you talking about? Should I be doing this in UNIX or something? I think I'm missing a very critical step.
Are you on Windows? You could try downloading WinAVR and using that to compile the bootloader. Alternatively, you could just use a 16 MHz clock. Or since, you have a hardware programer (at least, I assume you do, since you need one to get the bootloader onto the chip), you could just burn your code directly to the chip without using a bootloader. See: http://www.arduino.cc/en/Hacking/Programmer
I'm a windows user but have an intel mac at my disposal (I just don't know how to use it very wll). I was hoping to use the bootloader so I could update the code quickly and easily. I think I was able to compile the new make file, but my new hex file has a very long name (ATmegaBOOT_168_CRUMB168_F20000000_050815.hex), and I'm not sure I trust it. I was only ever able to upload the bootloader using AVRdude on the mac, but I think I'll see if WinAVR can get it to work. Any suggestions on how to make that happen? I tried AVRstudio that came with my hardware programmer but wasn't able to get it to work either.
Hi
On the Mac I use AVR Stdio, running under Parallels Build 3150. With the AVR ISP MKII programmer , it works like a charm. You can get parallels free as a trial, so the only real outlay is the AVRISP, which runs about 35USD. Pricey, but it works.
D
I've tried using AVR studio with my AVRISPmkII, but when I try to connect to my Atmega168 I get an error:
"ISP Mode Error" and it recomends I lower the ISP programming frequency specified on the board page. Well I've tried everyone of those and it still gives me the same error. I find that odd since all the LED's are green. I can't change any fuses or lock bits because it gives me that same error. What's going on here?
I probably shouldn't be posting here since I obviously have no clue, I guess I'll do it anyway...
You mentioned:
ATmegaBOOT_168_CRUMB168_F20000000_050815.hex
The Crumb168 is a microcontroller module similar to the Arduino Mini
Are you sure this bootloader will work with the Arduino? Do they both use the same bootloader?
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.
D.