4 Bits Digital AT89C2051 Electronic Clock ( Adding Memory? )

Thread Starter

John Berry

Joined May 17, 2016
72
Hello, I have recently built one of these kits and everything works fine.
The only problem is that every time the clock loses power or is disconnected I have to reset the time.
I have since discovered that some similar kits have some sort of memory powered by a button cell.
Would it be possible to modify my clock somehow so that it remembers the time when I power it back up?
Thank you very much. John... :)
 

Attachments

WBahn

Joined Mar 31, 2012
30,062
There are a few ways to do it. One would be to simply power the whole thing by a battery that is cut out of the circuit when external power is available. An enhancement on that would be to use a rechargeable battery that is float charged when external power is available. The advantage of these options is that the clock keeps time while it is unpowered. To minimize the current draw you could modify it so that the display was powered only by the external power supply.

Modifying it to capture and store the time is doable, but quite a bit more involved. The circuit isn't really set up for it. How would you load the stored time back into the MCU?
 

GopherT

Joined Nov 23, 2012
8,009
Hello, I have recently built one of these kits and everything works fine.
The only problem is that every time the clock loses power or is disconnected I have to reset the time.
I have since discovered that some similar kits have some sort of memory powered by a button cell.
Would it be possible to modify my clock somehow so that it remembers the time when I power it back up?
Thank you very much. John... :)
There are a few ways to do it. One would be to simply power the whole thing by a battery that is cut out of the circuit when external power is available.
If the S1500 clock is built according to the schematic, there should already be battery back up.

The S1500 kit has 5V adapter has a diode in line and an opposing 3V supply with antiparallel diode. If the chip is not retaining time, you'll need a bigger battery to last longer.

If the OP is writing the code, he may be able to use the analog comparator on board P1.0/P1.1 to and an external voltage ref check if the clock is currently powered by battery (3V) or external power (5v) and turn off the display to preserve battery life.
 
Last edited:

Thread Starter

John Berry

Joined May 17, 2016
72
There are a few ways to do it. One would be to simply power the whole thing by a battery that is cut out of the circuit when external power is available. An enhancement on that would be to use a rechargeable battery that is float charged when external power is available. The advantage of these options is that the clock keeps time while it is unpowered. To minimize the current draw you could modify it so that the display was powered only by the external power supply.

Modifying it to capture and store the time is doable, but quite a bit more involved. The circuit isn't really set up for it. How would you load the stored time back into the MCU?
Hello and thank you very much for your reply.
I don't fully understand your answers as I am a beginner, but I do appreciate you taking the time to give me advice.
I think I might have to just keep on resetting the time on powering up. Thanks... John :)
 

Thread Starter

John Berry

Joined May 17, 2016
72
If the S1500 clock is built according to the schematic, there should already be battery back up.

The S1500 kit has 5V adapter has a diode in line and an opposing 3V supply with antiparallel diode. If the chip is not retaining time, you'll need a bigger battery to last longer.

If the OP is writing the code, he may be able to use the analog comparator on board P1.0/P1.1 to and an external voltage ref check if the clock is currently powered by battery (3V) or external power (5v) and turn off the display to preserve battery life.
Thank you very much for your reply, It sounds very interesting but it is way above my limited knowledge.
I really appreciate your time, and once again thanks. John :)
 

spinnaker

Joined Oct 29, 2009
7,830
If the S1500 clock is built according to the schematic, there should already be battery back up.

The S1500 kit has 5V adapter has a diode in line and an opposing 3V supply with antiparallel diode. If the chip is not retaining time, you'll need a bigger battery to last longer.

If the OP is writing the code, he may be able to use the analog comparator on board P1.0/P1.1 to and an external voltage ref check if the clock is currently powered by battery (3V) or external power (5v) and turn off the display to preserve battery life.
Look at the photo of all the parts. There are no diodes, there is no battery. My guess it is a typical cheap Chinese project were they have a one size fits all schematic.
 

philba

Joined Aug 17, 2017
959
It's very likely that you could add those components (D1, D2, 4.7K resistor) and a 3V battery. The processor doesn't seem to test VCC or VCC1 and it appears that the battery just powers the unit with no power saving mode. I'm betting that one programmed chip is used for both models. I don't understand the point of the diode drop between Vcc and Vcc1, though.

A modern microcontroller based design would use brown out detection along with a battery to put the processor in a low power mode but the C2051 is an ancient design. No soup for you.
 
Top