Go Down

Topic: Can I use object code from Arduino on other AVR (Read 2357 times) previous topic - next topic

View[+]Finder

Maybe a dumb question, but is it possible to load Arduino output object code onto another ATMega8 processor.  I want to develop an app using Arduino IDE and use it on a non-Arduino AVR (same chip, different board).
Thanks

ritzdank

for sure, verify that your fuse bits are correct set. and that you are using an external oscillator with 16mhz. then load up the bootloader with stk500 or AVRisp. good explanation is also here; http://www.arduino.cc/en/Main/StandaloneAssembly

View[+]Finder

Thanks for the quick answer!  Just to make sure I'm clear, there are two options: one, load the Arduino-produced object (the .hex file?) onto a non-Arduino board (like the breadboard in the example) using the Arduino IDE; and two, load the object onto another board using some other loader for AVR chips.  I was assuming that I needed to do the latter, but it appears from the example that a chip with its fuses set properly and the right clock can be loaded from the Arduino IDE.  That simplifies things considerably if true.  Am I missing something?

Very helpful!

mellis

It should work.  You just need to figure out which Arduino pins map to what in your circuit.  This diagram may help: http://www.arduino.cc/en/Main/PinMapping

neillzero

#4
Nov 15, 2006, 04:53 am Last Edit: Nov 15, 2006, 05:02 am by neillzero Reason: 1
If your target is actually just a non-arduino board, rather than necessarily a non-arduino AVR, then I understand there's another approach to consider which doesn't involve any fuse-setting, bootloader installation, or need for other programming hardware.  It is perhaps the simplest approach, though it has its downsides.

You can buy atmega8 and atmega168 chips already made arduino-friendly with the bootloader on them, etc.
You can drop one of these chips into an arduino board, develop and program with the arduino IDE until you're happy, then take the chip out and pop it into your custom circuit.  (I think it should also be possible to program such a chip in-place in the custom circuit, by utilising the tx and rx connections of an arduino board with its atmega chip removed).

There's a drawback to this approach: because you'll have the arduino bootloader on the chip, there'll be the 5 second delay at power-up (or reset) while the bootloader pauses to allow any new program to be loaded.  It's up to you and your intended application as to whether or not this is acceptable in development and in production.  Also, you lose 1k of the program space to the bootloader.

Where to get atmega8 or atmega168 chips prepared for arduino:
* In europe, pcb-europe.net.
* In the US the arduino community member "BigFun" has offered to supply atmega168 - perhaps he'll supply atmega8, too.  (See this forum posting).

Consider using the atmega168 chip instead of the atmega8 as it gives you 16k of program space instead of the atmega8's 8k, and only costs around 1 US dollar more.

While the main hardware page has a few key links on atmega8 standalone, there's definitely some missing documentation.  I've started to gather stuff on a new wiki page:
http://www.arduino.cc/playground/Learning/AtmegaStandalone

good luck!
neill

View[+]Finder

Thanks to all.  With the good advice above and a bit of digging into the AVR datasheets, I've solved the problem: my Arduino program is now running on another board with hardware features not available on the stock Arduino board.

n0mad_xak

Quote
Thanks to all.  With the good advice above and a bit of digging into the AVR datasheets, I've solved the problem: my Arduino program is now running on another board with hardware features not available on the stock Arduino board.


So, please can you tell us how did you solve problem? Thank you!

Go Up