| Author |
Message |
|
|
Posted: Mar 19, 2011 - 12:55 AM |
|

Joined: Feb 27, 2011
Posts: 9
|
|
| In a spirit of helpfulness, I've attached a short program that sets up and demnostrates the XMEGA 1 Hertz interrupt. I just finished wasting four days of my life coming up with it, so I hope it'll save someone else as much time. |
|
|
| |
|
|
|
|
|
Posted: Mar 19, 2011 - 03:17 AM |
|

Joined: Nov 17, 2004
Posts: 13960
Location: Vancouver, BC
|
|
| You do realize that using the internal oscillator to run your RTC will mean that it is not very accurate, don't you? |
_________________ Regards,
Steve A.
The Board helps those that help themselves.
|
| |
|
|
|
|
|
Posted: Mar 19, 2011 - 10:11 AM |
|

Joined: Feb 27, 2011
Posts: 9
|
|
Indeed, it isn't at all accurate. It happens that my breadboard has a GPS receiver right next to the XMEGA32A4. The receiver has a 1 PPS LED, too. When I saw the two LEDs' blinks going from in phase to 180 degrees out of phase, then back to in phase within two or three minutes, I started to investigate.
It turns out Atmel's +/-0.5% accuracy spec for the 32.768 khz oscillator assumes a temperature of 85 C and a 3V power supply. At room temperature with a 3.3v supply, the 32.768 khz oscillator is actually running at around 32 khz.
(I only started fooling around with Atmel processors in December, and XMEGAs last month, so I'm still not up to speed.) |
|
|
| |
|
|
|
|
|
Posted: Mar 21, 2011 - 08:46 PM |
|


Joined: Oct 30, 2008
Posts: 333
Location: Minnesota, USA
|
|
|
|
|
|
|
Posted: Mar 21, 2011 - 09:40 PM |
|

Joined: Nov 17, 2004
Posts: 13960
Location: Vancouver, BC
|
|
|
Quote:
It turns out Atmel's +/-0.5% accuracy spec
But even if it were within the 0.5% it could still be off by 7 minutes a day. For RTC accuracy you need a crystal. |
_________________ Regards,
Steve A.
The Board helps those that help themselves.
|
| |
|
|
|
|
|
Posted: Mar 08, 2012 - 09:28 PM |
|

Joined: Jan 31, 2012
Posts: 129
Location: Vancouver, BC, Canada
|
|
| I know this post is a little old, but I was wondering which XMEGA you are using. In the errata of the A3BU it says the TOSC is busted. I'm basically trying to figure out if my code is wrong is if I am trying to lock the barn after the horse escaped. |
_________________ ATMega644a
XMEGA-A3BU
JTAGICE3 Programmer
AVR Studio 5.1.148
FLIP 3.4.5 Build 106
|
| |
|
|
|
|
|
Posted: May 14, 2012 - 04:30 PM |
|

Joined: Dec 28, 2011
Posts: 10
Location: Madrid, Spain
|
|
In my case, every 50 minutes the RTC of my ATXMega128A1 is being delayed 22 seconds, aprox ... more than 10 minutes a day, or 0,6% of cumulative delay ... I am resyncing against a time server, but it is a relevant drift, more than I could imagine ...
I'm using the 1 Hz tick option.
Well, thank to rmutter I have known about the frequency drifts at normal temperature conditions, I am going to study this http://www.atmel.com/Images/doc8277.pdf. |
|
|
| |
|
|
|
|
|
Posted: May 14, 2012 - 04:44 PM |
|


Joined: Jul 18, 2005
Posts: 62944
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
or 0,6% of cumulative delay
But that's well within spec. for an Xmega. It's spec'd for +/-1% so count yourself lucky that you are actually getting a more accurate result.
For 30-50ppm accuracy add quartz.
For 2-5ppm added a temperature compensated external RTC chip to the design. |
_________________
|
| |
|
|
|
|
|
Posted: May 14, 2012 - 06:23 PM |
|


Joined: Nov 11, 2003
Posts: 4040
Location: Chicago Illinois USA
|
|
| Yes, while internal RC oscillators are accurate enough for many applications, they make terrible timepieces. Even the worst watch is fantastically accurate in terms of % error. |
_________________ Discursive design,
Torby
Some days, it's just not worth chewing through the restraints.
|
| |
|
|
|
|
|