How do I actually PROGRAM a z80, 8088, 8035, or their predecessors? (schematic, code, assemblers, UVeproms?)?

I have a z80, apparently, with supporting ICs, on a PCB waiting to be salvaged. All I could find online for z80 programming was this guy who was making a whole computer out of it. And a lame "z80 world" site that doesn't help me. Also, on a separate board, I have a couple of Toshiba TMP8035P (with UVeprom nearby), whose online "datasheet" says that it's instruction set and pin compatible with the intel 8048.

I have programmed microcontrollers before, so I know a tiny bit of what is needed for programming them. (Note: modern microcontrollers, in basic-esque languages, notably picaxes and basic stamps)

My problem is in how to actually make the program on my computer, press the download button, and the chip run the program. I have no idea how to do assembly, (or find the right assembler). I am also clueless as to hook the computer up to the chip. (I suspect it requires a parallel port, but I think I only have DB9-pin serial easily available. I do have a single parallel port in a win98 computer, but it would be a pain in the butt.)

In addition, I don't have a UVeprom eraser light. (I have an uncle who does, but I only meet him every now and then. Maybe he would let me borrow it?)

Another problem is, I'm on a time limit. It does not have to be done tommorrow, but if I do not clear the garage of my currently un-programmable outdated microcontrollers soon, I will be too busy with college this fall of 2009 to work on those things, and my parents will force me to throw them away.

As for the 8035's my uncle also needs room in his garage, and if I can't program mine soon, then he will throw away his remaining stash of them. (No sense in holding on to equipment your nephew can't program in a timely fashion)

By the way, the same uncle dumped a CMX controller on me, with a weird keyboard, huge scroll wheel mouse, and the big box with computer-like guts inside, and a gazillion I/O ports on the back. He said it could be programmed, but Wikipedia said the company that made this video-editing machine went bankrupt or something. If I had the "instruction set", I assume assembly, in addition to a download circuit, then I can use this thing for controlling lots of cool things.

Oh, and my uncle is very nice to me, so don't think I don't like him just because his hobby is dumping old junk on me.

PS: I'm just whining, but it seems all these old microcontrollers, equipment and whatnot assume I grew up with these. I didn't, so anything beyond plugging in a basic program to a picaxe is rocket science to me. (No, I'm not Russian)

sort by: active | newest | oldest
There are a bunch of guys who would love to help get this working over at http://groups.google.com.au/group/n8vem Either reply to myself or (top right on the N8VEM site), sign up and post a message.

Or build one from scratch http://www.smarthome.viviti.com/build

You can program in assembly, but that is hard work! Better to use BASIC or C or other high level languages, where you can get "Hello World" working quickly.

You 'program' a board by sending it programs, like MBASIC, via xmodem which is a protocol that exists on terminal programs (eg free Hyperterminal in Windows). Uses just 3 wires on a standard serial port same as picaxe/arduino. Then start typing a program, save it, compile it etc.

As for the downloading, that is all very complicated behind the scenes, and it has taken about 30 people on the N8VEM group over 2 years to get it working. But now, you get the benefit of all that, because all the code is written and all you have to do is put it in an eprom, fire up a vb.net program and hit 'download' and you can download a package of C, Basic and a text editor all in one go.

I've written lots of code for picaxes as well but I always seem to run out of memory. Z80 and CP/M have 64k which takes weeks of coding to fill up.

I got eprom programmers and UV erasers off ebay.

There is heaps more I could add, but before going off on a tangent, any chance you could give some more info about the actual Z80 board?
Unit042 (author)  James Moxham7 years ago
I'm currently looking at the links you provided to learn more. Nice work with the homebuilt computer! Tiny suggestion: it might be more convenient to move the switching power supply off the motherboard, and supply it separately, then a regular ATX power supply could step in for the el-cheapos....
Anyway, you seem to be implying that a regular C compiler will go directly to an eprom? Or was it that the C goes through the vb.net then the eprom? Is there a program I can download that will put out z80-specific assembly? (is z80 assembly any different from regular assembly?)

I really like the idea of a three-wire, single-click program download. Can you go over the process with more detail?

As for the z80 board, I was going to slavage the components off of it, take the z80CPU itself out of its socket, and put it on my own board. (Yes, I could use the old PCB to get general pinouts, but figuring out where to take I/O would be a nightmare)

Oh, and my college classes have started, so don't worry if you don't see me for a couple of weeks at a time; college is demanding! But no fret, I won't give up on the z80!

Tekk: What is a UART?(Nevermind, I'll look it up.) I was planning to have my win.98 computer run a RobotBASIC script to send commands to my Basic Stamp or Picaxe via computer's serial port, then do the pin-pulsing and hoop-jumping required...... 

PS: Lemme google for a UVeprom prgrammer circuit....
Unit042 (author)  Unit0427 years ago
I just remembered, I have a couple of 9 or 10-bit or so SRAMs (sorta like a parallel stack of demultiplexors with their inputs tied..... nevermind), does that help the situation?<br /><br />What kind of clock signal do I send to the z80 CPU? Crystal oscillators are beyond my comfort zone, so I'm gonna do my own oscillator. Do I send a simple 0-5v square wave to one "osc" pin? What do I limit the current to?<br />The pinout:<br /><a href="http://www.geocities.com/siliconvalley/peaks/3938/zinout.htm">http://www.geocities.com/siliconvalley/peaks/3938/zinout.htm</a><br />It's a couple of blocks down, under "Z80 CPU Pin Description:"<br />The clock pin is 6.<br /><br />I'm looking for a pin-by-pin dexcription and hookup guide, but until I find one, I'm thinking the D0-7 are I/O, the A0-15 are memory inputs, rfsh is a refresh for DRAM. How does it access the memory location address? Hmmmm.... I'm confused.
AzamA95 months ago


How programming A80486 Microprossesor

S_AMD-A80486DX-40 (no win logo).jpg
darrencch5 years ago
Have a look for talking electronics z80 computer or look on youtube for z80fantazy to see one working they are still for sale through talkingelectronics.com
 I have been doing this quite a while, and I have to admit that working with the vintage processors requires a variety of skills. Getting the processor to communicate with you usually requires a prom with correct enough startup code to initialize a serial port and interact with you. This requires some assembler skills unless a monitor image is available for the specific board you are working with. Between those days and now, great strides have been made in the area of making it easier to take the first few steps. That doesn't mean that doing it the old way was a waste or not satisfying when it started working. All the skills involved are important, and not a waste to learn. Some of the things you need are: getting proper power to the board. getting the serial port wiring right for the handshaking needs of the board and the terminal or emulator you are using.

I just built up a Z80 board from a blank circuit board, and I was surprised at how many things I had to remember or learn to get it going. Writing code for the prom can be done on paper by hand, or using cross tools that run on your PC, or using tools that run on your board itself. Test equipment that helps you get things going can be as simple and cheap as a logic probe, or as complicated as a few hundred dollar logic analyzer that hooks to your PC.

How you come at it also depends on how far you want to take it. If you are planning on having the board light a LED, and saying to yourself, wow I did that, you can do it by hand more cheaply. If you want to interface devices and write more interesting controlling code, you might want better tools.

Feel free to get in touch with me if you need a bit of advice to proceed. I am douglas underscore goodall at mac dot com.
rgreenlee7 years ago
Actually you could make it come alive and talk to your Windows '98 box through the DB9 jack without having it need any RAM memroy as the Z80 is just robust enough to be able to come up to a debug menu (Dump Memory Range etc.) without any RAM at all by just using its internal registers for the slight storage needed for an EPROM based typical-featured Debug Program communicating through the RS232 connector, assuming the board it is on has one that is. 

Still you would need to be able to program an EPROM and although you could construct one that would do the job via the parallel port and a program in say BASIC on your Windows '98 computer I'd guess even that is going to be far more than you'd be willing to invest time in, and buying one would cost too much I guess.

All of my Z80 computers are in the landfill now.  When they were buried they were fully capable of coming up to the CP/M prompt if plugged in and  turned on.  My Windows '95 computers followed after them.  I still have the Windows '98 computers though but they're all running XP now.  I also still have some Z80 stuff in an emulator in Windows, however the  Windows 8080/Z80 assemblers and disassemblers etc. aren't going to do you any good without first being able to make the EPROM to plug into the Z80 board to bring it to life via its assumed-to-be-present serial port.

The Z80 board probably has some RAM on it so in the end you could probably download an assembly language program to it and run it.  Probably for no useful purpose really other than simply having done it.  I used to do things like that before I stopped.  That is why if I myself found such a board in my garage I would place it in the trash rather than waste my time on it. 

Tekk7 years ago
I'm also making a simple Z80 system. To answer your question about getting the program to the chip without a programmer/eraser: Put the EPROM out in the sun for a week to erase it. Hook up the chip to power (search the datasheet) Wire all of the address pins to 0 for the first byte Wire the data pins to either 1 or 0 depending on what the data is Pulse the Write Enable pin low Repeat for all 8,192 bytes. I know I don't want to program the whole chip by hand, so what I did is bought a 16C550 serial UART chip and wired it to the Z80. Now I can write a very short downloader program that pulls the program from your PC serial port and stores it in the ROM. I would program the downloader in the ROM and then use the serial port chip to connect the system to my PC. Good luck!
Unit042 (author)  Tekk7 years ago
Tekk Tekk7 years ago
Also, if you use the Z80 you have to wire the data and address buses to all of your chips. Looking up the 8048, it's actually a microcontroller so it has memory and I/O built in. Maybe you would want to start with that.
You really need to find a rom-emulator - like this
Unit042 (author)  steveastrouk7 years ago
Sorry, but it looks expensive, and I already have UVeproms lying around....
So now you need an EPROM programmer, and an eraser as well
....Also extremely not cheap.....

The emulator lets you avoid the burn-crash-debug-erase cycle somewhat, but then you need an eraser to zap all your misprogrammed EPROMS.

...or you can junk 'em and play with the Arduino instead.

Maybe your Uncle would also think it was cool to play with modern stuff and be amazed at what you can do through the serial port !

Unit042 (author)  steveastrouk7 years ago
Ouch, not cheap indeed! But how were EPROMs programmed before the "universal" programmers?
lemonie7 years ago
If you are after Z80 machine code try searching for that phrase.
While I wouldn't disagree with steveastrouk the Z80 is a great little 8-bit processor, I admire your intent to do something with it.
(And you can get ZX Spectrum emulators for PC)

Unit042 (author)  lemonie7 years ago
I don't want to seem rude, but the machine code doesn't help me until I can get the program from the computer to the chip..... Is there a z80 basic? (boy, am I a noob!) And the emulators allow me to simulate programming z80 without the bother? Hmmmm....
lemonie Unit0427 years ago
The thing won't be basic unless you've got the chip built into a computer with a BASIC interpreter (e.g. like the ZX spectrum). It is an 8-bit microprocessor, and like the CPU in your PC it needs a clock, I/O channels and memory at the very very least. You will have to give it machine-code, which it will read from the memory.
See if there's anything useful on Ebay? There are some books and machines that look relevant.

To be honest, what's the point ? Modern microcontrollers, with onboard Flash are the only way to go. Going retro is going to bore you rigid. I've come up from the Z80, Z8671, 8052 route, we use 89V51s in our products still. Steve