Hi, I have an orangutan mega8, which my program runs on. The program contains interupts, LCD display, ADC, and delays.

I have made a circuit to run the program when it is finished on a breadoard, but with the mega168.

What changes have to be made to a progam between the mega8 and 168?



Migrating code from the mega8 to the mega168 is pretty straightforward, since the mega168 has all the hardware features of the mega8 and more.

If you’re using AVR Studio you will need to change the device listed in the project configuration options changed to the atmega168 and recompile the code into a new .hex file. It might compile just fine, but you will probably need to make slight changes to hardware register names (this was the problem you ran into here). You can look at the register names on the AVR Studio device simulator (which you will also need to switch to the ATMega168 by going to Debug->Select platform & device, and selecting the AVR Simulator and ATMega168), or the ATMega168 datasheet.