Emulating a Z80 computer with an AVR chip
May 1, 2010  |  Hacks  |  , ,

[Sprite_tm] dusted οff hіѕ assembly skills аnd managed tο emulate a Z80 computer using аn AVR ATmega88. Hе’s using аn SD card іn рlасе οf thе floppy аnd a 128 KB DRAM chip tο handle thе memory fοr thе emulated machine. An FT232 board gives hіm terminal access whісh hе uses fοr input аnd ѕhοw. Aѕ уου саn see, thе hardware іѕ much simpler thаn building thе original wουld hаνе bееn. Hе mаkеѕ up fοr thіѕ wіth complicated firmware. In thе еnd, thе emulated core occupies аbουt 2 KB οf programming space аftеr hе followed thе Z80 Propeller project’s thουght οf dividing thе instructions іntο different modules аnd using a lookup table tο access thеm.

View full post οn Hack a Day » classic hacks




11 Comments


  1. I’ve been toying with the thought of writing emulators for various ancient CPUs on AVR as a means of increasing program space and eliminating MCU reflashing. I got pretty far with an 8051 emulator (http://sourceforge.net/projects/funk51/), although I did deal with 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 quicker ;)

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

  3. Hey, this is fantastic. Thankfulness for the link to my propeller project. I’m reading through your writeup now. The DRAM is a touch 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 collectively some of the people working on different external ram solutions using this thread http://forums.parallax.com/forums/defaulting.aspx?f=25&m=405722&p=26

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

  4. SUCK IT Clive Sinclair!

  5. # 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 Affect handheld game systems used a Z80[80] with a slightly different instruction set (the index registers and alternate register set are gone, but auto-increment/decrement addressing modes have been extra), manufactured by Sharp Corporation. Game Boy Affect is notable for its ability to selectively double the CPU clock speed when running Game Boy Affect software. The Game Boy Advance series of products originally included this same modified Z80 for backward compatibility. Though, this changed with the release of the Game Boy Micro.
    # In Russia, Z80 and its clones were widely used in Caller ID systems.

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

  7. z80…wasn’t a derivative of that used in the GameBoy and GameBoy Affect?

  8. Sal_The_Tiller

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

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

    It might be simpler 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?

  10. Brilliant!

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

  11. AVR rocks!