Mega168A different from 168?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I have a project that uses a Mega 168A. I developed on a MEGA168 and everything worked fine. I switched to a Mega168A because money, and now the code is broken. It appears one of my 2 ADC inputs is getting corrupted somehow. Maybe a timing issue with the mux?  I am using interrupts to read the ADC results and a software timer to start the conversions.

 

Are there any differences between the 168 and 168A that would cause this?

 

-t-i-m-b-o-

Tim Ressel
Portland, OR
timr@earthling.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not really.  I suspect that the system clock of the new Mega168A is different from the previous 168.  These ICs come from the factory with the internal clock (8MHz) enabled and the Divide-by-8 fuse activated (logic low).  Here the term "fuse" refers to internal 1-bit non-volatile configuration settings of the AVR.  The fuses can be changed with an ISP programmer; even a USBasp module board that sells for a few dollars on eBay will work OK.  For the USBasp, you will need to install a driver for Windows and for Windows 10, you also need to turn off the Driver Signature Verification in order to install this driver.  Google for gory details.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Atmel have an app note about 168 to 168A transition. AFAIK it's simply a die shrink because they switched fabs and hence fab geometry. I think the note will tell you that A is a little more susceptible to noise. (smaller geometries always tend to be).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This very old post might have a few tidbits of info..the chip itself should match up good. They recommended just calling it a mega168..not sure if any of this still applies or applies to you

 

https://www.avrfreaks.net/forum/atmega168-vs-atmega168a-compilationexecution

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you checked the migration app note?

http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591126

 

 

 

And the datasheet:

 

Although this may not apply to your app.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Tue. Feb 20, 2018 - 06:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using studio 7 and have set the fuse bits to disable the divide by 8 and to enable the external crystal.

Tim Ressel
Portland, OR
timr@earthling.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I cannot find that app note. Number?

Tim Ressel
Portland, OR
timr@earthling.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am not using the ACME bit, but thanks for trying!

Tim Ressel
Portland, OR
timr@earthling.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found it! Thanks!

Tim Ressel
Portland, OR
timr@earthling.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I linked to it in #5

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]