View Full Version : Build a CP/M computer in 90 minutes

March 4th, 2009, 02:45 AM
The challenge: take a pile of chips and build a working CP/M machine from scratch http://drvernacula.topcities.com/n8vem.htm

Parts: a N8VEM kit, PockeTerm kit, surplus VGA monitor ($10 at a computer store), keyboard and a wireless transceiver module.

All the parts are big enough to solder easily. Total cost was about $150. No moving parts. Boots in under 1 second. Parts bought new (though many chips have manufacture dates in the 80s). Half a watt power consumption if using just the small LCD display.
30 minutes for the PockeTerm, 30 minutes for the N8VEM, 10 mins to program the eprom and 20 mins to plug it all together and download a few programs. Now I can write Kaypro Sbasic in Wordstar and compile it on the board itself with no PC needed at all!

March 4th, 2009, 04:37 AM
The N8VEM is a great project. I have several S100 machines (an Altair, and IMSAI and a NorthStar) but they're all too big. I keep them in the lab downstairs but when I want to use them, I'm usually in my home office upstairs, so it's not convenient.

The N8VEM is in a Eurocard format so it's very compact. I built the CPU, disk drive and bus monitor cards (because I like the blinkenlights) and mounted them in a cherry wood case. Instead of a real IDE hard drive I use an IDE->Compact Flash adapter. The entire board stack consumes a little more than 1a at 5v. I'm working on a battery pack for it now so I don't have to drag a power brick around with me. All I have to do is connect the serial cable and flip a switch, and in a second or two I'm playing Colossial Cave!

Terry Yager
March 4th, 2009, 11:20 AM
Now I can write Kaypro Sbasic in Wordstar and compile it on the board itself with no PC needed at all!

That's the spirit, doc! Now ya get it, running CP/M on the real metal is much gooder than emulation on a PC, even if it does take a leetle longer to compile a prog. It just feels right.


Terry Yager
March 4th, 2009, 11:28 AM
Aw c'mon, Rich. Ain't ya gonna show us?


March 4th, 2009, 11:47 AM
Aw c'mon, Rich. Ain't ya gonna show us?


I actually have pictures posted on the N8VEM Google group. Maybe this weekend I'll create a simple page on my regular Web site with some pics.

March 4th, 2009, 11:55 AM
[QUOTE=Dr_Acula;92085]The challenge: take a pile of chips and build a working CP/M machine from scratch http://drvernacula.topcities.com/n8vem.htm

One of these days, I'm just gonna have to do this!


March 4th, 2009, 12:48 PM
Re "That's the spirit, doc! Now ya get it"

Indeed, for the first time I look at this project in a different way - this is a complete computer now. For instance, I wanted to change one setting in some code. So boot up the computer, fire up wordstar, change one bit of text, recompile and run. Ok, the wordstar and recompile bit were slower than on a PC emulation, but overall it was quicker because CP/M boots in 1 second (vs 4 minutes for my XP laptop).

But I'll keep searching ebay etc for real CP/M computers...

March 4th, 2009, 01:56 PM
I notice the board you used is quite different from the boards I ordered from Andrew Lynch last year. I have briefly looked at the Propeller boards and just wonder what it plugs into - looks like a serial port on your card, of which you have three? I wonder if I would do that to my board(s) later on, if it is the 96-pin backplane connector one would utilize.. hm, perhaps wrong thread here but never mind.

March 4th, 2009, 02:00 PM
LOL I thought no-one would notice. Yes, that is a custom version of the N8VEM (the mini N8VEM) which has one serial port switched to 4 physical ports using a couple of decoded lines from the PIO chip. But it will still work fine with the standard N8VEM. All the PocketTerm needs is a 3 wire serial connection at 9600 baud. It even has headers on the board so you can swap pins 2 and 3 over.

March 4th, 2009, 02:09 PM
Aha, so PocketTerm on the Propeller card is actually a terminal application, not a .. how should I put it .. generic VGA and keyboard interface to the N8VEM card. Whichever difference it makes, I don't know.

March 4th, 2009, 02:31 PM
Yes, it takes a keyboard input and turns it into RS232, and it takes RS232 and turns it into characters on a VGA display. Essentially it replicates the old serial dumb terminals that were everywhere 25 years ago. Vince has put all the VT100 codes in for moving the cursor round etc.
Some CP/M machines had inbuilt displays, but the ones I used in the early 80s had seperate RS232 terminals. Maybe it could be relevant for other CP/M machines out there where, say, the computer works but the display has died.

March 4th, 2009, 05:39 PM
I actually have pictures posted on the N8VEM Google group. Maybe this weekend I'll create a simple page on my regular Web site with some pics.

I made up a project page tonight with a few pics:


I'm building a battery pack for my system so I can run it without a power brick. I'll add more pictures when that's done.

March 4th, 2009, 06:56 PM
That is a great looking case. Perchance the N8VEM qualifies as vintage if it is made in wood? At least one doesn't have to worry about yellowing plastic.

March 5th, 2009, 05:01 AM
That is a great looking case. Perchance the N8VEM qualifies as vintage if it is made in wood? At least one doesn't have to worry about yellowing plastic.

Actually it started off just as a way to reduce stress on the connectors while I was troubleshooting and testing EPROMS, etc. Then I started looking on eBay for Eurocard card cages but they're ugly. I brought it upstaris to my office to play with one day (tested it on the Mac) and I decided that if I really wanted to use it (and get it approved by the "boss"), it couldn't look ugly. I have a NorthStar Horizon -- which has a wood top -- in the shop and it just clicked.

The battery pack is finished. The configuration consists of an N8VEM system with the buss monitor and Disk-I/O with a CF hard drive. The battery is a Tennergy 4200mAh/7.2v high-discharge R/C pack. The system was running the Interface Age Prime Number Sieve under MS-BASIC. The run time was almost exactly 3 hours. My initial guess based on current consumption (about 1.1A) and conversion efficiency of the regulator (up to 92%) was 3:30, so the actual is pretty close.

I’m looking into a low-battery cut-off for the pack. There’s no communication between the pack and the N8VEM so there’s no “smart cut-off” to protect the battery from deep discharge. I found a circuit based on the MAX8212 CPU supervisory monitor and which only requires three parts, so I may build it, although if I found a ready-made solution for $10 I'd buy it.

Next thing I want to work on is wireless RS232. I have two Proxim RangeLAN wireless serial bridges, but they're big and ugly and aren't really battery-operatable (at least with any kind of efficiency). I was looking for something really small and power-efficient to replace the console cord.

In the N8VEM forum, I found a message from you about the Hope Electronics RF transceivers:
http://www.hoperf.com/pro/HM-TR.html . Did you ever try these? If so, where did you order them from? It looks like this would really do the trick. They operate on 5v and current consumption is very low.

March 5th, 2009, 11:29 AM
Double wow even. Those RF transceivers look fantastic. Looks like there goes more money from my bank account.

March 5th, 2009, 04:00 PM
I've got to get me a wooden case too. The shed 'junk' is starting to migrate into the study and the only way to keep the missus happy is to make it look good. I wonder how well cherrywood comes up with oil/polish?

Re radio, a lot of work has gone into this over several years with many experiments on many types of modules. Just last night it culminated in an big experiment running all night with three CP/M boards building links to each other and auto-finding each other, and building up statistics on the reliability of links. An essential part of this is the ability to transfer files which in the case of CP/M can be between 2k -50k. I've settled on xmodem because it is a simple protocol and it has some error checking and the ability to resend, and it times out after a while if a link fails. Also the source code is available.

Xmodem sends in 132 byte packets. This appears to be a problem with many radio transceivers, the Hope ones included, because many of these modules have a maximum 32 byte packet. What happens is after the module gets 32 bytes it sends them on - and then can miss getting the next one or two. I wrote a modification to xmodem that collected bytes in groups of 30 and then inserted a pause to give the module time to forward the data. This did work but it slowed down the transfer of data (and at 1200 baud it is pretty slow anyway).

There are some new generation modules coming out which are only $10 each from TI I think (and made in China) but they have 64 bytes in the buffer.

It has been a long search but the only module so far with a big enough buffer (256 bytes in fact) is from Yishi http://www.yishi.net.cn/index.asp?id=47

They cost $23US each. This is a small company so I don't think they have any resellers around the world. Also they don't take paypal, and there were some fixed costs from both ends to send money via a good old-fashioned bank wire transfer. On the other hand, from my end I discovered my bank has a single page form to do a wire transfer so it was as easy as paypal.

So the options for wireless are to get cheaper modules and hack the xmodem assembly code to put in delays, or to use more expensive ones and just plug them in and go. Both solutions have been tested and work.

There also has been a concern from a few users of the Hope modules about them resetting their baud rate setting with power brownouts. The Yishi ones come pre-programmed from the factory and while this is slightly less flexible it is more reliable. I chose 1200 baud because it goes the furthest, but they go a lot faster than that. If it was just around the house I'd have chosen 9600 baud.

The hardest part about wireless is preventing data clashes. Boards have local LCD displays and have a serial port which normally would go to a dumb terminal. Indeed, a simple setup is to take a Pocketerm and replace the wire with two transceiver modules. The problem is when you have many modules - especially with xmodem if two modules are exchanging a file then everyone else has to be quiet. I've got some little cp/m programs that turn Echo on and off, because you want echo to be off if you are transferring files. But sometimes you want it on to see what you have just typed. Also, dumping large amounts of data with random bytes between 0 and 255 into an A> prompt in CP/M will cause CP/M to eventually choke and crash. So it is better to be running a program that is capturing the data. I've got a program that looks for any bytes between 128 and 255 and assumes this must not be text so it must be an xmodem transfer between some other boards. So it goes to sleep for a minute and so doesn't interrupt that other transfer.

But it is now possible to have 3 boards in a RF mesh, plus a 4th transceiver module on the end of the PC serial port, and to talk to just one board in particular with a one line command.