Author Topic: ATMega switch out  (Read 6324 times)

0 Members and 1 Guest are viewing this topic.

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
    • Robots and Circuits
ATMega switch out
« 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! >:(

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: ATMega switch out
« Reply #1 on: June 06, 2007, 02:03:42 PM »
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
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: ATMega switch out
« Reply #2 on: June 06, 2007, 04:47:33 PM »
555 guy, if you look at my $50 Robot code 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.

Offline 555 timer chip guyTopic starter

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
    • Robots and Circuits
Re: ATMega switch out
« Reply #3 on: June 09, 2007, 04:32:32 PM »
thank you

 


Get Your Ad Here

data_list