3
\$\begingroup\$

I have an arduino UNO running my code perfectly. Now I want run the same code on an Atmega8L-8PU which is connected on a breadboard. Is it perfectly reliable to use this Atmega8 instead of the Atmega328 (if the compiled code is less than 8kb)? Also please tell me how to easily transfer the compiled code to this breadboarded Atmega8?

\$\endgroup\$
6
  • \$\begingroup\$ You should be able to pursue the process of compiling the code for that processor without actually having one; unless you find someone's existing writeup you will likely have to learn about how to specify compilation options within the arduino IDE and perhaps make some changes to the library device-specific conditionals. If you produce a proper output file for this device, you can probably use your arduino to flash it using the arduino ISP sketch. \$\endgroup\$ Dec 9 '11 at 17:55
  • \$\begingroup\$ @ChrisStratton can u please shed some more light into those process? \$\endgroup\$
    – 0xakhil
    Dec 9 '11 at 17:59
  • \$\begingroup\$ @Oxakhil - not without attempting the project for you; I'm telling you how I would approach it if it were my project. \$\endgroup\$ Dec 9 '11 at 18:01
  • \$\begingroup\$ Is there an option in the IDE where I can choose the MCU for which the code should be compiled? \$\endgroup\$
    – 0xakhil
    Dec 9 '11 at 18:08
  • \$\begingroup\$ Yes, the dropdown list of boards comes from a system-wide or user-specific boards.txt file. I see an entry for an atmega8 as used by older arduinos; the data sheet (which I should have checked earlier, sorry) doesn't seem to indicate an idcode difference between the 8 and 8L, so that may work. \$\endgroup\$ Dec 9 '11 at 18:34
3
\$\begingroup\$

The short answer is that it should be no problem at all... in fact in the off-the-shelf Arduino IDE, if you select from the menus: Tools => Boards => Arduino NG or older w/ ATmega8. It will compile your sketch for the ATMega8. Furthermore, if you hold down the Shift key when you click the Compile button, the IDE will show you the path to the temp directory in which your compilation artifacts are created. Assuming you know how to burn a HEX file to an AVR and set the fuses for your crystal, you should be able to take it from there...

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.