how to replace Maxim's NVRAM with something else, homemade if it's possible - Page 1
Forum section: electronics / projects

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 07:44:43 am
content: so five years ago I spend a bit of money on NVRAM set of ICs, with a parallel bus, 2Mbyte of ram internally power supplied by a battery, and as usual, the battery has recently died, thus the NVRAM doesn't keep its bits and bytesI won't buy a new chip, I'd prefer building my own non-volatile static ram module.Hints on the circuit? That needs tocheck if the main power line is present on the Vcc pin of the moduleimmediately operate, switching the ram's Vcc to the battery when the main power line of the module is going offlineimmediately disconnect the battery and force the RAM into read-only (write disabled), when the main power line of the module is online (the battery is not rechargeable)provide enough current to avoid bits to be lost, but last for the longest possible (>5 years?) once the module's main power offthanks

author: calmtron
author_rank: Regular Contributor
timestamp: August 03, 2018, 07:48:25 am
content: Lithium battery and a small schottky diode.

author: 2N3055
author_rank: Super Contributor
timestamp: August 03, 2018, 07:50:08 am
content: One option is to replace it with FRAM...

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 07:53:22 am
content: they are those two ICs in the pic with the label "DALLAS". I have always seen FeRam with SPI interface, mine need to use an 8bit parallel asynchronous busedit:yes, ICs in the pic are not of 2Mbyte of size, they are smaller; I have a second board with the same kind of ICs subjected to the same kind of trouble since mainly these ICs need to keep programs and configuration.

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 07:55:02 am
content: Quote from: calmtron on August 03, 2018, 07:48:25 amthat sounds interesting; isn't too simple?

author: Kleinstein
author_rank: Super Contributor
timestamp: August 03, 2018, 07:56:24 am
content: Besides the 2 diodes to decide between the power sources, one might want to have a kind of brown-out detection / voltage supervisor to disable at least write access when the normal supply is down. Depending on the RAM chips used, one of the chip select / enable pins needs to turned to "off" state to bring the supply current down.There are some FRAM chips with parallel interface too. There is a thread somewhere around for FRAM use in HP meters like the 3458.

author: helius
author_rank: Super Contributor
timestamp: August 03, 2018, 08:26:17 am
content: http://www.cypress.com/products/nvsram-nonvolatile-sram

author: Kjelt
author_rank: Super Contributor
timestamp: August 03, 2018, 10:53:34 am
content: You can operate on the Dallas chips, access the battery and solder two wire to an external battery, I can't find the original pages from the guys who first thought of this but to get an impression it is something like this:https://hackaday.com/2017/08/06/a-new-battery-for-a-potted-clock-module/

author: iMo
author_rank: Super Contributor
timestamp: August 03, 2018, 11:52:17 am
content: This is how I did it long time back. Mind the schematics below has been drawn while sailing south Pacific without actual testing and requires some elaboration. Especially the R1 and R2 has to be set such it works reliably (it depends on the fet's Ugs_threshold voltage). You may play with fet's wiring as well (/WR signal at source or drain, you know what I mean).Not for direct use. Provided as-is. Use at your own risk.

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 01:00:55 pm
content: Quote from: Kjelt on August 03, 2018, 10:53:34 amyup, maybe a choice, eventhistopic is talking about that

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 01:02:46 pm
content: Quote from: imo on August 03, 2018, 11:52:17 amthanks! that's intriguing source of inspiration, to be simulated with PSPICE, and eventually implemented to check results

author: In Vacuo Veritas
author_rank: Frequent Contributor
timestamp: August 03, 2018, 02:51:41 pm
content: Quote from: legacy on August 03, 2018, 07:55:02 amYou can use a FPGA if you want, but the diode will do the job. Why do you want more complicated? You're like the guy length-matching his TTL signals...

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 03, 2018, 03:10:02 pm
content: How often does it get written to? Maybe an EEPROM would be a good replacement?

author: helius
author_rank: Super Contributor
timestamp: August 03, 2018, 03:18:04 pm
content: EEPROM requires an erase/programming pulse pattern and not just latching the data onto a port, so it is a much more complicated adaptation.

author: james_s
author_rank: Super Contributor
timestamp: August 03, 2018, 04:07:42 pm
content: The Dallas NVRAMs contain an ordinary SRAM IC, and a Dallas/Maxim power management IC, along with a lithium coin cell. You can assemble your own if you want, or you can cut into a dead one and wire up an external battery. I've been meaning to lay out a board for a replacement but have never gotten around to it.

author: free_electron
author_rank: Super Contributor
timestamp: August 03, 2018, 05:04:17 pm
content: be careful. as the power goes down the main cpu will start behaving erratically and may still corrupt data in the nvram.The real solution is to use a voltage monitor. if the voltage goes below a certain threshold : cut the Chip enable to the ram so the processor can not do crazy shit. the ram is write protected now. then slap o the reset to the cpu and hold it in reset until power is restored.there are small 8 pin chips that are built for that ti 7705 max 691 and some others. look at 'cpu supervisor'

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 08:06:02 pm
content: Quote from: NiHaoMike on August 03, 2018, 03:10:02 pmwhen the board is running, it uses the ram as ramdisk, and it writes often into the ram.Quote from: NiHaoMike on August 03, 2018, 03:10:02 pmthe board in the pic only have 32Kbyte of expansion, but my second board card needs 4 ICs of 2Mbyte each for its nvram-disk-array

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 08:07:22 pm
content: Quote from: james_s on August 03, 2018, 04:07:42 pmprecisely, I'd like (if it's possible) to design my own power management circuit.This is the idea of this topic.

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 08:19:01 pm
content: Quote from: free_electron on August 03, 2018, 05:04:17 pmyes! exactly what happened on my fingerboard.Quote from: free_electron on August 03, 2018, 05:04:17 pmIntriguing idea! Can it be down with a OA? Monitoring Vcc=5V and Vbat=3V?Code:boolean A: MainPower is offlineboolean B: request of /CE from the boardboolean Y: /CE issued to the RAM chipABY000: MainPower is not offline, /CE request issued to the RAM chip011101: MainPower is offline, /CE request rejected, the RAM chip remains in the high impedance111Y=A OR BA={ "1" if Vcc <= Vbat; else "0" }

author: legacy
author_rank: Super Contributor
timestamp: August 03, 2018, 08:30:45 pm
content: Quote from: helius on August 03, 2018, 03:18:04 pmyup, the same applies to FLASH, since writing to a FLASH require erasing and reprogramming a pageIf you look at my board's pic, you see there are:- two UV-EPROM ICs for the firmware (the operating system is ROMable)- two NVRAM ICs for the ramdisk + stack + variablesthe stack and all the operating system's and application's variables are initialized on bootstrap, but the RAM needs to be accessible with a byte granularity, and the same chip needs to be used as RAM-DISK.Applications and configurations are stored by linear chunks, with a table that points to their start-address.The firmware also contains a minimal GDB-stub, but ... it needs the RAM to operate, and the 68000 CPU doesn't have internal ram (MC68332 does have 1Kbyte of internal ram, as well as 68HC11 does have 512byte or 1Kbyte of internal ram, 68000 does not have, all the ram is out of the chip, and on my board this ram is NVRAM)

author: james_s
author_rank: Super Contributor
timestamp: August 03, 2018, 09:43:45 pm
content: Dallas/Maxim sells the exact same voltage monitor/power management IC that is used internally in their NVRAM products. I don't recall the part number but it's one of their standard parts. If you look at an xray of one of the modules you can see the separate ICs mounted on a PCB inside.

author: Ian.M
author_rank: Super Contributor
timestamp: August 03, 2018, 09:49:20 pm
content: You need to look closely at the datasheet of whatever SRAM you are going to use to determine what has to be done with /WR, /RD and /CS to put the chip in minimum power standby mode as otherwise control signals being pulled low by the powered down logic of the rest of the board may vastly reduce the battery life.Its essential that the under-voltage write protect circuit operates before the 68000 crashes during a brownout or at power down. Typically you'd use a PSU supervisor chip (reset controller) to write protect the RAM in the 5V rail drops below 4.5V.As Kjelt pointed out, surgery on the Dallas chips to expose the battery connections and isolate the dead battery is possible. Then you could epoxy CR1632 holders directly on top of the Dallas chips, and hook them up with magnet or wirewrap wire. Ideally, if you know anyone who can, get one of the chips X-rayed to find the battery location and its connections. Otherwise, you can try to find the edges of the steel battery case using a tiny rare earth magnet.

author: james_s
author_rank: Super Contributor
timestamp: August 03, 2018, 09:56:39 pm
content: I've xrayed a few of them and have the scans around somewhere, the battery location varies from one type to another though. If the batteries are made of magnetic material the magnet is a good idea, I've never tried that.

author: oPossum
author_rank: Super Contributor
timestamp: August 04, 2018, 09:46:31 pm
content: This is something I was thinking about recently. I have a CDP1802 system that I would like to make the RAM nonvolatle. The attached schematic is what I came up with. Questions/comments welcome.

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2018, 01:41:06 am
content: Yes, some red LED are above 2 volts. I should have specified that a Vf of 1.6 or 1.7 should be used. Could also be a single blue or white LED, a Zener, a TL431 or various other things.

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 01:41:13 am
content: this is what Maxim does for their NVRAM's by usingthisIC.@oPossum2.2V is the minimum voltage drop across the red-diode for it to light upIf I understand correctly, your threshold is 4.4V.

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 01:44:07 am
content: (sorry Safari has blocked, and I have accidentally deleted the previous post: has been reposted above)

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2018, 01:55:50 am
content: The threshold for turning on Q2 and enabling /CE,/RD,/WR would be approximately Vf *2 + 1.3. So if the Vf of the LEDs is 1.7, the threshold would be about 4.7V. Increasing R2 would lower the threshold if needed.

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2018, 01:57:55 am
content: Switching /RD and /WR probably isn't necessary in most cases. A careful read of the SRAM data sheet for standby conditions would be required to determine that.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 05, 2018, 04:00:30 am
content: Perhaps you could carefully cut open the module, remove the battery, and replace it with a battery holder?

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2018, 05:15:07 am
content: Revised to use fewer parts. /CE switching only.

author: james_s
author_rank: Super Contributor
timestamp: August 05, 2018, 06:28:02 am
content: How is that pile of discrete components better than the little IC already intended for this exact function?

author: oPossum
author_rank: Super Contributor
timestamp: August 05, 2018, 06:54:13 am
content: It isn't. The little IC is no longer in production.

author: Ian.M
author_rank: Super Contributor
timestamp: August 05, 2018, 08:42:52 am
content: You can vastly simplify it by using aMCP112-450, and a BAT54C or similar dual common cathode schottky diode for feeding +5v OR Vbat to the RAM's Vcc pin. Feed the MCP112 from the +5V rail. As the behaviour of the MCP112 is undefined below 1V, it will need a pulldown on its output, to drive the gate of the 2N7000, and you'll need a pullup on the RAM's /CE pin as above.Incidentally it looks likeJamecoandFuturelecstill have stock of the DS1210, so for one-off mods to existing MCU boards, that's still an easy option - bend out /CS and Vdd on the SRAM and dead-bug the DS1210 + a SMD lithium coin cell holder on 3M VHB tape.

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 11:45:31 am
content: your idea is intriguing!Quote from: oPossum on August 05, 2018, 01:55:50 amwhere does 1.3V come from? Ib * R3?is Ib equal to (Vcc-0.7V)/R2 ?thus, R3/R2 *(Vcc-0.7V) ~= 1.3V, correct?

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 11:57:20 am
content: Quote from: Ian.M on August 05, 2018, 08:42:52 amyes, I can design a little drop-in PCB with a socket for a common static-ram in DIP package, a little battery holder, the DS1210 IC in DIP package, and two pin-strip-header-connectors to drop-in

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 12:12:22 pm
content: Code:boolean A: MainPower is goodboolean B: request of /CE from the boardboolean Y: /CE issued to the RAM chipABY000: MainPower is good, /CE request issued to the RAM chip011101: MainPower is not good, /CE request rejected, the RAM chip remains in the high impedance111Y=A OR BA={ "1" if Vcc <= Vmin; else "0" } // for CPUs like 68000, Vmin=4.5Vthus, assuming vbat=3V, we have 3 working zoneszone0: Vcc is { 5.0V .. 4.5V } -> main-power is Good, NVram is power-supplied by Systemzone1: Vcc is { 4.5V .. 3.0V } -> main-power is not good but NVram is not yet power supplied by batteryzone2: Vcc is { 3.0V .. 0.0V } -> NVram is power-supplied by battery, RAM forced in the high impedancezone1 and zone2 must protect the NVram from data corruptionhere Maxim has introduced a delay if the NVram is found with a /CE & /WR request when the System is in zone1, and their IC assume there is enough energy to complete the write-cycle before entering into zone2but, frankly, I wouldn't implement this featureedit:note to me: don't forget the Voltage drop around each Schottky diode is ~0.3V

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 12:31:25 pm
content: Quote from: oPossum on August 05, 2018, 01:57:55 amas far as I understand from a couple of datasheets, /CE = high should force the interface into high-impedance, ignoring signals on /RD and /WR

author: 2N3055
author_rank: Super Contributor
timestamp: August 05, 2018, 02:49:34 pm
content: Like David Hess already said in other topic, just use MXD1210. DS1210 is not available anymore. MXD1210 is and is a replacement chip.Still, I would look into FRAM if possible. There are parallel versions ..

author: james_s
author_rank: Super Contributor
timestamp: August 05, 2018, 03:33:21 pm
content: I recall having trouble finding parallel FRAM chips, 5V versions and especially DIP versions are even harder to find.

author: 2N3055
author_rank: Super Contributor
timestamp: August 05, 2018, 03:45:42 pm
content: Quote from: james_s on August 05, 2018, 03:33:21 pm5V certainly is a problem. Making SMD to DIP converter is still simpler than putting together SRAM version.OP never said exactly which DS chip is trying to replace. There are battery backed up SRAM chips from ST that are still in production. I replaced one in my AOIP calibrator 6 months ago...

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 03:51:53 pm
content: Quote from: 2N3055 on August 05, 2018, 02:49:34 pm- I need 2Mbyte- in DIP package- 5V chip- parallel bus, compatible with 68xxx's bus- price under 10 euro per chip

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 03:58:51 pm
content: Quote from: 2N3055 on August 05, 2018, 02:49:34 pman old stock might be a choice (from China?)Quote from: 2N3055 on August 05, 2018, 02:49:34 pmYup. definitively the chip to go!I have addressed to DS1210 Simply because Maxim has ANs about DS1210.It's the first result found by searching on their website.

author: legacy
author_rank: Super Contributor
timestamp: August 05, 2018, 04:01:25 pm
content: Anyway, I like a lot the oPossum's scheme, it's a good exercise!

author: james_s
author_rank: Super Contributor
timestamp: August 05, 2018, 04:09:53 pm
content: The Dallas chips from China are invariably either old stale stock that has been re-marked, or counterfeit fakes. I've bought a few of those and most were defective in one way or another.I'm really not sure why they bother to counterfeit them, for the price they ask I would be happy to buy knockoffs under some random Chinese brand provided they actually work. Then I wouldn't feel ripped off upon realizing they're not genuine.

author: free_electron
author_rank: Super Contributor
timestamp: August 05, 2018, 07:31:43 pm
content: Quote from: oPossum on August 05, 2018, 06:54:13 amthere's a metric ton of others that do the same...these ics have a state machine on board . they protect against different brown out levels, have multiple thresholds to decide when to go from what state to what state. there's like 6 or 7 different voltage levels controlling the state transitionabove 2.1 volt the ram is powered from the bus as opposed to from battery. once above 4.xx the cpu is brought up then a bit later the ce is released. if something goes back wonky it transistions back into safe ode.Oh, ond you need to use these chips with low power srams. you can't just use any sram. the SRAM needs to be guaranteed to retain data at very low working voltage ( won to like 2.5 volts ) .back in the day hitachi was the reference. the standard 6264 was the normal sram. the 6264L or 6264LL was the extreme low power sram if i remember it right .even at 2 volts that ram would still retain the data. To force it in that mode you need to make sure that CE was at a higher voltage level than than the power of th ram.it would consume like 5 microamps in that state while retaining the data.http://bitsavers.trailing-edge.com/components/hitachi/_dataBooks/1991_Hitachi_SRAM_Data_Book.pdfas for chips:digitkey lists 1121 parts ...https://www.digikey.com/products/en/integrated-circuits-ics/pmic-supervisors/691?k=battery%20backup%20circuit

author: Zucca
author_rank: Unknown
timestamp: August 06, 2018, 03:35:07 pm
content: https://www.eevblog.com/forum/testgear/tektronix-2465b-oscilloscope-teardown/msg583398/#msg583398

author: free_electron
author_rank: Super Contributor
timestamp: August 07, 2018, 05:59:24 pm
content: the problem with using an fram is that the cpu can still go wonky and corrupt the data. you really need a supervisor circuit to cut the chip enable

author: oPossum
author_rank: Super Contributor
timestamp: August 11, 2018, 04:26:12 pm
content: Quote from: Ian.M on August 05, 2018, 08:42:52 amThanks for the tip about the MCP112. I didn't know Microchip made those.

author: oPossum
author_rank: Super Contributor
timestamp: August 11, 2018, 04:32:14 pm
content: Quote from: legacy on August 05, 2018, 11:45:31 amQ2 will turn on at about 650 mV. R2/R3 form a voltage divider with a 2:1 ratio, so the voltage at the bottom of R3 has to be about 1300 mV below the +5 volt supply for Q2 to turn on.