Emulating a Z80 computer with an AVR chip

[Sprite_tm] dusted off his assembly skills and managed to emulate a Z80 computer using an AVR ATmega88. He’s using an SD card in place of the floppy and a 128 KB DRAM chip to handle the memory for the emulated machine. An FT232 board gives him terminal access which he uses for input and display. As you can see, the hardware is much simpler than building the original would have been. He makes up for this with complicated firmware. In the end, the emulated core occupies about 2 KB of programming space after he followed the Z80 Propeller project’s idea of dividing the instructions into different modules and using a lookup table to access them.

Comments

  1. donov4n says:

    AVR rocks!

  2. Mikey says:

    Brilliant!

    I notice the propeller plug… is that the ft232 component? More infos!

  3. matt says:

    This is pretty awesome. I’ve toyed with the thought of implementing an emulator on the AVR, it’s good to see someone actually do it!

    It might be easier to emulate a simpler processor like a 6502. And if you use a 40-pin chip, you have enough I/O pins for an 8-bit data bus. Apple II emulator for AVR, anyone?

  4. Sal_The_Tiller says:

    Now we just take it back in time to the team that invented the Z80.

  5. jbot says:

    z80…wasn’t a derivative of that used in the GameBoy and GameBoy Color?

  6. jbot says:

    And then I click the link…lol. At least I have the ever-so-nerdy association there…

  7. Frogz says:

    # It was also found in home video game consoles such as the ColecoVision,[78] Sega Master System[79] and Sega Game Gear video game consoles, as an audio co-processor in the Sega Mega Drive and as an audio controller and co-processor to the Motorola 68000 in theSNK Neo-Geo.
    # Nintendo’s Game Boy and Game Boy Color handheld game systems used a Z80[80] with a slightly different instruction set (the index registers and alternate register set are missing, but auto-increment/decrement addressing modes have been added), manufactured by Sharp Corporation. Game Boy Color is notable for its ability to selectively double the CPU clock speed when running Game Boy Color software. The Game Boy Advance series of products originally included this same modified Z80 for backward compatibility. However, this changed with the release of the Game Boy Micro.
    # In Russia, Z80 and its clones were widely used in Caller ID systems.

  8. Hirudinea says:

    SUCK IT Clive Sinclair!

  9. James Moxham says:

    Hey, this is great. Thanks for the link to my propeller project. I’m reading through your writeup now. The DRAM is something we considered on the propeller but never have quite got working. It saves a lot of chips – well done on that one! I might see if we can pull together some of the people working on different external ram solutions using this thread http://forums.parallax.com/forums/default.aspx?f=25&m=405722&p=26

    There are some ideas we could jointly brainstorm with caching bits of memory to speed things up. I’m bursting with ideas now!

  10. kernelcode says:

    Gameboy on the AVR! Oh man I’m so gonna try to do that.

  11. moslevin says:

    I’ve been toying with the idea of writing emulators for various old CPUs on AVR as a means of expanding program space and eliminating MCU reflashing. I got pretty far with an 8051 emulator (http://sourceforge.net/projects/funk51/), although I did manage to get Tetris running on it, using a shared memory interface for performing video, timing, and gamepad syscalls… This is slicker, and probably a lot faster ;)

  12. Paul Potter says:

    Superb.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,278 other followers