Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DS3231 does not advance time and date

Status
Not open for further replies.

mostafanfs

Member level 1
Joined
Aug 2, 2012
Messages
40
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,611
I can read and write the DS3231 timekeeping registers correctly.
But I have two kind of problems.
First: I have one DS3231 mounted on my board and I have set the time and date correctly then I turned off the board and checked the values later and it was all OK(It was really advancing time in absence of main power using a coin cell).
But I turned on the board two days later and the time and date values was stopped advancing at some point. Right now even though there is the main power (not just backup power) but I keep reading a constant time and date values every time I read the registers!!
I don't know what happened to RTC.

Second: I have connected a DS3231 module and it's a famous module. I can read and write this module as before.
ds3231 rtc module-500x416.jpg
But when I set a time and date it stops advancing when I turn off the power (module has a coin cell) till I apply the power again but obviously I have lost those times where power was turned off.
Isn't this module supposed to advance time with its own coin cell ? That's really weird !
 

Found this in the that would indicate that is normal behavior. If EOSC bit is set high that would stop the clock as it stops the internal oscillator.

Bit 7: Enable Oscillator (EOSC).
When set to logic 0, the oscillator is started. When set to logic 1, the oscillator is stopped when the DS3231 switches to V BAT. This bit is clear (logic 0) when power is first applied. When the DS3231 is powered by VCC, the oscillator is always on regardless of the status of the EOSC bit. When EOSC is disabled, all register data is static.
That seems to suggest if you have it set wrong it will stop keeping time as soon as it switches to battery
 

Well thanks. I think I have noticed that and when I checked it wasn't set to high. Maybe I have to double check that but it says that when the power is applied this bit is 0 by default so I can say for sure that it is 0 since I haven't wrote any values to Control Register, you see ?

And what about my first problem with the mounted DS3231 on the board ? How come the time and date is constant even though I applied the main power and its not advancing time and date with the presence of main power ?
Is it because of some kind of hanging ?
Is there a sign I could check to make sure ? (like a signal to check)
 

Hi,

The next time the RTC fails to operate: read out all registers and show us the contents.

Klaus
 

Well my problem with the DS3231 module was fixed. At least for now! Apparently the Enable Oscillator (EOSC) bit in the Control Register was set to high. So that's why It was not advancing time when the power was turned off. Maybe I was reading the register wrong before. So we leave it at that.

But about the DS3231 mounted on the board I checked and the Oscillator Stop Flag (OSF) bit was set to high. For no specific reason as far as I know. So I wrote a 0x00 to Status Register and it was 0x00 when I did a read back. But I still keep reading constant values from timekeeping registers.
So I did a little more digging and turns out the RST signal is in a low state and according to the datasheet :
RST : It indicates the status of VCC relative to the
VPF specification. As VCC falls below VPF, the RST pin is driven low. When VCC exceeds VPF, for tRST, the RST pin is pulled high by the internal pull-up resistor
there is probably something wrong with the VCC but I double checked and VCC is alright considering the DS3231 module is working just fine with the same VCC.
What could be possibly wrong?
 

Hi,

there is probably something wrong with the VCC but I double checked and VCC is alright considering the DS3231 module is working just fine with the same VCC.
What could be possibly wrong?

If we should cross check, then give us values of "VCC" and "VPF".


Klaus
 

VCC is 3.3V and VPF according to datasheet is :
MIN: 2.45 TYP: 2.575 MAX: 2.70
 

Like I said before both DS3231 are working with the same VCC. They just connected to different I2C ports.
How come one of them is always in Reset state (RST signal is pulled low all the time) ? and another is working ?
 

Hi,

Read my post#4.

Please show us your complete circuit.All RTC related signal lines, all necessary capacitors.

VCC measurement with a DVM is useless here, because the RTC internal VCC monitor reacts on very short VCC fluctuations, you need a scope to monitor VCC.

If you switch the square wave to the output..... how does it behave? Doe it run continously?

Could the reset be activated from any other source?

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top