Author Topic: DS3231 is not accurate as it should be  (Read 17479 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #25 on: April 23, 2019, 12:53:06 pm »
Why not? That's exactly what I do. 
Makes no sense to read it every second.
You can only hang your I2C bus, block it for other traffic and cause noise for other components for what ?
Do you think the I2C bus would wear out?  :-DD  IMHO it's a perfectly plausible operating mode
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6572
  • Country: nl
Re: DS3231 is not accurate as it should be
« Reply #26 on: April 23, 2019, 01:32:31 pm »
Do you think the I2C bus would wear out?  :-DD  IMHO it's a perfectly plausible operating mode
Well in the past I had a lousy ST I2C peripheral which would indeed hang it self up now and then  and you need to clock it loose again.

But my point is that the I2C bus is usually a shared multi IC bus and you divide the time between them. In your case you probably have that single chip on it.
A RTC is usually a NV backup clock you now and then use to sync your onboard clock to, or the RTC alarm out is also very usefull to save energy and let the uC sleep till it has to do something.
Do you have at least sanity checks on your RTC data before you use them ? Or do you just blindly copy the data ?

 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #27 on: April 23, 2019, 02:37:00 pm »
I really don't want to defend the approach (although it does have an advantage of being simple and potentially allowing deep stateless sleep between wake-ups) rather I just wanted to say it does work (and especially where the bus is not contended as you pointed out).  Indeed probably much better to use an MCU with an inbuilt RTC anyway.
The reason I didn't like the earlier post regarding using the RTC to discipline the local clock was that I have seen cheapo Uno clones that use resonators that are >10% out so the drift is rapid and then it becomes a case of adjusting rate as well as offset which will only confuse new players.
IMHO power droop is the OP's most likely problem as I've used quite a few cheapo DS3231 modules and never seen a problem.  Labelling them as 'fake' sounds like clutching at straws... but I may be wrong... ;)

 

Online floobydust

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: ca
Re: DS3231 is not accurate as it should be
« Reply #28 on: April 24, 2019, 06:49:36 pm »
DS3231S $7.87 at Digikey and from china $1.28 for entire pcb with DS3231, battery holder, connector, extra 24C32 EEPROM. You gotta wonder.
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2342
  • Country: mx
Re: DS3231 is not accurate as it should be
« Reply #29 on: April 24, 2019, 07:05:25 pm »
If it is too good to be true;
it can't true
 

Online floobydust

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: ca
Re: DS3231 is not accurate as it should be
« Reply #30 on: April 24, 2019, 07:16:17 pm »
This pcb $1.28 USD and 7,607 sold  :o
Either currency manipulation or Maxim's profit greed, or something I am missing prices the RTC IC alone at over 6X the price of this module  :-//
Even a fake or reject RTC - you have to stuff a crystal in there, it's gonna be expensive. The majority of people find the cheap RTC works fine.
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 5163
  • Country: bt
« Last Edit: April 24, 2019, 07:32:15 pm by imo »
Readers discretion is advised..
 

Offline johnkenyon

  • Regular Contributor
  • *
  • Posts: 123
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #32 on: April 24, 2019, 10:40:32 pm »
This pcb $1.28 USD and 7,607 sold  :o
Either currency manipulation or Maxim's profit greed, or something I am missing prices the RTC IC alone at over 6X the price of this module  :-//
Even a fake or reject RTC - you have to stuff a crystal in there, it's gonna be expensive. The majority of people find the cheap RTC works fine.

Is that the special model which includes a (non-rechargeable) CR2032, but has the added bonus of a diode+resistor to charge up the battery?

(I was offered that t-shirt, but I removed the diode before deploying the board...)

 

Online floobydust

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: ca
Re: DS3231 is not accurate as it should be
« Reply #33 on: April 24, 2019, 11:03:03 pm »
Is that the special model which includes a (non-rechargeable) CR2032, but has the added bonus of a diode+resistor to charge up the battery?

(I was offered that t-shirt, but I removed the diode before deploying the board...)

Yes, it has a bonus diode and 200R series to VCC, so I estimate ~7mA charging all the time...
Other RTC module versions have a mystery yellow rechargeable battery.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #34 on: April 25, 2019, 08:50:47 am »
I just desolder the DS3231 (hot air) and the battery holder (vacuum) and use in my own design. Works fine and cheaper than buying the battery holder.

(The TTL to serial MAX232 clones are an entirely different kettle of fish... Those should not be touched with a barge pole  https://www.eevblog.com/forum/chat/fake-chips/msg1552951/#msg1552951 )
« Last Edit: April 25, 2019, 10:09:01 am by NivagSwerdna »
 
The following users thanked this post: tooki

Online iMo

  • Super Contributor
  • ***
  • Posts: 5163
  • Country: bt
Re: DS3231 is not accurate as it should be
« Reply #35 on: April 25, 2019, 10:01:14 am »
Is that the special model which includes a (non-rechargeable) CR2032, but has the added bonus of a diode+resistor to charge up the battery?

(I was offered that t-shirt, but I removed the diode before deploying the board...)

Yes, it has a bonus diode and 200R series to VCC, so I estimate ~7mA charging all the time...
Other RTC module versions have a mystery yellow rechargeable battery.
There is no need to remove the 200ohm when powered from 3.3Vcc only. With 5Vcc I would rather remove the 200ohm resistor, sure.
« Last Edit: April 25, 2019, 10:03:09 am by imo »
Readers discretion is advised..
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12631
  • Country: ch
Re: DS3231 is not accurate as it should be
« Reply #36 on: April 25, 2019, 10:05:37 am »
https://hackaday.com/2017/08/09/get-inside-a-tcxo-clock-chip/
https://blog.heypete.com/2017/07/29/a-look-inside-the-ds3231-real-time-clock/

And yes, it is the greed of our lovely distributors..
I don't think it's greed so much as it is the cost of overhead. Look at Digi-Key: they have over a million SKUs in stock. The warehousing costs for this, and the logistics to get a few units to you, are huge. (This is why the volume discounts become so large, since sending you an entire reel of 5000 takes less effort than counting out and repackaging 3 pieces.)

In contrast, the Chinese eBay sellers typically stock around 1000 SKUs, and their labor costs are trivial. So their overhead is massively lower. Their module suppliers probably buy 100,000 chips at a time, getting huge discounts, and then sell them to a bunch of different eBay vendors.
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 5163
  • Country: bt
Re: DS3231 is not accurate as it should be
« Reply #37 on: April 25, 2019, 10:09:23 am »
https://hackaday.com/2017/08/09/get-inside-a-tcxo-clock-chip/
https://blog.heypete.com/2017/07/29/a-look-inside-the-ds3231-real-time-clock/
And yes, it is the greed of our lovely distributors..
I don't think it's greed so much as it is the cost of overhead.
A good topic for a separate thread. It is the greed and cartels..
Readers discretion is advised..
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12631
  • Country: ch
Re: DS3231 is not accurate as it should be
« Reply #38 on: April 25, 2019, 10:18:54 am »
https://hackaday.com/2017/08/09/get-inside-a-tcxo-clock-chip/
https://blog.heypete.com/2017/07/29/a-look-inside-the-ds3231-real-time-clock/
And yes, it is the greed of our lovely distributors..
I don't think it's greed so much as it is the cost of overhead.
A good topic for a separate thread. It is the greed and cartels..
Perhaps. But I don't like how you just re-state that it's greed (and now cartels!) without providing any evidence or even arguments. I substantiated my claims, you didn't...
 
The following users thanked this post: Kjelt

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6572
  • Country: nl
Re: DS3231 is not accurate as it should be
« Reply #39 on: April 25, 2019, 10:36:59 am »
I am still unsure about all this.
If you look at the maxim website they state a price around $4 for 1k pieces. No way that will drop to $0,20 for 100k pieces.

https://www.maximintegrated.com/en/products/analog/real-time-clocks/DS3231.html/tb_tab3
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12631
  • Country: ch
Re: DS3231 is not accurate as it should be
« Reply #40 on: April 25, 2019, 10:59:37 am »
I am still unsure about all this.
If you look at the maxim website they state a price around $4 for 1k pieces. No way that will drop to $0,20 for 100k pieces.

https://www.maximintegrated.com/en/products/analog/real-time-clocks/DS3231.html/tb_tab3
Not for us, for sure!!

But I wouldn't be surprised at all if they used regional pricing. (And though I have no idea what the price break is for 100K, never mind for e.g. a million, I'm sure it's quite substantial.) Combined, those really could result in them being insanely cheap. :/
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6572
  • Country: nl
Re: DS3231 is not accurate as it should be
« Reply #41 on: April 25, 2019, 12:44:07 pm »
Ok let me rephrase, if the published 1k price of the manufacturer is around $4, the prices for the distributors are not that outrageous as stated by some.
 

Offline rf-loop

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
  • Born in Finland with DLL21 in hand
Re: DS3231 is not accurate as it should be
« Reply #42 on: April 25, 2019, 03:37:32 pm »
If you bought them from ali/ebay they are 99% fake. (it's likely that this is the source for your local shop too) I bought a few from different sellers about a year ago and none of them functioned properly. I bought both modules and just the ICs themselves.

Cheapest source I found for them was LCSC, something like 1.5€ a piece in small quantities. So far I've had no issues with them, they seem to be genuine.

eBay China, various selers.
All in around same ballpark, worst chip error near 2.5ppm.
Tested in normal roomtemp and well stabilized.
Here example. So I can not fully confirm this 99% crap. But of course, I have also get "crap" but in my case these all have been so that seller images and description have been DS3231SN  but I have get SN3231M (and warning, today perhaps most are M versions independent of pictures in eBay)  and these M have some been even far out from genuine M version 5ppm, some have been totally badly outside limits. (perhaps counterfeit or perhaps some use chips what have not passed tests or what ever...)

But every sigle DS3231SN have been ok.

Perhaps good luck or then I can bit look around from who I buy (experience and intuition).

Here  tiny example. 3pcs 3231 compared to accurate reference. (DS3231 pin 1 out (32kHz), also 64s period thermal correction works but I have not made real test because I do not have test owen)
Traces drift  "tails" length is 1second.

« Last Edit: April 25, 2019, 03:40:50 pm by rf-loop »
EV of course. Cars with smoke exhaust pipes - go to museum. In Finland quite all electric power is made using nuclear, wind, solar and water.

Wises must compel the mad barbarians to stop their crimes against humanity. Where have the (strong)wises gone?
 
The following users thanked this post: iMo

Offline JackJones

  • Regular Contributor
  • *
  • Posts: 229
  • Country: fi
Re: DS3231 is not accurate as it should be
« Reply #43 on: April 25, 2019, 03:47:35 pm »
The ones I got were DS3231SN. I did shop around too, I bought from sellers with good ratings and with several pieces sold. Yet all of them lost tens of seconds overnight.

I soldered one that I got from LCSC into one of the breakout boards I got and it worked fine. I must have been just unlucky.  :-//
 

Offline rf-loop

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
  • Born in Finland with DLL21 in hand
Re: DS3231 is not accurate as it should be
« Reply #44 on: April 25, 2019, 09:00:04 pm »
The ones I got were DS3231SN. I did shop around too, I bought from sellers with good ratings and with several pieces sold. Yet all of them lost tens of seconds overnight.

I soldered one that I got from LCSC into one of the breakout boards I got and it worked fine. I must have been just unlucky.  :-//

I do not even believe they are bad counterfeits. But possible failed chips. Perhaps some sell "abandoned lots". 

This your frequency error is so big that not even any poor copycat IC's can do it exept if it is failed. 10s/day is more than 100ppm error. This is possible if there is broken temperature measurement and/or failure on internal capacitor array or its control (what adjust XTAL freq) or bad xtal. If adjust system still works somehow it can detect with freq measurement and look if it do adjust every 64s when temperature is changing. And you tell error is even more, tens of seconds in day.  Perhaps these ic's are "abandoned in tests" but somehow these bad lots turn back to bad business markets.

It is also good to note that there is several eBay sellers who have many accounts.  Many sellers they just deliver orders to some "grey warehouse - manufacturer",  and many sellers use same source. Who can think all sellers days and nights make packages and then go to post office for send. Some do, many do not.
Inside China with own eyes this "game" can understand better.

My wild quess is that these are from failed IC's lot (abandoned in tests lot) .

XTAL versions (S, SN) are also more sensitive for mechanical shocks that MEMS oscillator versions. (I have not tested what it need for XTAL defect ;) )

EV of course. Cars with smoke exhaust pipes - go to museum. In Finland quite all electric power is made using nuclear, wind, solar and water.

Wises must compel the mad barbarians to stop their crimes against humanity. Where have the (strong)wises gone?
 

Offline wilfred

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
Re: DS3231 is not accurate as it should be
« Reply #45 on: April 25, 2019, 09:25:30 pm »
I'm still waiting to hear what results come from switching off the HV power supply. I think that could easily explain the error. Needs to be eliminated as a possible cause and is easy to do.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2448
  • Country: us
Re: DS3231 is not accurate as it should be
« Reply #46 on: April 26, 2019, 01:57:05 am »
You don't have to read the RTC every second; when you get an interrupt from SQW you  cancount seconds, minutes, hours in RAM.  Then read the RTC only on startup to initialize, and maybe once every 6 hours for good measure.  This would practically eliminate any potential for interference from the I2C bus.
« Last Edit: April 26, 2019, 02:02:08 am by bson »
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #47 on: April 26, 2019, 09:09:23 am »
Yet all of them lost tens of seconds overnight.
Send them to rf-loop for post mortem?
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: DS3231 is not accurate as it should be
« Reply #48 on: April 26, 2019, 09:16:39 am »
You don't have to read the RTC every second; when you get an interrupt from SQW you  cancount seconds, minutes, hours in RAM.  Then read the RTC only on startup to initialize, and maybe once every 6 hours for good measure.  This would practically eliminate any potential for interference from the I2C bus.
In my experience reading at 1Hz does not affect the device... you don't have to.... but you can.  It's a red herring in this context.
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 5163
  • Country: bt
Re: DS3231 is not accurate as it should be
« Reply #49 on: April 26, 2019, 09:53:03 am »
Unless the OP provides some basic measurements/debugging people here had advised we still speculate. We need inputs from him.
I've never detected an info the DS3231 on the cheapo $1.5 modules are fakes or broken.
I'v heard so far:
1. the 200ohm resistor shall be removed with 5Vcc otherwise you charge the CR2032
2. the I2C EEPROM could be removed to decrease the module's current consumption
3. the LED could be removed to decrease the module's current consumption
4. I2C sw/driver issues as usual
5. wiring issues as usual.
« Last Edit: April 26, 2019, 09:57:02 am by imo »
Readers discretion is advised..
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf