The strange tale of an Xmega128a4u

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

I have 3 Xmega128a4u chips and one 256a3bu.  One of the 128a4u chips is different from all my other Xmegas.

 

All the others have the 32kHz RC oscillators calibrated correctly at the factory.  Apparently the "correct" setting is within 0.25% based on what I've seen and in the observed granularity of the frequency adjustment.  This strange chip ran 1% slow.   That wasn't a big deal.  At that accuracy the USART and USB ran fine.  But being a perfectionist (occasionally smiley), I bumped up the frequency adjustment by 2 to give it the "correct" frequency.  I stored this setting in the User Sig Row and I apply it every time after reset.

 

I subsequently used that chip for software development for several months and all was well.  Then about 10 days ago something happened.   I found neither the USART or USB was working.  Then I discovered the 32kHz RC oscillator was running 5% fast.  This change happened that day.  I use the USART and USB every day and I measure the RC oscillator frequencies often.  This change didn't sneak up on me gradually.

 

I set the frequency correctly again by decrementing the freq. adj. setting by 16.  I stored this new value in the User Sig Row and it has been working fine ever since.

 

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

The RC oscillator is affected by supply voltage and temperature. Did anything change at all?

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

mojo-chan wrote:

The RC oscillator is affected by supply voltage and temperature. Did anything change at all?

No.

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

Ghost in the machine!

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

Could be a dud micro... Or maybe the code accidentally overwrote that register, or cosmic rays, or... Did the micro reset and not reload the register with your calibrated value?

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

I don't know the exact circumstances when the frequency shift occurred.  I was developing software and testing it with this chip.  The shift could have happened when I re-programmed the chip or it could have happened while testing it, or it could have happened when I reset the chip or whatever.  I may have had my JTAGICE mkII connected to the board at that time.

What I do know is I now use the latest freq. adjustment value I put in the User Sig Row.  Following each reset I use that value, and it gives me the correct frequency.  Subject to change without notice, of course.  smiley

 

I think this was a freak chip from the factory.  Of course it is possible that I zapped it with ESD or by not following the protocol when connection or disconnecting my JTAGICE, etc.  The chip seems to work fine other than this changing 32kHz RC osc. calibration value.

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

Did you accidentally change to "erase entire chip" (thus clearing your calibration value) instead of "erase only program area" (or whatever)?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think even "erase entire chip" doesn't clear the user signature row. You have to issue a very specific command to clear it.

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

Yes, the User Sig Row was intact.