RTC fails suddenly after extended use...?

Started by myfriendmarkis November 14, 2006
Hi All,

Have around 50 LPC2148 boards running with a 20MHz main crystal and
external RTC crystal (standard circuit with 560ohm load resistor,
22pf caps, 32.768K crystal).

I've had 3 of the boards fail in a week after running fine for a few
months. Basically the RTC crystal stops oscillating. Power to VBat is
OK and everything else on the board works fine.

Replacing the crystal, caps and load resistor do not make the RTC
work again so I assume the LPC has been damaged internally?

Any thoughts on what might be happening very much appreciated.

Best regards,

Mark.

An Engineer's Guide to the LPC2100 Series

On Tue, 14 Nov 2006 12:58:36 -0000, you wrote:

>Hi All,
>
>Have around 50 LPC2148 boards running with a 20MHz main crystal and
>external RTC crystal (standard circuit with 560ohm load resistor,
>22pf caps, 32.768K crystal).

>I've had 3 of the boards fail in a week after running fine for a few
>months. Basically the RTC crystal stops oscillating. Power to VBat is
>OK and everything else on the board works fine.
>
>Replacing the crystal, caps and load resistor do not make the RTC
>work again so I assume the LPC has been damaged internally?
>
>Any thoughts on what might be happening very much appreciated.

Moisture/PCB contamination perhaps?
----- Original Message -----
From: "myfriendmarkis"
To:
Sent: Tuesday, November 14, 2006 12:58 PM
Subject: [lpc2000] RTC fails suddenly after extended use...?
> Hi All,
>
> Have around 50 LPC2148 boards running with a 20MHz main crystal and
> external RTC crystal (standard circuit with 560ohm load resistor,
> 22pf caps, 32.768K crystal).
>
> I've had 3 of the boards fail in a week after running fine for a few
> months. Basically the RTC crystal stops oscillating. Power to VBat is
> OK and everything else on the board works fine.
>
> Replacing the crystal, caps and load resistor do not make the RTC
> work again so I assume the LPC has been damaged internally?
>
> Any thoughts on what might be happening very much appreciated.

It's a long shot, but have you cleaned off all the flux around the
oscillator? It might have picked up enough moisture to become somewhat
conductive.

Leon
--
Leon Heller, G1HSM
Suzuki SV1000S motorcycle
l...@bulldoghome.com
http://webspace.webring.com/people/jl/leon_heller/
Mark,

May be the 560 Ohm load resistor is making the RTC run out of spec. Page
353 of the 2148 user manual
states that the Load resistor is not required.

Regards
Grant
NZ

-----Original Message-----
From: l... [mailto:l...]
On Behalf Of myfriendmarkis
Sent: Wednesday, 15 November 2006 1:59 a.m.
To: l...
Subject: [lpc2000] RTC fails suddenly after extended use...?

Hi All,

Have around 50 LPC2148 boards running with a 20MHz main crystal
and
external RTC crystal (standard circuit with 560ohm load
resistor,
22pf caps, 32.768K crystal).

I've had 3 of the boards fail in a week after running fine for a
few
months. Basically the RTC crystal stops oscillating. Power to
VBat is
OK and everything else on the board works fine.

Replacing the crystal, caps and load resistor do not make the
RTC
work again so I assume the LPC has been damaged internally?

Any thoughts on what might be happening very much appreciated.

Best regards,

Mark.
Hi everyone,

Thanks for your thoughts.
I use a no clean flux pen for making the boards up and then add some
hot glue to mechanically fix the crystal can to the board.

Cant imagine how moisture would get at the boards but will leave off
the load resistor as per Grants suggestion.

Will write back if I find anything concrete or if the failures
continue....

Cheers,

Mark.
I've had similar problem. I fixed it setting PREINT and PREFRAC on startup,
even using external 32kiHz crystal, and in my case its clear: if I dont't do
that, CTC doesn't get incremented.

Below is my code, with an interesting function at end that implements Zeller's
rule to get the day of week.

Wagner.

--
void RTCInit( void )
{
CCR = 0;
ILR = 3;

PREINT = ( int )( ( 60000000UL / 32768UL ) - 1 ) & ( ( 1 << 14 ) - 1 );
PREFRAC = ( int )( 60000000UL - ( ( ( unsigned long )PREINT + 1UL ) *
32768UL ) );

AMR = AMRSEC | AMRMIN | AMRHOUR | AMRDOM | AMRDOW | AMRDOY | AMRMON |
AMRYEAR;
CIIR = 0;

#if HWLIB_RTC_ON_PCLOCK == 0
CCR = CCR_CLKSRC;
#endif
}

void RTCStart( void )
{
ILR = 3;
CCR |= CCR_CLKEN;
}

void RTCStop( void )
{
CCR &= ~CCR_CLKEN;
}

// implementacao da Regra de Zeller
static unsigned char GetWDay( int nMDay, int nMonth, int nYear )
{
int nWDay, D, C;

C = nYear / 100;
if( nMonth < 3 ) D = ( nYear - 1 ) % 100;
else D = nYear % 100;
nMonth = ( ( nMonth + 9 ) % 12 ) + 1;
nWDay = nMDay + ( ( 13 * nMonth - 1 ) / 5 ) + D + ( D / 4 ) + ( C /
4 ) - 2 * C;
return( nWDay < 0 ? ( nWDay + 7 ) : ( nWDay % 7 ) );
}
Citando myfriendmarkis :

>
> Hi everyone,
>
> Thanks for your thoughts.
> I use a no clean flux pen for making the boards up and then add some
> hot glue to mechanically fix the crystal can to the board.
>
> Cant imagine how moisture would get at the boards but will leave off
> the load resistor as per Grants suggestion.
>
> Will write back if I find anything concrete or if the failures
> continue....
>
> Cheers,
>
> Mark.

-------------
This mail sent through IMP: http://horde.org/imp/
----- Original Message -----
From: "myfriendmarkis"
To:
Sent: Wednesday, November 15, 2006 4:55 PM
Subject: [lpc2000] Re: RTC fails suddenly after extended use...?
>
> Hi everyone,
>
> Thanks for your thoughts.
> I use a no clean flux pen for making the boards up and then add some
> hot glue to mechanically fix the crystal can to the board.
>
> Cant imagine how moisture would get at the boards but will leave off
> the load resistor as per Grants suggestion.

It's still worth removing the flux, those 32 kHz oscillators are much more
critical than the higher frequency ones.

Leon