Author Topic: AB1805 RTC - accuracy  (Read 2256 times)

Tomme

  • NewMember
  • *
  • Posts: 24
AB1805 RTC - accuracy
« on: March 31, 2018, 12:23:37 PM »
I was considering hijacking an existing thread on these but I thought I may as well start a new thread.

 I'm playing around with some AB1805 real time clocks from Abracon. Before I send a board out to the pcb fab I thought I'd try to prototype the device and make sure I can get what I want from it, a reasonably accurate RTC. I've soldered it to a QFN16 breakout board, hooked it up to a Moteino and messed around with the alarm functionality until it behaved. I'm also using the 32KHz crystal recommended in the datasheed ABS07-120-something.


Close up:


I've got it set to alarm every minute (matching 0 seconds, 0 hundreths) and it seems to work. The problem is that it seems to be way off in terms of accuracy. I've set the alarm match interrupt to generate a pulse on FOUT, which is fed into the Moteino. When Moteino detects it going low, it transmits a few bytes over the USART (115200 baud) to a computer which timestamps it. Here is a few minutes output:

Quote
2018:03:31:01:04:35:304,*
2018:03:31:01:05:35:296,*
2018:03:31:01:06:35:287,*
2018:03:31:01:07:35:277,*
2018:03:31:01:08:35:254,*
2018:03:31:01:09:35:238,*
2018:03:31:01:10:35:255,*
2018:03:31:01:11:35:231,*
2018:03:31:01:12:35:230,*
2018:03:31:01:13:35:205,*

It's running fast, to the point of 10-15 ms per minute. By my rubbish maths thats about 680 ms per hour. I'd expect more like 35-70ms per hour if the crystal was +10 or +20 ppm. Is this similar to other peoples experiences? I know there are calibration registers but I didn't expect to have to use them to this extent.

(I also know that this isnt the most accurate way to time this sort of thing. That being said, the computer is running ntp and if I do the same test with a DS3234 I basically get no drift at all)
« Last Edit: March 31, 2018, 05:08:34 PM by Tomme »

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: AB1805 RTC - accuracy
« Reply #1 on: March 31, 2018, 03:15:35 PM »
I can't see the photos in your posting, but, WRT AB18x5, the oscillator is purposefully biased to run fast so that the divider chain feeding the 100mS counters can be tweaked to +/- 2PPM accuracy via a clock dropping algorithm.

The result, without calibration, it will run 120 - 200PPM fast.  With calibration, it can be adjusted to stated accuracy.   I've used this device, in either I2C or SPI form on a number of projects and it can be calibrated easily IFF you have a reference that's better than 2PPM.    In my case I used a GPS module with 1PPS output to gate a counter, clocked with the 32KHz output from the RTC, on then gate off 30 seconds later.  The resulting count is large enough to calculate the calibration coefficients.

Tom

Tomme

  • NewMember
  • *
  • Posts: 24
Re: AB1805 RTC - accuracy
« Reply #2 on: March 31, 2018, 05:11:15 PM »
Fixed the pictures I think. Also, thank you! That's the answer I was hoping for, I'll have a play with the calibration registers later!

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: AB1805 RTC - accuracy
« Reply #3 on: March 31, 2018, 09:17:59 PM »
Alternatively set a counter running and use this webpage to time a fixed length (maybe a day) and calibrate it from that:
https://time.is/

Mark.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: AB1805 RTC - accuracy
« Reply #4 on: April 01, 2018, 12:22:53 AM »
Alternatively set a counter running and use this webpage to time a fixed length (maybe a day) and calibrate it from that:
https://time.is/

Mark.
Good suggestion, Mark!  Another alternative is to set up a photosensor at the Great Trilthon1 on the morning of June 21 to trigger counting and then come back next year to stop the counting.  There will be many more counts over that period giving him much higher resolution.  ;)

Tom
Note: 1. Center Trilthon at Stonehenge.


perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: AB1805 RTC - accuracy
« Reply #5 on: April 01, 2018, 01:24:17 AM »
LOL, I was actually being serious. If you can start and stop a timer manually with a switch to within 0.3 of a second with that website and use a counter incremented every 20th of a second you could get set an accuracy of about 4 ppm with no accurate timer or any electronics other than a switch. I believe the displayed clock runs locally using javascript and has a reported accuracy of 0.02 to 0.1 seconds.