Author Topic: RTC fault finding  (Read 7731 times)

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
RTC fault finding
« on: January 24, 2017, 08:05:51 AM »
hi,   i've got an issue with one or more ds1302 realtime clock chips and I wondered whether I could have some fake chips;  these were sourced at cheaper than standard prices from Ebay;  the fault I have is the rtc will very infrequently freeze many hours after power-up, it will also infrequently freeze when the unit it off - and it is using the backup coin cell.

I have a couple of different batches of the ds1302's bought at different times (ebay sellers)  and the suspect ones when measured have a very oddly large? pin capacitance  between the crystal pins x1 and x2 (~40pF)  whereas 2 from another batch have only ~6pF,  the latter value is more like I would expect to see.

I've attached a pic;  the top ones are the ones with the high x1 and x2 cap,  the 2 at the bottom of the pic have the ~6.2pF between pins.

Any thoughts?

Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #1 on: January 24, 2017, 05:04:20 PM »
I think I'll just order some more from a trusted (non ebay) retailer and make some comparison from those;  I have a feeling these could well be rejects, because of the large parasitic capacitance on the crystal pins (x1 & x2)
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #2 on: January 29, 2017, 04:26:53 AM »
Well,  I ordered 3 new ones and some new watch crystals which arrived the other day and I measured the x1 & x2 pins and they also measured ~40pf,  so I'm none the wiser!

I think the next step would be to setup a test circuit, and to verify all the registers (functionality) in the "suspect" RTC chips, and to leave it running on battery backup for a few days to see how it runs.
Hey! Frisbee! Far out!

SeanB

  • Administrator
  • Hero Member
  • *****
  • Posts: 1036
Re: RTC fault finding
« Reply #3 on: January 29, 2017, 08:28:01 AM »
If you have one of Dave's uCurrents measure the current in battery backup mode, it might show the fake ones as they probably have excessive current draw in battery backup.

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #4 on: January 29, 2017, 08:39:59 AM »
If you have one of Dave's uCurrents measure the current in battery backup mode, it might show the fake ones as they probably have excessive current draw in battery backup.

ah, good thinking Sean I didn't think of that;   I don't have a uC so i might have to see what i have in order to try and measure that.

One thing I did read is that the rtc is designed to use a 6pf load cap xtal in order to work correctly, otherwise it will draw too much, run too fast, slow startup ;   now my new xtals from rsonline state a static capacitance of 0.9pf and i measured ~1pf which is what i would expect;  but my ebay xtals (no brand)  seem to have ~2.3pf,  but most watch xtals i found online range from 0.9 to 1.6pf static capacitance (if that means it's actually measured across the pins?)    so,  if the ebay ones are off on the static capacitance perhaps they could be rejects in the areas aspects of the specifications? idk
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #5 on: April 12, 2017, 08:29:13 AM »
I've got back to looking at this the other day,  I cut the longer than required crystal traces and then soldered the ebay crystals directly onto the underside of the board;  after having run it, both, on and off (battery backup) for the past few days.    At the moment I've got it currently on and displaying the date/time - so I'll run that for 24hrs and see what happens. 
Hey! Frisbee! Far out!

SeanB

  • Administrator
  • Hero Member
  • *****
  • Posts: 1036
Re: RTC fault finding
« Reply #6 on: April 14, 2017, 01:15:25 AM »
Well, shorter traces and less chance to have anmy noise coupled in. Have you soldered the crystal case to the ground plane or at least a plane connected to the chip ground with a very short wide trace.

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #7 on: April 14, 2017, 02:06:01 AM »
Well, shorter traces and less chance to have anmy noise coupled in. Have you soldered the crystal case to the ground plane or at least a plane connected to the chip ground with a very short wide trace.

no, but i'll solder the xtal case to the ic ground on another board and see how that runs.
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #8 on: April 14, 2017, 05:53:42 AM »
This morning I soldered up another board and added the bodge-wires;  cut the pcb xtal traces; added an ebay xtal directly to the ic pins; then soldered the xtal case with a wire to the ic ground;   reset the clock (forced the trickle charge reg to off) - and set the date/time to my phone and left it running on my bench.  It didn't go as well as I hoped,  as I had an 18v input short on the 5v rail which fragged the rtc,  so,  i had to swap that out for a new one;  so - lets see how these ones behave.
« Last Edit: April 21, 2017, 12:11:12 PM by Mr Eastwood »
Hey! Frisbee! Far out!

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #9 on: April 21, 2017, 12:20:41 PM »
After just over a week of running the clocks, the results so far on my first 2 test boards are..

1. unknown xtal + unknown ds1302 + long traces = +2.5 mins over 7 days.
2. unknown xtal + unknown ds1302 + xtal soldered to ic + grounded xtal case = +1 min over 7 days.

So, tonight I will solder up a new board with a non-ebay xtal,  and non-ebay ds1302 and then try that for week.
Hey! Frisbee! Far out!

SeanB

  • Administrator
  • Hero Member
  • *****
  • Posts: 1036
Re: RTC fault finding
« Reply #10 on: April 22, 2017, 07:44:52 AM »
Some 32kHz crystals were designed for best stability at 35C, about the temperature of a metal backed watch case on the wrist, while others are designed for room temperature operation, so you pretty much are going to get drift with them anyway. 

Good though with trying to get the induced noise down, though for lowest noise you really want to have a ground plane under the actual chip, some guard traces at the crystal pins and with a ground plane around the crystal, along with keeping the traces well away at all layers of the board, and a good number of vias to stitch the layers together, which should make the clock more stable. You probably will want to keep the clock area thermally isolated with something, like a small shielding box around them, like you used to see on older computers, that wanted a more reliable RTC before NTP was common.

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: RTC fault finding
« Reply #11 on: June 13, 2017, 06:24:56 PM »
When I tried the non-ebay (but not chip maker approved distributor) chip I just couldn't get it to hold the oscillations after the power was turned off;  so,  I ordered a strip from a reel in soic8 format from ebay, and after some fiddly soldering the first one from the reel worked as soon as I inserted the coin cell.  I will deffo respin the board on the next round and add that ground plane, and move away any signal traces.  I think I will get some soic8 to dip converter pcbs and just add the soic8 instead of the dips for these board that have the clock issues.
Hey! Frisbee! Far out!