jakethompson1 wrote on 2024-05-24, 20:18:
I didn't realize these took +5V, but in the datasheet they do. I believe we have all noticed the following behavior: on a barrel battery board, the board will hold the settings across reboots (because of the charging circuit) and even after the board is powered off for an hour or so (because of capacitance?).
In contrast, on a Dallas board, once the Dallas battery is totally dead, as soon as you save and exit BIOS setup, everything is gone.
The power structure is different between the chip types. The Dallas chips have a dedicated battery power input pin, and switch over to pull power from that pin for memory conservation and the clock oscillator when the main supply voltage fails. On the other hand, the "old RTCs" have just one power supply pin, and the chips switch between "fully operational mode" and "battery backup mode" depending on the voltage on that pin. A typical construction is to feed this combined power pin via diodes from both the battery and the +5V supply. It makes a lot of sense to place a 100nF decoupling capacitor on the supply pin of the "old RTC" after the diodes, which will be charged by the operation voltage and can be used as "backup voltage". Assuming the 5oonA maximum current in the Dallas sheet is in the ballpark of the actual current used by older RTCs, this current consumption a 100nF cap should be discharged by 1V (with ticking clock) within a fifth of a second, so it would take less than a second to completely discharge that cap - unless the clock stops ticking at ~2.5V, and the chip stops using any significant amount of power and yet keeps the memory charged until ~1.7V.
On the Dallas chip, there is no current path from +5V to charge anything that lies in the backup power supply path.
jakethompson1 wrote on 2024-05-24, 20:18:
Is that because the +5V doesn't power the NVRAM? Or because the BIOS looks at the dead battery bits in one of the RTC registers and wipes the settings during POST?
Even Dallas chips keep the memory contents and run the clock while discharged. So the oscillator and the memory is obviously also powered by +5V. If you get a deleted CMOS with the message "CMOS checksum bad", it's not because the "dead battery bit" is detected, but because the memory physically lost its contents. Only if you see "CMOS battery low" without "CMOS checksum error", the BIOS might have cleared the CMOS due to "low battery".
The Dallas chips keep reporting "low battery" even when the RAM and clock is powered using +5V system operation voltage. So if a BIOS really would clear the CMOS based on the "low battery" bit, it would clear the CMOS on every reset, even with uninterrupted mainboard power. This does not match my experience with 486/Pentium boards. On the other hand, some BIOSes have some code in it that checks the "low battery" bit and causes spurious behaviour. One curious case is strange floppy issues, because on some BIOSes, the "get drive type" BIOS function fails on purpose if the "low battery" bit is set. On the other hand, those BIOSes also intentionally do not halt the POST on the low battery issue, so you don't even see any warning unless the POST is also halted for a different reason (e.g. keyboard missing, IDE drive not connected).
See Re: Strange Floppy Disk behaviour 486 for my initial report of that story.