# Building an Intel 8085 trainer

I'd like to build an Intel 8085 trainer for a final year project. The trainer will be used by students and will basically accept machine code entered by students, load these into RAM and run the code. Students will also be able to single-step through the code, examine memory and registers, all basic functions of a trainer. There will also be GPIO (for LEDs and such) on-board as well as some other components (LCDs, seven-segs) you might find on a dev board. A touchscreen would be a nice touch, for input and display. There should also be the option of power using cheap batteries, since electricity isnt at all reliable here. All on a PCB with packaging etc.

I've done a bit of research and thinking and concluded that there are 3 main ways I could do this:

• Get a PIC18 (or some other MCU) and program it to understand and execute all machine code input. Basically the PIC18 will emulate an 8085.
• Get a PIC18 and an 8085. Let the PIC18 serve as a monitor and control everything except running the user code.
• Get an 8085 and let it do everything from running user code to blinking LEDs on-board. Use EPROM to store the monitor code.

I have other school work that will occupy a lot of my time and it takes a month at least for ordered components to get to me (when they do), so I wont have as much time as I'd like. So I'm inclined to go with the 2nd option since it saves me the work of having to delve too deeply into the 8085 instruction set and all the associated assembly programming, which is something I barely know. Plus I think its also efficient, since it lets the 8085 do what it does best and lets the PIC handle the rest. My main aim is straight-forward (i.e. least effort :)) and effective. I'll be using 6116 for RAM and the usual 74373 for address latching. Not sure what chip to use for I/O yet (I/O-mapped I/O).

What I'd like to know is:

• Is this option really as straight-forward as it seems? Any pitfalls I should be aware of?
• Is there a better way? Maybe one not among my listed options?
• How feasible is battery power with 9 V batteries? Any better cheap alternative?
• Any advice on input? I'd like to use a resistive touchscreen and not buttons to give a modern feel (like this 7-inch TFT) but i'm worried about all the extra pin usage and if it will even be big enough? Maybe just use pushbuttons for input and use a far smaller screen for display alone?
• Any general advice on the whole thing?

-
This is a pretty ambitious for a capstone project. – Matt Young Feb 24 at 2:40
@MattYoung Is it? I hope I havent bitten off more than I can chew. Perhaps you could provide details on the main challenges I'll face. – TisteAndii Feb 24 at 2:45
Sounds like a lot of tedious work to implement a virtual machine + monitoring for an ancient processor that has no modern-day usefulness. If you're a retro computing junkie, have at it! Just keep in mind that most people will think you're silly. Nothing wrong with that, though! I'd definitely stick to implementing an interpreter on an MCU, instead of trying to interface with a real 8085. That 7" TFT would be beautiful, but don't plan on driving that with an 8-bit MCU; you'll need a high-end ARM processor with external memory (typically an app processor running Linux) to drive that. – Jay Carlson Feb 24 at 4:23
Does it have to be a physical system (which takes a lot of time , effort and debugging)? What advantages would there be over a (free) off-the-shelf software solution (e.g. 8085simulator.codeplex.com ) – JIm Dearden Feb 24 at 13:57
or just wait till an MCS-85 comes up on ebay? – peterG Feb 24 at 22:18

A microprocessor trainer is a big (and worthwhile) project, try to subdivide it into several smaller milestones. Trying to debug one massive project where nothing has ever yet worked, during the final week, is to be avoided... Consider the interfaces between the various parts and plan how to approach integration testing / debug. Since you have a fixed amount of time available to work on the project, it's important to prioritize what to do. If everything goes well then you can reach for a larger scope, but if there are problems then the scope of the project can be reduced to be still useful and deliver on-time.

I'd suggest dividing the project into steps something like this:

• System power supply
• 8085 clock, reset; verify instruction fetch is incrementing address pointer (no firmware yet)
• Compile 8085 object code from PC
• 8085 running simple firmware test toggle I/O (blink LED)
• memory test -- check for address lines short or open
• I/O input from buttons
• I/O drive HD44780 LCD
• (optional) 8085 interface with PIC18 hosted I/O
• (optional) 8085 interface to RS232 (FT232 USB cable?)
• (optional) 8085 running self-hosted monitor firmware
• (optional) PIC18 better I/O panel interface, touchscreen?
• (optional) load and save 8085 memory to host PC

It is possible to build the entire 8085 trainer running with just the 8085 itself, without any other micro -- this is how the original 8085 trainers were designed. The I/O can be as simple as a small keypad matrix and some 7-segment LED displays or HD44780 alphanumeric LCD display. (The HD44780 will give longer battery life than 7-segment LEDs, and more versatile.)

Given that you have PIC18 available and are more comfortable coding PIC18 than 8085, there could be an advantage to your proposed hybrid trainer. Use the PIC18 to manage the I/O, and use the 8085 to run the user code. This is an attractive option because you're more likely to find device driver support for the PIC18 than the 8085. However it does require that you set up an 8085 toolchain (at least an assembler) as well as your PIC18 toolchain. The good news is 8085 is old enough that whatever compilers or code you find is most likely free, but the bad news is it's also most likely no longer well supported.

I do have to ask -- what if instead of an 8085 trainer, you instead build a PIC18 trainer? If the goal is to help the student learn assembly language, PIC is probably more relevant. And unlike the 8080/8085/Z80 architecture, PIC is scaleable. However 8085 is still a good introduction to the more modern PC CPUs, since a lot of the 80x86 weirdness (like segmented addressing) comes from stretching the 8080 beyond its original architectural limits.

The intel 8255 is the standard I/O chip that was used with 8080/8085 systems, but emulating 8255-style I/O is straightforward.

The intel 8253/8254 is the standard programmable timer that was used with 8080/8085 systems. Again, this could be emulated on the PIC.

A feature you didn't mention, would be an RS232 (serial port) interface to a terminal. That would be useful for running an 8085 self-hosted monitor, so the user can read and write 8085 registers on the 8085, and single-step through their code. I'm not sure if this is essential, it's kind of a different direction that you were planning to go, but something to consider. You would need to provide routines for character input and character output. That could use either an RS232 port or use on-board HD44780 and buttons.

For 8085 self-hosted monitor, you might look into glitchworks 8080 monitor for firmware to run on your trainer board. 8080 code will run on 8085.

The ancient BDS C compiler has been released as open-source as of 2002. I think that includes an assembler as well as the so-called "brain dead" C compiler... this was before the K&R C was standardized, but could still be a useful resource.

The more modern SDCC Small Devices C Compiler supports Zilog Z80, which is a superset of 8080. It's unclear to me whether SDCC really supports 8080 / 8085 however. The main focus of SDCC is on the 8051 microcontroller family, though it does support a few others.

About powering the system from 9V battery - 8085 only requires a single 5V supply (unlike the 8080), so this could work. A switch-mode power supply would give longer runtime than a 7805 linear regulator, since the 7805 has to discard 4V x load current, efficiency will be 55%. The thing about SMPS is they are very sensitive to layout and component selection, so start with an evaluation module like the TI.com simple switcher Say VinMin 7V, VinMax 14V, Vout 5V, Iout 1A for examle; TI.com website supports several designs.

This is a pretty big project for a college senior design project for a team of one person, but I think it's achievable.

-
Thanks very much. I'm beginning to get the sinking feeling that I may just have sailed over my limits. Why do I need a toolchain for the 8085? All input will be machine code already fed directly into RAM before resetting the 8085. The general outline in my head has been: accept machine code from users with PIC and forward to RAM, add a JMP instr at the 8085 reset vector address in RAM to make it jump to where user code begins, reset 8085 and allow it to begin running the code from the RAM. Right now, theres no error-checking at all, but its only a prototype. Anything wrong with this approach? – TisteAndii Feb 24 at 8:16
Also I'm building this for 8085 because its what is used to teach MPU architecture here and changes to the syllabus are not easily made and the lab techies here and lecturers are already used to teaching 8085 and wont be willing to adopt a new platform – TisteAndii Feb 24 at 8:25
Those are good reasons to stick with 8085 as a teaching platform. And you might not require a full toolchain (C compiler / debugger), maybe all you need is an 8085 assembler -- or keep the programs very small and let the students do the instruction code lookups manually. – MarkU Feb 24 at 8:36
Actually thats what we do currently: design your code on paper in assembly, convert to hex and enter into the trainer. I wont be providing much program space anyway, maybe 1k max. What would happen if the 8085 received an instruction from memory that didnt make sense? Would it keep running? Ignore the instruction and try running the next byte as an instruction? – TisteAndii Feb 24 at 8:42

When I attended school we wire wrapped an 8088, which was great for several reasons. It was the last class to do so, later on I prepared a report for the professor and redid the entire project on a PCB (which was my first PCB and didn't work). I'll talk about these projects and what I learned from it, and what students need or should learn to prepare them for industry. I'll even throw in some info on what other schools have done.

The looked into rolling the 8088 wire wrapping into a PCB design, where the students did their own PCB layout. The professors didn't like the idea because it would take a few weeks from the class to learn PCB software and because there was only "one pass". Expense was also an issue, the most inexpensive service was 60$with no silkscreen, the components for the 8088 were around 70$. If a student failed to design a PCB, they would fail the class. If this were to be done today, there are plenty of PCB fabrication places that would be inexpensive, in addition to OSHpark.

The next version of the class was a hybrid. They tried to combine the best of both worlds, they had a silicon labs 8051 dev board with a breakout board that could be soldered and wirewrapped. The students didn't get to add memory or rom, but they did add peripherals to the I/O. They kept the same format of the labs. They also had to do some additional things like interface use the ADC's

These are the skills I think you need to have to be able to realize physical circuits and use microprocessors.
- Ability to read the datasheet (and the ability to have the desire to)
- Need the ability to prototype with soldering and/or wirewrapping. Also need to be able to fix a circuit on a PCB by cutting traces ect.
- Design an appropriate power system, inductance and resistance are an issue that people often neglect.
- Know how to address memory (ram), flash (rom) and I/O peripherals
- Know how a reset circuit and oscillator works and how it effects the microprocessor.
- Be able to debug clocks, or digital I/O with an oscilloscope and logic analyzer. - Digital Timing Requirements
- Know how to use schematic capture and pcb layout.
- Understand voltage levels and how to interface to various components (like mosfets or LED's
- How a compiler works, what the difference between a higher level language and assembly is and be able to translate between the two.

And it would be great if somebody would teach them:
- Serial interfaces, I2C, SPI, RS232
- How to use a DAC or ADC and a little bit of analog

I know of a few schools that are also going the hybrid route with freescale boards. I can't remember the chip, but they were an automotive 5V microprocessor. The students complained about the dev tools, if your going to go with a microprocessor development board make sure you look at the software. I would also go with TI, PIC or STM32F and use a microprocessor that is 5V tolerant if not powered by 5V. I think it might be hard to get a compiler for the STM23F however.

I think the route your going is great, I think the hands on approach is necessary and useful. A 9V with a regulator would also work fine (they also have 780X dc to dc converters that are drop in compatible that would give you some extra life on the battery.). If you do go with a screen and your worried about the pin count, use a screen with a serial interface. They are harder to debug, but you would be teaching about a serial bus. Good luck

-
Thanks very much. Why do I need the compiler here since the input is already machine? I have to use 8085 because its whats in the syllabus here and the lecturers here still havent caught up to the fact of how obsolete the 8085 is :/ – TisteAndii Feb 24 at 8:34