EmbeddedRelated.com
Forums

LPC1766-STK RTC accuracy

Started by Mark April 9, 2010
Hi All

Any comments on the following?

1) I use the LPC1766-STK from Olimex and the RTC on the board (the processor and the 32kHz crystal are soldered on the bottom of the board).

2) Since the RTC was losing about 5s a day I compensated this in the CALIBRATION register and so achieved <=1s / day accuracy. In fact I have 2 of the boards, both running the same program and both need the same CALIBRATION value.

3) The board has some rubber feet so it was put into place for its final use, which happens to be on a ESD protected table in a factory. It became quite obvious that the RTC was now running off - in fact it would lose several seconds in just a few minutes.

4) After some experimentation it was found necessary to have the board positioned at least 7cm higher than the surface of the table for the RTC to run accurately. The same results for the 2 boards...

Now I am astonished that by positioning a conductive surface (metal or the ESD conductive table) within several cm of the board (resp. RTC circuit) could have such a dramatic effect on the RTC accuracy. Has anyone experienced such a thing with other RTCs, boards, processors or crystals???

Regards

Mark

An Engineer's Guide to the LPC2100 Series

Hi Mark,

That's a lot of counts of error in a such a short time. I would expect a nominal drift due to thermals. I might expect spurious errors from stray capacitance, but the description of your bench environment suggests that is not a problem. I suppose static build-up could be an issue -- rubber feet, battery power, so your board might be well insulated, and gathering charge? I'm reaching, but the opposite problem might be a weird ground loop with your power supply causing your board to <fill in the blanks???>. Both boards acting the same way suggest to me you could have firmware bug, like rollover or something like that, causing to you to loose counts. What do you think?

-Ron
Hi Ron

I have tested using a 3rd board. If the board sits by itself on a wooden desk it runs accurately. It is powered by a 9V DC supply which is isolated.

When I put the board close to a metal surface the RTC loses about 15s in a minute (!!) [2cm = 15s, approx. > 6cm has no further influence]. In fact once the RTC stopped oscillating when moving the board from close to a metal surface to far away from a metal surface

So I activated the CLKOUT output so that the 32kHz could be unintrusively monitored. However this is not actually the case because as soon as I connect a ground to the board (GND of oscilloscope probe with 0V of the board) it behaves correctly - no drift, and of course the 32kHz is accurate.

I don't expect a SW cause since the error is certainly in the RTC itself - the error is also present when the power to the board is removed and the RTC runs by itself - after being turned on again the RTC is read and an error is there. (i.e. the SW is not counting anything itself so counts can only be lost in the RTC HW itself). Further, with the oscilloscope GND connected to 0V the RTC also runs accurately from the battery when the board is not powered. Removing the oscilloscope GND from 0V and leaving the RTC running from the battery with the board close to a metal surface results in a loss of about 3s per minute (better than when actively powered but still bad...).

The RTC design in the LPC17XX is different than in the LPC21XX/LPC23XX. I never noticed such effects with the others, which consume about 6..8uA from the battery. The low power design results in about 600nA battery consumption, which puts it into the league of dedicated RTCs.

The results with the Olimex board are however unnerving since it points to a problem - using an isolated power supply can hardly be forbidden... The CLKOUT signal also shows about 25% mark/space ratio, possibly suggesting the operating point of the oscillator to not be optimal(?). It may be that there is some problem with the design of the Olimex board (although there should not be a lot that can go wrong connecting the crystal and 2 caps close to the processor and having a fairly direct GND connection too).

Have other users of the LPC17XX and RTC experienced such problems, or maybe it hasn't been identified yet? Working on a wooden surface the RTC was very accurate for a long period of time and it was only by chance that the drift was actually noticed...

Regards

Mark
P.S. I was trying to get some better idea of the influence from the conductive surface but I found that even putting the board on certain types of books (the books were being used to control the distance) it could have a large influence if the book has a glossy cover or not (presumably conductive in some way?)
You've got some other problem. Sounds like you don't have power on it at all. Look for something simple.
Mark wrote:
> I have tested using a 3rd board. If the board sits by itself on a wooden
> desk it runs accurately. It is powered by a 9V DC supply which is isolated.
>
> When I put the board close to a metal surface the RTC loses about 15s in
> a minute (!!) [2cm = 15s, approx. > 6cm has no further influence]. In
> fact once the RTC stopped oscillating when moving the board from close
> to a metal surface to far away from a metal surface

A couple of shots in the dark:

Check that the can of the crystal is grounded.

Maybe there is some signals floating and electric hum influences RTC
through them. I can't figure which signals they could be though.

If you connect the board ground and the disturbing surface, what happens?

Clean up the region of the RTC signals carefully. Maybe there is a
little bit flux disturbing the oscillator operation point.

--

Timo
> You've got some other problem. Sounds like you don't have power on it at all. Look for something simple.

Hi

I am pretty sure the power is there. It consumes 600nA from the battery when the board is off (corresponds to data sheet).
Also the 32kHz sine wave can be measured on the crystal's leg (when powered from main power or from 3V battery backup). I had the board on the desk for a week with 3V battery and after the week the time was still accurate to a couple of seconds.

The problem only arises when the board is positioned close to a conductive surface...

Regards

Mark
> A couple of shots in the dark:
>
> Check that the can of the crystal is grounded.
>
> Maybe there is some signals floating and electric hum influences RTC
> through them. I can't figure which signals they could be though.
>
> If you connect the board ground and the disturbing surface, what happens?
>
> Clean up the region of the RTC signals carefully. Maybe there is a
> little bit flux disturbing the oscillator operation point.
>
> --
>
> Timo

Hi Timo

The crystal can doesn't seem to be designed to be soldered to. It is like stainless steel and so very difficult to get solder to stick to.
I have managed a solder joint with a lot of heat, although it will break off quite easily if banged or such.

The result seems to suggest an improvement though. It is less sensitive, but still loses about 5s in a minute when within a cm or so of the metal surface.

Connecting the metal plane to 0V of the board didn't make any improvement.

I'll have a go with a different crystal tomorrow.

I also looked at the layout on the Olimex LPC1766-STK and it looks quite standard. Identical results with 3 such boards...

Regards

Mark
--- In l..., "Mark" wrote:
>
> Hi
>
> I am pretty sure the power is there. It consumes 600nA from the battery when the board is off (corresponds to data sheet).
> Also the 32kHz sine wave can be measured on the crystal's leg (when powered from main power or from 3V battery backup). I had the board on the desk for a week with 3V battery and after the week the time was still accurate to a couple of seconds.
>
> The problem only arises when the board is positioned close to a conductive surface...
>
> Regards
>
> Mark

It sounds like a parasitic capacitance and/or RFI problem. A few observation points:
1. the schematic shows Q2 (32kHz) with three terminals, one is GNDed.
Is the crystal soldered to the PCB?
2. From the picture of the board, both crystals seem to be be too far from the MCU leads. Could you cut the traces and solder the crystal right on the MCU pins?
3. checks this, section crystal connections: http://www.maxim-ic.com/app-notes/index.mvp/id/504

4. What is the load capacitance to be for the MCU's oscillator?
5. Does the crystal meet this spec? That is for Olimex to answer, of course.

My hunch would be:
1. crystal quality and
2. PCB layout/material quality.
3. flux residues

There are some options for you to try, though.

--Roger
Mark wrote:
> The crystal can doesn't seem to be designed to be soldered to. It is
> like stainless steel and so very difficult to get solder to stick to.
> I have managed a solder joint with a lot of heat, although it will break
> off quite easily if banged or such.

Oh, sorry, I didn't mean to solder it necessarily. I thought about some kind of
wire strap. But good that it apparently survived the soldering.

> The result seems to suggest an improvement though. It is less sensitive,
> but still loses about 5s in a minute when within a cm or so of the metal
> surface.
>
> Connecting the metal plane to 0V of the board didn't make any improvement.

That's very surprising because you said that connecting a scope ground made the
problem to go away. What if you cover the whole board with tinfoil or something
and try to ground to earth the foil or the board or both? I would still
strongly believe on electric hum - what other could be sensitive to grounding?

Please, tell us if you find the cause.

--

Timo
--- In l..., "Mark" wrote:
>
> Hi All
>
> Any comments on the following?
>
> 1) I use the LPC1766-STK from Olimex and the RTC on the board (the processor and the 32kHz crystal are soldered on the bottom of the board).
>
> 2) Since the RTC was losing about 5s a day I compensated this in the CALIBRATION register and so achieved <=1s / day accuracy. In fact I have 2 of the boards, both running the same program and both need the same CALIBRATION value.
>
> 3) The board has some rubber feet so it was put into place for its final use, which happens to be on a ESD protected table in a factory. It became quite obvious that the RTC was now running off - in fact it would lose several seconds in just a few minutes.
>
> 4) After some experimentation it was found necessary to have the board positioned at least 7cm higher than the surface of the table for the RTC to run accurately. The same results for the 2 boards...
>
> Now I am astonished that by positioning a conductive surface (metal or the ESD conductive table) within several cm of the board (resp. RTC circuit) could have such a dramatic effect on the RTC accuracy. Has anyone experienced such a thing with other RTCs, boards, processors or crystals???
>
> Regards
>
> Mark
>

Seconds per minute loss implies perhaps a grounding problem or something.

However, I used to design digital watch test equipment. Many watch modules would loose as much as 200 seconds per month, when placed into their metal case, making calibration out of the case, very difficult.

-Hershel