1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Problem With Philips PCF8563 RTC

Discussion in 'Embedded' started by Ken Lee, Apr 6, 2004.

  1. Ken Lee

    Ken Lee Guest

    Hi,
    I'm just wondering if anybody has had any problems with the
    Philips PCF8563 RTC. I've devised a simple unit test which does the
    following:

    1. RTC seconds, minutes and hours registers are initialised to zero.
    2. Continuously samples the RTC (at 1 millisecond) and reads the
    seconds, minutes and hours registers
    3. Each register has an associated counter in software, which is
    incremented if the value changes. Note that a change of value causes
    an increment of the counter.
    4. The read RTC registers and the associated counter values are then
    displayed.

    Note that the appropriate register masks are applied to ensure only
    valid time values are read. Also this test is independant of the RTC
    crystal accuracy and the micro crystal accuracy.

    After running the test for a weekend the 2 values are out by 3
    seconds.

    The only reason why I'm running such extensive tests is that in our
    product which uses this RTC, we are getting as much as 6 hours
    discrepancies in our data logs (over a longer period of time). The
    data logs are timestamped from RTC readings and NOT by the micro
    system clock.

    Also in conjunction with the above test we have attached an external
    reference clock which is driven directly from the 32.768kHz from the
    CLKOUT of the PCF8563 and this also indicates a 3 second discrepancy.

    Now this is very baffling. We've checked the oscillator circuit and
    it's per the PCF8563 data sheet. Also the test has been repeated on 3
    separate units with the same result. If I didn't know better I'd say
    that the internal counters of the PCF8563 were hiccupping -- is this
    possible.

    Any help or suggestions welcomed.

    Ken.

    +====================================+
    I hate junk email. Please direct any
    genuine email to: kenlee at hotpop.com
     
    Ken Lee, Apr 6, 2004
    #1
    1. Advertisements

  2. Hi Ken,

    I haven't done anything with this RTC chip, but:
    you should not read a RTC so often.
    Read it only once a second or so.

    A closer look in the datasheet of the PCF8563 may reveal,
    that rollover of RTC counters is inhibited for a short period of time
    after the first access. This is to prevent erroneous reading.

    HTH
    Wolf
     
    Wolfgang Mahringer, Apr 6, 2004
    #2
    1. Advertisements

  3. Ken Lee

    Ken Lee Guest

    Hi Wolfgang,
    Thanks for the response. The data sheet does say that the
    counters are "frozen" during a read, but I would assume that these
    counters were double buffered so as not to lose counts. Anyway I'll
    continue with my investigations.

    Ken.

    +====================================+
    I hate junk email. Please direct any
    genuine email to: kenlee at hotpop.com
     
    Ken Lee, Apr 6, 2004
    #3
  4. Can you clarify that more, as that sounds 'almost direct to the
    crystal' (no dividers, only buffered), which would indicate
    problems are not in the counter chain, but could be more like clock
    noise effects. Also, is the delta faster, or slower ?
    -jg
     
    Jim Granville, Apr 6, 2004
    #4
  5. Ken Lee

    CBFalconer Guest

    You can avoid any nasty interactions by reading the registers
    least to most significant, and then rereading the least
    significant. If it hasn't changed no rollover has occured, else
    go around again.
     
    CBFalconer, Apr 7, 2004
    #5
  6. Ken Lee

    Tim Mitchell Guest

    I've used this RTC a lot but never had these problems; however, I only
    read it about every 100 msec. In my applications it keeps time better
    than 1sec per month. I would suspect that your very frequent reading of
    the registers may have something to do with it.
     
    Tim Mitchell, Apr 7, 2004
    #6
  7. Ken Lee

    mike Guest

    We use the PCF8593 (previous generation, but I believe the oscillator
    is similar), and have never had any trouble. Once trimmed, we too get
    about 1 sec per month. Untrimmed, we routinely see the clock running
    about 20ppm fast, which corresponds closely to the 3 sec per weekend the
    OP quotes. Our application reads the clock infrequently, but an earlier
    version read it every 200msec, again with no trouble.

    Mike L.
     
    mike, Apr 7, 2004
    #7
  8. Are the 32.768kHz crystals low capacitance types ? Many/most of the
    cheap 32.768kHz crystals are in the order of 12pF, and many of the RTC
    devices want the 6pF 32.768kHz crystals. Since we have started being
    very carefull in making sure that the 32.768kHz crystals we buy are
    the low capacitance types, we have had much better accuracy from the
    RTC devices we use.

    Regards
    Anton Erasmus
     
    Anton Erasmus, Apr 9, 2004
    #8
  9. Ken Lee

    Ken Lee Guest

    <-- Purposely top-posted -->

    Thankyou everyone for your comments.

    One common theme was that many thought that the RTC was read too
    often. I got some response back (via our distributor) from a Philips
    engineer who said the same thing but without any technical
    clarification. In any case I re-jigged my test to read the RTC every
    100ms and it has been running perfectly now for 4 days. This must be
    some unwritten law as I went through the data sheet again in the hope
    of finding this constraint -- but without any luck.

    So this appears to be the root of the problem - thanks again for
    everyone's contributions.

    Ken.

    +====================================+
    I hate junk email. Please direct any
    genuine email to: kenlee at hotpop.com
     
    Ken Lee, Apr 12, 2004
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.