Z80 Based Raspberry Pi Look-alike

Homebrew computers are the ‘in thing’ these days and the Zilog Z80 is the most popular choice for making one on your own. We have seen some pretty awesome builds but [Martin K]’s Z-berry is the smallest on record yet. As the name suggests, the retrocomputer conforms to the Raspberry Pi form factor which includes the GPIO header.

The Z-berry is designed with a Z80 CPU running at 10 MHz (20 MHz possible) and comes with 32 kB ROM
and 512 kB RAM. In addition to the serial interface, the computer boasts an I2C bus, an SPI bus, and a PS/2 keyboard connector to boot. [Martin K] has a video where the finished system is enclosed in a Raspberry Pi case and has an I2C OLED display attached and working.

[Martin K] has posted a lot of details on how to make your own Z-berry which includes the BOM, schematic and preliminary information. We reached out to him to find out more about the software which is stable and available on request along with PCBs and sample code. Additionally, this project promises to draw much less current than the Raspberry Pi and should prove useful for anyone looking to create a retro solution to a modern problem.

It is interesting to see projects that combine modern techniques with retro technologies. One of the best Z80 projects we have seen is the FAP80 and there are some awesome homebrew computer projects on Hackaday.io for you to take a look and get inspiration.

[Thanks for the tip Matej]

53 thoughts on “Z80 Based Raspberry Pi Look-alike

      1. If it’s a Z-80, it should be simple.

        CP/M had the I/O separate, in the “Bios”. So porting meant dealing with I/O. After a while, I gather how to do it, was well defined. Some of it meant dealing with the same hardware but on different addresses. New hardware meant you couldn’t copy from an existing driver, though often it meant relatively little changes, a UART driver had the same basics even when hardware changed.

        This is a big reason CP/M got onto so many machines, a bit of code needed changing, not a recompile of the whole OS. It was an 8080 only OS, of course. If you didn’t have that CPU, you were out of luck, The Z80 worked since it was a superset of the 8080. Eventually there was a Z80 variant of the command processor, I remember Steve Ciarcia mentioning it.

        When PCDOS came along, Microsoft used the same scheme, keeping the I/O separate, which is why the clones came out so easily, at least until applications dealt with hardware directly for faster operation, at which point the hardware had to become more compatible.

        Michael

        1. Well, I was “Who in this day and age hotlinks” but then I had to look into your site and find that exact picture, nice little project you did there. good to see “Truth” telling the truth ;)

    1. It is no problem at all. my first computer was a Z-80 running on S-100 hardware using CPM. It is not widely known that MSDOS used very nearly the same BIOS calls as CPM. Really MSDOS is a super-set of CPM. In the early 80’s I converted quite a few programs from CPM to MSDOS. In most cases it was a few simple translation tweaks of the the BIOS calls.

  1. Excellent build and he used mostly 74 series SSI – no CPLD or FPGA. I’d like to know how the PS2 port is working. It’s not real clear on the schematic – looks like it would take a lot of CPU polling or interrupts, but there is no CTC.

      1. By “keyboard buffer” I assume you mean the micro-controller in the actual keyboard ??? How many key “rollover” does it have ???

        Do you also bot-bang the serial protocol ???

        1. I2C, SPI and PS/2 protocol are bit-banged for sure, just “master-controlled” (without interrupt-based “tasks” initiated neither by peripherals nor a timer), driving the respective communications only when needed by the application.

          AT-PS/2Keyboards handle the rollover internally, sending key up and down events accordingly (so any combinations can be detected in software with simple key states tracking) or storing them in a 16 bytes buffer when host is busy and hold the clock line down.

          “We reached out to him to find out more about the software which is stable and available on request along with PCBs and sample code” : Really ? I contacted Martin and and he told me that it was still under development. Firmware and source code should be released by August.

  2. I put together a 4 MHZ Z80 based CP/M 2.2 system. CP/M shipped with BIOS in 8080 assembler source. You had to modify it and assemble it to add H/W like printers and serial ports, or change floppy drive types. There were no drivers per say. You wrote your own driver using the documentation from the hardware supplier. The BIOS stubbed out functions like read sector, write sector, seek track, etc. You filled the code to required to command your floppy controller and defined your floppies capabilities, # tracks, #sectors per track, #bytes per sector, etc. I wish I had saved that stuff. Loved the huge transformer and capacitors the size of 12 oz beer cans that provided unregulated power to the S100 bus. Each card had on board regulators. My system had the following cards. Z80 CPU card with monitor ROM and console serial port, 64K DRAM card, 2 serial + 1 parallel port card, dual floppy controller based on a Western digital chip, Hayes 300 baud modem card, hard disk controller card based on an huge ceramic 8×300 processor, that ran hot enough to burn you, connected to a Tandon HD odd 7MB capacity I seem to recall. I used that beast to develop applications in Pascal MT+… A typical compile and link cycle took up to 45 minutes! Those were the days

    1. Then I switched to Turbo Pascal 1.0 that sold for $49 that a friend bought my. I wasn’t going to pay for toy compiler as I was using the state of the art $400 Pascal MT+. I finally got around to playing with Turbo Pascal. I think the total size of TP was single file of around 20k and that included the compiler, a bulit-in word star compatible editor (I think this may have been one of the first IDE) and monolithic 10k runtime library.

      After tweaking the I/O to make the application compile in TP (Pascal at that time did not define any standard I/O capability) the program compiled in 1-2 minutes not 45. I realized there were true computer gods. Anders Hejlsberg was and is one. At the time I thought it was huckster Phillipe Kahn. TP 1.0 was written in some of the tightest most efficient Z80 assembler ever created. I know this because one of my friends disassembled it, reverse engineered it, and translated it run on and create 68000 code because he was so impressed with it. As far as I know he never released TP 68K into the public domain he used it to code firmware for telephone switching boards.. This may be the first expose.

      1. Dude, clam down! You’re going to need a heat sink! I’m a Commodore man myself. Still have three, including second generation PET. Word processor, spread sheet, database, all included. Including Forth and Quick Basic compliers. All in 4k on my C64.

        1. Quote [Yaakov L Bright]: “All in 4k on my C64”

          If you asked someone to do that “all in 4k” now days then they would look at you like you don’t have a clue about programming.

    1. With hardware video output it could easily play that game at 10 MHz. The early chips were only about 2 to 4 MHz. It probably could ‘almost’ do it with a terminal emulator that supports color but it would probably get a bit glitchy with that frame rate. The old CPU’s didn’t create a new image for every frame, instead they only changed the existing frame and that was a lot less challenging with the old slower CPU’s from that era.

      1. That’s very interesting.

        The ULA chip (video chip with extra IO) can fit into a 5 Volt Xilinx XC95144 (144 macros) or XC95288 (288 macros) CPLD with some limitations.

        I would guess that you could fit the unlimited version into a 5 Volt tolerant Altera EPM240 (approx 240 macros) or EPM570 (approx 570 macros) and these are far more available now days, I see them on ebay quite often thay may well still be in production.

        The point is that these chips will work with older 5 Volt chips like the Z80 etc.

      1. I have one, so very much real. Not sure if he ever intended then to be something you’d be able to buy or make yourself. I’ll ask.

        In any case, I was refuting the claim of “smallest Z80 system”.

    1. > Z-Berry is the smallest* Z80 based computer ever built.
      > Original Z80 CPU, modern RAM and ROM with 74xxx discrete logic ICs.
      >
      > * The smallest computer with original Z84C00 chip, not Zilog microcontrollers nor other Z80 derivatives.

      Looks like the creator of the Z-Berry is trying (in vain) to defend his claim. Unfortunately, the Z84C00 is not an “original”, since the original Z80 was an NMOS design with a fMAX of 2.5MHz, and his uses the updated CMOS design.

  3. This is great. Bringing the Z80 into the Raspi fold. I’m poring over the schematics and digging for more info. I guess the SPI is bit-banged? I don’t see a hardware shift register.

    My own olduino/Z is a similar idea with an arduino form factor: https://olduino.wordpress.com/about-2/about-olduinoz/

    I’m sure there are other Z80 kits available but the “Membership Card” that powers the olduino is quite approachable. It has an SD card attachment and will run CP/M Real Soon Now. http://www.sunrise-ev.com/z80.htm

    1. Yes, The SPI I2C / PS2 is bit banged. The project creator answered that question above. Seems like the keboard does the key rollover internally so you can just access the PS/2 keyboard port when requires. A PS/2 mouse is much the same as it reports the offset since the last read.

      Throw in a SD and a FAT system and some basic video and your on your way to a complete system. Or just use a UART to a terminal emulation.

      I like you project to.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.