Go Down

Topic: How to make sketches for atmega48, + fuse settings (Read 931 times) previous topic - next topic

raron

Hi!

I was just wondering what needs to be changed in the Arduino 0017 IDE to make hexfiles for the atmega48. As I understand it, atmega48,88,168 and 328 are pincompatible and pretty much similar, except that the 48 doesn't have support for a bootloader. And of course, smaller memory.

What I'm wondering about is which files needs to be changed, and what changes, to support an atmega48.


Also, where does the hexfiles go? It seems they don't always end up in a subfolder under the project folder, or that any project folder is always made - I'm not sure when, probably before uploading a sketch? But as I can't do that to an atmega48, I guess they are never made - but I'm not sure how this works.


Fuse settings:

I did try to compile a sketch for the 328, nothing fancy just some blinking of LED's, and uploaded to a atmega48 via avrdude and mega-isp, but, of course, it didnt' work.

First fuse settings was low fuse = 0x62, high fuse = 0xDF extended fuse (is this neccesary?) 0xFF (standard from the fuse calculator at http://www.engbedded.com/fusecalc/

Second time I set the low fuse to 0x61, thinking this would be the external oscillator and at 16MHz. "low power oscillator", according to page 29 of the AVR 48-88-168 datasheet table 6-3. Also SUT (Startup time) for "ceramic oscillator, fast rising power", table 6-4 below.

I didn't set any lock bits.

I guess there are compile differences between the 328 and 48 too?

bill2009

#1
Oct 01, 2009, 12:49 am Last Edit: Oct 01, 2009, 12:57 am by bill2009 Reason: 1
can't help with the '48 but as to the .hex location, if you launch the upload the .hex does get put into the sketch folder.  It takes the upload attempt though, not just the compile button.

at it's simplest, what happens if you create a small sketch with the ide set to 168 and upload it to the 48 via avrdude/programmer?

raron

Thanks for the reply. Since I use an arduino to program another arduino via ISP (mega-isp http://code.google.com/p/mega-isp/), I have to remember to unplug it before "attempting" to upload a sketch then.

It was a no-go for the '168 as well. Well, unless the fuses are wrong, this time I left it at standard(?) lfuse: 0x62 hfuse: 0xDF and efuse (0x01) (read via avrdude).

Go Up