Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: 555 timer chip guy on June 06, 2007, 01:20:05 PM
-
can a circuit designed for the ATMega8 also use the 168 because the ATMega168 is faster and is more powerful but I cant fine a circuit for it, all the circuits I fined are for the ATMega8! >:(
-
The ATmega8 and ATmega88/48/168 family are pin compatible. So you can use the ATMega168 as a drop in replacement BUT your code might not work correctly, since the memory mapped port addresses would've likely changed. Read the appnotes for changes in the design:
http://www.atmel.com/dyn/resources/prod_documents/doc2553.pdf
Note that the appnote only discusses the ATmega88, there might be changes in b/n the family members (88/48/168) so it will also be better to read the data sheets.
HTH.
- Rommel
-
555 guy, if you look at my $50 Robot code (http://www.societyofrobots.com/downloads/sbs_source_photovore_v1.zip) you will notice a section called CONFIGURE PORTS in the SoR_Utils.h file.
In that same file you will see lines such as PORT_OFF(PORTD, 4);
In the makefile file you will notice a line that says:
# MCU name
MCU = atmega8
If you modify each depending on your needs, your code should work for any AVR.
-
thank you