• Please review our updated Terms and Rules here

CP/M on NVRAM?

I suppose one could always shadow a segment of memory if writing occurred to that area, then discard the "shadow" on re-boot. It might well be possible to re-organize/re-compile CP/M such that writing occurs only with a given range of addresses. I think this cat can be skinned, but is it worth it?
 
I like the idea of fast boot. It has value even in the current era. Think about how long most embedded systems take to boot? Sometimes minutes... An "instant on" OS would be useful for IOT.
 
I was reading the specs on the STMicroelectronics M48Z35-70PC1 and that appears to act as a normal SRAM chip would.

Ugh. That's one of those gross abominations that's just a SRAM chip and a battery buried inside a wad of epoxy. I wouldn't want to incorporate that into a homebrew design, especially at $22 a head. For that you could probably do something cute like use a DS1315 clock/calendar/NVRAM controller plus a 512KB RAM chip to roll your own with 16 times the memory capacity.

I like the idea of fast boot. It has value even in the current era. Think about how long most embedded systems take to boot? Sometimes minutes... An "instant on" OS would be useful for IOT.

Is speed booting from a ROMdisk really a problem? I guess I don't remember how long the Osborne I had 30+ years ago took to boot, but my TRS-80 Model I takes literally about a second to boot from a floppy disk. (Single density, no less.) I think TRSDOS and CP/M are roughly comparable in terms of memory footprint, if anything CP/M might be slimmer. I would think the time to copy the resident part of CP/M from a ROM (or battery backed-up RAM) drive would be measurable in milliseconds.

I mean, I guess maybe there might be some value, if you wanted to cook up some kind of portable or "resume-able" CP/M machine, in coming up with a "sleep" function that could suspend the machine and allow it to resume without rebooting when power came back, but that's a slightly different kettle of fish. If you used a CMOS Z80 I think you'd be fine with just halting the clock, IE, you might not really need to do anything as long as you're happy with keeping power on to whole core of the system. If you did want to power off everything but your NVRAM storage then I guess you could probably implement an interrupt routine that would save the registers and issue a power off; your boot ROM would then of course have a routine to look for a register save state on CPU reset and attempt to resume instead of going through the normal initialization process.
 
Well, I'm trying to stay with the DIP as I will be wire-wrapping this entire project. so.....

Is this for an existing CP/M machine or are you making your own CP/M machine from scratch? ( You already have serial and parallel cards, so by the time you add RAM, you're only a CPU away from your own machine )
 
What about battery-backup for your RamDisk PCB? That should be easily doable?
That is a possibility, but if I can get NVRAM, then I can dispense with that circuitry. I still haven't decided and still toying with some ideas. I need to get the 'MemDisk' software written. And that will take some time.
 
That is a possibility, but if I can get NVRAM, then I can dispense with that circuitry. I still haven't decided and still toying with some ideas. I need to get the 'MemDisk' software written. And that will take some time.

Like I said, the downside of those NVRAM parts (not the FeRAMs, those are a different animal) is that all they are is a normal SRAM with that circuitry and a battery encased in epoxy. When you apply power the first time you blow a little fuse that starts the battery discharging, and then in a few years you'll have an epoxy encased doorstop.

For a wirewrap friendly solution that uses a relatively easy to find part look at the datasheet for the DS1315 Phantom Clock time chip. The main point of this chip is, of course, to be a date/time clock chip that doesn't require any uniquely decoded address space to operate, but it also has built into it the same circuitry that those NVRAM modules have internally to switch between normal power and a battery backup. Pair one of these with a CMOS SRAM chip that's happy running on ~3v when in low-power mode and you have an NVRAM. (The very common AS6C4008 512Kx8 SRAM with TTL-compatible outputs can run on anything from 2.7-5.5v so it should pair with it nicely.) You can use either a single Lithium battery or a pair of AA's to run it, and of course they're replaceable, unlike the epoxy package. (And, again, both the DS1315 and the AS6C4008 are available in through-hole DIP, no surface mount necessary. Only other part you need is a 32khz watch crystal.)

When it comes to availability and pricing the DS1315 tends to be kind of stupidly expensive if you buy it quantity one from places like Digikey, but the 1315 is pin compatible with the older DS1215 and behaves the same. And, well, I know your mileage may vary on used parts from sketchy sources, but a couple years ago I bought a batch of DS1215s from AliExpress for about a buck each and they work fine. The DS1215 is the chip you'd find inside those old "Zero-Slot Clock" modules that fit into a ROM socket on old 8-bit computers, I'm guessing there's a fair chance the chips I bought from AliExpress were literally whittled out of some of those.
 
Like I said, the downside of those NVRAM parts (not the FeRAMs, those are a different animal) is that all they are is a normal SRAM with that circuitry and a battery encased in epoxy. When you apply power the first time you blow a little fuse that starts the battery discharging, and then in a few years you'll have an epoxy encased doorstop.

For a wirewrap friendly solution that uses a relatively easy to find part look at the datasheet for the DS1315 Phantom Clock time chip. The main point of this chip is, of course, to be a date/time clock chip that doesn't require any uniquely decoded address space to operate, but it also has built into it the same circuitry that those NVRAM modules have internally to switch between normal power and a battery backup. Pair one of these with a CMOS SRAM chip that's happy running on ~3v when in low-power mode and you have an NVRAM. (The very common AS6C4008 512Kx8 SRAM with TTL-compatible outputs can run on anything from 2.7-5.5v so it should pair with it nicely.) You can use either a single Lithium battery or a pair of AA's to run it, and of course they're replaceable, unlike the epoxy package. (And, again, both the DS1315 and the AS6C4008 are available in through-hole DIP, no surface mount necessary. Only other part you need is a 32khz watch crystal.)

When it comes to availability and pricing the DS1315 tends to be kind of stupidly expensive if you buy it quantity one from places like Digikey, but the 1315 is pin compatible with the older DS1215 and behaves the same. And, well, I know your mileage may vary on used parts from sketchy sources, but a couple years ago I bought a batch of DS1215s from AliExpress for about a buck each and they work fine. The DS1215 is the chip you'd find inside those old "Zero-Slot Clock" modules that fit into a ROM socket on old 8-bit computers, I'm guessing there's a fair chance the chips I bought from AliExpress were literally whittled out of some of those.

Don't flash capable SRAMs follow normal SRAM timing, and automatically control the writes? These are all 28 pin or 32 pin plastic dip carriers.

Maybe just use some of these: https://ww1.microchip.com/downloads/en/DeviceDoc/doc0270.pdf 8k version or
https://ww1.microchip.com/downloads...ged-Parallel-EEPROM-Data-Sheet-DS20006386.pdf - 32k x 8 version.

Atmel 28 series EEPROM - They work just like SRAM. Myke, you could buy some and just fit it to your board you made, and you will instantly have a RAM Hard Drive ! :) You can also use these for normal memory, and you can write individual bytes almost randomly - There might be some cross-page limitations and I don't know how it would handle writing disparate bytes across memory pages in sub-microsecond intervals, eg, write page 0, write page 1, write page 0 - But for your application these are ideal. They use 64 byte pages, but that should work with your application.

Also there a some big-ass versions with 256 byte pages, although these have a slightly longer write, but mostly are accessed just like SRAM. You need to write the ENTIRE page though - any uninitialised bytes will be rewritted as FF erasing the previous data - So in the case of using with CP/M you're going to have to add blocking and deblocking for at least 2 records.

1Mbit ( 128k x 8 ) version.

Or maybe the 512x8 version ( There's a full DISK on a chip! ) - And they access the same as normal SRAM.

Winbond make a nice version at 512K x 8 also.

And, as I mentioned, these would transform your existing RAM disk into a RAM HARD disk... And being a disk, write cycles aren't really a problem.

Regards
David
 
Don't flash capable SRAMs follow normal SRAM timing, and automatically control the writes? These are all 28 pin or 32 pin plastic dip carriers.

They *don't* really behave exactly like SRAMs; the datasheets for the ATMEL28s are pretty clear that you can't just willy-nilly treat it like a completely random access device; it has a cache of continuous bytes that fills up and when it's either full or the timeout has passed it goes into a write mode which locks it out from either read or write access until that cycle is done. Unless you write your software around this you'd have to put in some kind of arbitration circuitry to automatically insert wait states when the chip locks out I/O for write cycles. And of course the other devices don't even go that close to looking like SRAMs, they write 256 byte pages *destructively*. They're really only like SRAMs *electrically*, IE, in terms of bus layout and handling of WE/OE signals.

Granted, none of this is a deal killer since we're specifically looking for a disk substitute, not normal addressable memory, and writing the software for it anyway, but... just going to chuck this out there, why bother using any of these when you could just interface an 8-bit IDE subset with a CF or SD adapter on it and get comparable performance via an already disk-analogous API?
 
Or maybe the 512x8 version ( There's a full DISK on a chip! ) - And they access the same as normal SRAM.
https://media.digikey.com/pdf/Data Sheets/Atmel PDFs/AT29C040A.pdf

FWIW, the AT29C040A is listed as an obsolete/no longer manufactured part in all the top Google hits for it. If you really want to roll your own flash drive the SST39SFxxx series is widely available (when not sold out) and still in production, and it's rated for 10x the durability of the older part when it comes to write cycles. Downside is it has 4K sectors instead of 256 bytes, so... again, maybe it makes sense to use a CF or SD instead. The controllers for those generally include some kind of wear leveling, you get that for free, although the flash itself they're made out of is in most cases less durable on a per-sector basis.
 
Not exactly like an SRAM, no, but in Myke's case, where he is emulating disk operations, it should be close enough... Though it also might require waiting after 64 bytes, polling then writing the next 64 bytes for a write cycle.
 
@Eudimorphodon , I don't know what it is about your responses, but they always lead to great ideas - thank you. You got me thinking about the page size, and while the W29C020 version might only be 256x8 (2Mbit) it has 128 byte pages, which makes it perfect for use with CP/M and no blocking/deblocking required.... It does require that the *entire* page is loaded, but any order ( I need backwards, Myke's board could probably do it whichever way ) but then it will write the entire record as a single operation. With the way my disk routines work, I almost don't need to worry about the 10ms write time, but I should put some kind of "disk wait state" circuitry in I suppose.


It's like it was made for CP/M... And at 256K, it's the perfect size :) And they are DPID and cost $1 each....

I'm not too worried about stuff like wear levelling, because it's more reliable than magnetic media - Given "disk" type operations, unless someone starts using virtual memory, or has some crazy log file creation requirements, 100,000 write operations should be a piece of cake... Well, maybe 10,000 in my case, because I ordered the B suffix units, because $1 each, but even 1K chips would be fine for disk operations in most CP/M applications...
 
Don't flash capable SRAMs follow normal SRAM timing, and automatically control the writes? These are all 28 pin or 32 pin plastic dip carriers.

Maybe just use some of these: https://ww1.microchip.com/downloads/en/DeviceDoc/doc0270.pdf 8k version or
https://ww1.microchip.com/downloads...ged-Parallel-EEPROM-Data-Sheet-DS20006386.pdf - 32k x 8 version.

Atmel 28 series EEPROM - They work just like SRAM. Myke, you could buy some and just fit it to your board you made, and you will instantly have a RAM Hard Drive ! :) You can also use these for normal memory, and you can write individual bytes almost randomly - There might be some cross-page limitations and I don't know how it would handle writing disparate bytes across memory pages in sub-microsecond intervals, eg, write page 0, write page 1, write page 0 - But for your application these are ideal. They use 64 byte pages, but that should work with your application.

Also there a some big-ass versions with 256 byte pages, although these have a slightly longer write, but mostly are accessed just like SRAM. You need to write the ENTIRE page though - any uninitialised bytes will be rewritted as FF erasing the previous data - So in the case of using with CP/M you're going to have to add blocking and deblocking for at least 2 records.

1Mbit ( 128k x 8 ) version.

Or maybe the 512x8 version ( There's a full DISK on a chip! ) - And they access the same as normal SRAM.

Winbond make a nice version at 512K x 8 also.

And, as I mentioned, these would transform your existing RAM disk into a RAM HARD disk... And being a disk, write cycles aren't really a problem.

Regards
David
I am definitely going to look into EEPROMs now...... Given, at least at first glance, NVRAM and EEPROM are basically the same, for the purpose of being a drop in replacement for byte wide SRAM, that can retain data after power off; what really is the difference....
 
I am definitely going to look into EEPROMs now...... Given, at least at first glance, NVRAM and EEPROM are basically the same, for the purpose of being a drop in replacement for byte wide SRAM, that can retain data after power off; what really is the difference....
Right, the main difference (as previously mentioned) is that you have to be "organized" about writes. You need to write a "page" (as defined by the chip) at a time, and poll for completion.
 
Right, the main difference (as previously mentioned) is that you have to be "organized" about writes. You need to write a "page" (as defined by the chip) at a time, and poll for completion.
Looks like I will be doing some reading and researching. The 4-megabit (512K x 8) 5-volt Only 256-byte Sector Flash Memory one does look very inviting though. 256 byte sectors.... That could be a good fit for my project; that would work well in an 8 bit system where I have the lower byte (of 3 bytes) just for that purpose.
 
I've been using the 28C256 (NOTE! 64-byte pages!) models lately, and the write protocol does deserve some studying but once you get it down it's not too bad. I'm sure you can get plenty of help on this forum.

There are many variations. The 39-series (e.g. SST39SF040 512Kx8) does not appear have a page write mode, seems you must write each byte alone and then poll for its completion. Not sure if that adds significant time to the overall write, though.
 
I forgot your project used 256 byte pages.... Yes, that would fit well. Whereas I would need to the use the 256x8 due to my 128 byte pages.

I ordered some from Aliexpress... About a dollar each. But ebay seems to have a lot also.
 
Back
Top