upload an arduino created sketch into an atmega48v

I have a bunch of Atmega48V chips that i'd like to use for some of my projects. I'd like to use the arduino IDE to create a sketch, compile it and then upload the final .hex file into the Atmega48v. I have the STK500 so uploading to the chip will not be a problem.

But i am not sure how i would go about creating a sketch for the mega48? Because the arduino i have runs at 16mhz and max freq for the mega48 is 10mhz.

help!

Call it a lilypad variant and run it at 8MHz, not 10.

The 48 has no bootloader capability, so you'll have to use an external programmer to download, and create a corresponding boards.txt entry to get a target on the IDE menu.

-j

"Call it a lilypad variant and run it at 8MHz, not 10.

The 48 has no bootloader capability, so you'll have to use an external programmer to download, and create a corresponding boards.txt entry to get a target on the IDE menu."

Thanks !!. But i did not follow what you meant by "create a corresponding boards.txt". I believe that arduino IDE dumps out the .hex file, right? which i then use say AVR studio to load into the chip (I have the STK500 programmer).

boards.txt (on my mac it lives in /Applications/Arduino.app/Contents/Resources/Java/hardware/boards.txt) defines the “boards” that the IDE supports. Every entry you see in tools → board has a set of parameters defined in boards.txt for the processor type, clock speed (no you can’t make it arbitrary), programmer type, etc.

You’ll need to create a board type for your 48V and programmer combination, so when you go to compile and download, the correct code is generated and the correct avrdude flags are present to download the code to the board.

I’m pretty sure the latest arduino knows about the 48; I used a 48 on a previous project (although IIRC I used the 48 at 16MHz, not the low voltage/low speed version you apparently have).

-j

ohh... Thanks !

One more question. Can i get arduino to compile my sketch for a target board that i specify and dump out the hex file, without connecting any arduino hardware?. Or do i need the hardware to get the IDE to compile the sketch...

you mentioned avr-dude. Now if i am using avr-dude, i dont need stk500, right?. I guess in that case i make one of those parallel port drivers so that arduino can handle compiling the code and uploading the code to the chip using avr-dude. Is this correct?

Thanks!

am using avr-dude, i dont need stk500, right?

You have to have some piece of hardware to program the device. avrdude is the software that the Arduino IDE uses to program a target. The "hardware" that avrdude normally uses is the Arduino ATmega's onboard bootloader.

I guess in that case i make one of those parallel port drivers so that arduino can handle compiling the code and uploading the code to the chip using avr-dude.

Theoretically, yes. I have personally found the parallel port programmers to be extremely problematic.

-j