Question about how EPROMs work - Page 1
Forum section: electronics / general

author: MaximRecoil
author_rank: Regular Contributor
timestamp: July 23, 2023, 02:00:28 pm
content: Quick summary version:I replaced the original ST brand 27C512 BIOS EPROM in my 486 PC with a new one and now instead of losing the BIOS settings immediately when it doesn't have any power, it can retain them for at least 2 hours. How is it doing that?Longer version:I have an old 486 PC and the motherboard originally had a barrel-type battery soldered to it which was long since dead and starting to leak. It has the option for an external battery, so I removed the original battery and connected a 4 AA battery holder to the external battery pins, which works fine.The BIOS has always lost its settings immediately if you disconnected the battery and turned the computer off. Even if it was only off for 1 second, it would give a "low CMOS battery" warning when you booted and you'd have to press F1 to continue, which would take you into the BIOS settings where you'd have to configure the BIOS again (set the date and time, tell it what floppy drives you have, set the boot order, and tell it to autodetect the hard drive's CHS values; everything else I left default). There were no exceptions ever. If you deprived it of power for any amount of time at all then you had to reconfigure the BIOS; it was as predictable as the next sunrise.The other day I figured it would be a good idea to get a copy of the BIOS since there doesn't seem to be one available anywhere online for this particular motherboard (PX486 P3 with OPTi 495SLC chipset). After I dumped the original EPROM (UV-erasable 27C512, ST brand) I decided to burn the BIOS to a new EPROM (which was also a UV-erasable 27C512, ST brand, but it was a new/unused one) to make sure it worked in my motherboard.It worked fine, and then later I disconnected the external battery because I wanted to move some of the cards to a different slot, and the motherboard sometimes refuses to boot if you make any changes without resetting the BIOS, so whenever I make any hardware changes I preemptively disconnect the battery which immediately rests the BIOS. It took me about 10 minutes and then I turned the computer back on (batteries still disconnected), fully expecting the loud double-beep and the "F1 to continue to enter setup" message. But instead it just booted into Windows as if nothing had happened. The time was 10 minutes behind (which is better than its usual reversion to 1/1/1980) but the BIOS hadn't lost any of its settings.Then I wanted to see if it could go even longer without losing its BIOS settings so I turned the PC off and disconnected the batteries for 2 hours, and it still didn't lose its settings (the time was 2 hours behind this time when I turned it back on).So what is this new ST 27C512 EPROM doing that the original ST 27C512 wasn't doing? I can't imagine that the motherboard is able to write anything to the EPROM because it's already full (64 KB EPROM programmed with a 64 KB .BIN file), and since it's not an EEPROM, it can't erase anything to make room for new data. Also, the motherboard has no electrolytic capacitors whatsoever. The only capacitors it has are tiny film capacitors, which have next to no capacity, so I don't see how they could be storing anything for very long. And even if they could, why weren't they doing it before with the original EPROM?

author: madires
author_rank: Super Contributor
timestamp: July 23, 2023, 02:40:58 pm
content: The BIOS settings are stored in a CMOS RAM (SRAM) which is part of the clock chip (in the old days). As long as there is sufficient charge, possibly in some caps, the CMOS will retain the data. When you remove the battery and short the battery pins on the mainboard the settings should be gone immediately.

author: pqass
author_rank: Super Contributor
timestamp: July 23, 2023, 02:50:27 pm
content: The 27C512 EPROM stores only the boot code. There's no configuration info stored there except defaults. Only an EPROM programmer that applies a 12V Vpp can change it or UV light to erase it. I'm not aware of any motherboard that has done this.The battery is keeping some bit of static RAM alive; not the EPROM. Usually, the battery is a 3V coin cell, 3-stacked NiCd cells, or 3.6V lithium cell.What do you mean by "external battery pins?" What's the make and model # of the motherboard?If it'sthis MB, JP1 needs to be open.

author: MaximRecoil
author_rank: Regular Contributor
timestamp: July 23, 2023, 03:16:31 pm
content: Quote from: madires on July 23, 2023, 02:40:58 pmThat sounds like it has nothing to do with the EPROM that stores the fundamental BIOS firmware, and it's how I have always assumed it worked. So why weren't the settings ever saved when there was no power when the original BIOS EPROM was in there, but when I put the new BIOS EPROM in there the settings are saved for at least 2 hours without any power (maybe longer, but 2 hours without power is the longest I've tested it for so far).Like I mentioned before, the motherboard has no electrolytic capacitors at all, only tiny film and ceramic capacitors. It's very similar to this motherboard, except mine has 3 VLB slots:https://theretroweb.com/motherboard/image/604024a-61bc67ec1ca7f999003268.pngQuote from: pqass on July 23, 2023, 02:50:27 pmYeah, that's what I was thinking, which is why I don't understand how doing nothing other than replacing the EPROM made it suddenly able to save my configuration for at least two hours without any power.QuoteThat's also what I thought, which is why this makes no sense.QuoteThe motherboard has header pins for connecting an external battery, which is what I did a couple years ago when I removed the original soldered-in barrel-type battery (there's a thread about those old barrel-type rechargeable batteries they used to put in most 486 and older motherboards here -https://www.vogons.org/viewtopic.php?t=26539). Like I mentioned in my original post, the motherboard is a PX486 P3 with OPTi 495SLC chipset (there is no make printed on it anywhere that I can find). The manual for it is here:https://theretroweb.com/motherboard/manual/v4p495l-px486p3-5fb823bb69abe519618422.pdfSections 2.1 and 2.8 mention the external battery connector pins.The external batteries have always worked fine; as long as they're connected and the batteries are good, the BIOS retains its settings and it keeps good time. But with the original BIOS EPROM, the BIOS settings were instantly gone when it had no power (PC turned off, batteries disconnected), and the time reverted to 1/1/1980). With the new BIOS EPROM (which shouldn't have made any difference), the BIOS settings are retained for at least 2 hours without power and the only time lost is the amount of time that it didn't have power (i.e., no power for 2 hours = time is 2 hours behind when you turn it back on).Quote from: edavid on July 23, 2023, 02:59:15 pmBut it only happened during a cold boot when the batteries really were "dead" (i.e., either dead or disconnected by me). As long as the batteries were connected and had a sufficient charge, all the BIOS settings were retained and it kept good time when it was turned off.

author: Veteran68
author_rank: Frequent Contributor
timestamp: July 23, 2023, 03:18:05 pm
content: Quote from: pqass on July 23, 2023, 02:50:27 pmMany old PC's used an external battery pack attached by a JST or Dupont header on the motherboard. I've seen some that simply used AA battery holders taped/velcroed inside the case. As I recall some came with both an onboard battery and external battery pins, as seems to be the case here.

author: pqass
author_rank: Super Contributor
timestamp: July 23, 2023, 03:43:44 pm
content: Maybe the external battery connector wasn't making good contact. And the activity of replacing the EPROM may have wiggled it a bit. Then you attributed the EPROM change as the solution.If you apply, say, 10 cycles of remove/re-connect the external battery, then put back the old EPROM and update the configuration settings and time, you may find that it will retain the configuration settings.

author: wraper
author_rank: Unknown
timestamp: July 23, 2023, 04:31:52 pm
content: Quote from: MaximRecoil on July 23, 2023, 03:16:31 pmBut did you try returning an original EPROM? Maybe it's not the EPROM at all that made an improvement but you cleaning the board for example. It could be a current leakage from a backup circuit into the rest of the circuit, and you replacing M27C512 with a different one somehow reduced that leakage. Also more than a single die version of this IC was produced, so not all of them are exactly the same. Not to say if you bought the replacement from China, they very often relabel EPROMs into another similar part.

author: wraper
author_rank: Unknown
timestamp: July 23, 2023, 04:40:13 pm
content: Quote from: MaximRecoil on July 23, 2023, 03:16:31 pmThat board has tantalum capacitors though.

author: MaximRecoil
author_rank: Regular Contributor
timestamp: July 23, 2023, 05:31:28 pm
content: Quote from: pqass on July 23, 2023, 03:43:44 pmThe external batteries have always worked perfectly. This is about what happens when you disconnect the external batteries with the PC turned off.- With the original factory-installed EPROM, BIOS settings and date/time instantly reverted to defaults (nothing configured and 12 AM, 1/1/1980 for the time and date) and it wouldn't boot again until I configured the BIOS. For example, if you disconnected the batteries and pressed the power button on the PC to turn it completely off, then waited exactly 1 second, and pressed the power button again to turn it back on, all the BIOS settings were completely and utterly gone, every single time, no exceptions whatsoever.- With the new EPROM that I programmed using a copy from the original EPROM, BIOS settings are retained for at least 2 hours while the PC is turned off and the batteries are disconnected, and the time of day is only off by the same amount of time that the PC had no power available to it.Quote from: wraper on July 23, 2023, 04:31:52 pmNo, I hadn't tried putting the original EPROM back in there. It's kind of a pain to get to and I had figured it would just go back to the way it was before, but I just tried it and it didn't go back to the way it was before. Now it's retaining the BIOS settings even when turned off and the batteries disconnected, with the original EPROM in there, just like it first started doing when I put the new EPROM in there the other day.I don't know what to make of that. I'd already had that original EPROM in and out of its socket several times about two weeks ago when I was trying to figure out why the PC was always freezing after being on for about 10 minutes or less. It turned out to be a heat issue. I put a heatsink + fan on the CPU and it's been 100% stable ever since, even when running nonstop all day. I didn't have a heat sink or fan for the CPU before because most people don't put one on an AMD Am486DX2-66, and it's not printed on the CPU itself that it needs it (back then, the ones that needed a heat sink / fan had it written on them; like onthisAMD Am486DX4-100 for example). But it was during a heat wave here and I guess the 95-degree F ambient temperatures were more than it could handle without any cooling.Quote from: wraper on July 23, 2023, 04:40:13 pmYes, it does. I was thinking that tantalum capacitors were a type of film capacitor, but Google says they're a type of electrolytic capacitor.I still have no idea why it can suddenly retain BIOS settings for at least 2 hours with no active power source. I've had it since 2002 and it has never been able to retain BIOS settings for even 1 second without an active power source.