I couldn't stop thinking about the 8085 running Altair basic, so I built one. I tried to do the simplest thing I could think of (meaning simplest hardware, minimum amount of programming). So I took the 8085, a RAM chip and the 6850 and used a PIC microcontroller as the bootloader to pre-load the RAM, then switch control to the 8085. Many many hours of wire wrapping later, here is the result:

and yes, it runs 4k BASIC:

One more of the rat's nest:

That's 50 feet of wire.

When it turns on, the PIC loads the bootloader into RAM, and reads it back and outputs it with the 6850. It's using the 8085 HOLD input to do the DMA. This PIC has a "Parallel Slave Port" which is a microprocessor interface port, with it's own RD, WR and CS so it can communicate asynchronously with the microprocessor. I use this for the switch register. The PIC loads the value for the sense switches, then releases the HOLD and RESET for the 8085 and the 8085 takes over the RAM and the 6850 and starts running.

Of course it's not really an Altair without real lights and switches and the ability to single step, set the program counter, etc.

Yes. The bootloader image is essentially stored in the PIC's program ROM (actually flash RAM). The PIC just copies it to the external RAM.

As you probably know, to load BASIC into the Altair without a ROM card, you had to enter a tiny program into RAM with the front panel switches. This bootloader program then would run and load BASIC from paper tape or cassette tape.

Here, the PIC is automatically loading the bootloader into RAM instead of using front panel switches.

I confirmed that 8K BASIC and Extended BASIC also run. This confirms that the sense switch register is working since these require different switch settings than 4K basic. I've tried several BASIC programs like startrek for example. Here's the schematic:

Last edited by xprt on Oct Mon 26, 2009 1:35 am, edited 6 times in total.

To do a switch panel and to single-step and assert a JMP command I will have to be able to read the status lines when HOLD is asserted. Is that possible? S1 and S0 help tell where the machine is at. Otherwise I can just count T states but it is like driving blind.

The datasheet says S1 and S0 are unspecified when HOLD is active. You probably have to use the READY line instead of the HOLD line. When you go from RUN to STOP you can lower READY at the beginning of each cycle and then you have as much time as you want to check the S1 and S0 line for an opcode fetch cycle. Keep stepping through the cycles with the READY line, stop at the opcode fetch, then jam your JMP instruction followed by the address bytes. Here is where you need to disable the RAM from responding to RD.

It would be nice to use one clock for both processors. With two clocks there will be a random shift of at most 1 cycle of the AVR relative to the cycle of the 8085. If you divide down the AVR clock and use that to drive the 8085 clock, they will always be exactly in sync.

I would rather use the READY signal to control the CPU. I understand what you are saying now that the RAM has to be disabled, so I will have to change my circuit to not just share the CS input but the AVR must be able to control it over the CPU.

I did some re-wiring to use the READY line using this circuit:
When I raise the RUN line, this circuit will drop the READY line on the first CLK edge after ALE goes low. This stops the 8085 at the right time: when the address is latched, and the 8085 is trying to read from memory. When I raise the STEP line, the 8085 will run for one machine cycle and then stop again. When I lower the RUN line, the 8085 will run continuously.

I wrote these routines for the PIC to control the 8085: STOP at instruction fetch cycle; RUN; Jump to an address; write to RAM; step to next address (do a NOP). With these I can do all the functions of the front panel.

I tested this by taking the 8080 program to echo characters and re-located it to start at location 010000 (octal). Then I wrote a program for the PIC to STOP the 8085, Jump to 010000, write a byte to RAM, step to the next address with a NOP, write the next byte to RAM, etc., then jump back to 010000 and RUN the 8085. ...and it works!

At this point I could easily add the lights and switches and have a working computer with a front panel that can run Altair BASIC. But adding the front panel is a big arts and crafts project involving making a panel that looks good, lots of wiring and lots of potentially expensive switches. I'm not sure I'm into that right now.

I can post the complete schematic and/or source code if anyone is interested.

Last edited by xprt on Oct Mon 26, 2009 1:28 am, edited 1 time in total.

OK:
Source Code (c code)Schematic (pdf)To add LEDs involves adding buffers to the address, data, and status lines.
Adding switches could be done in various ways. One way would be a switch array, with the PIC reading the switches. I left the 8 address lines connected to the PIC, but they are not used and could be used to connect to a switch array, which would require about 10 I/O pins.