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]
Can it run (or be made to run) CP/M?
It’s definitely possible, since it’s a Z80 with a file system interface (SD card). The main question is how much work it would be to create a port.
I’ll drop this link: http://spritesmods.com/?art=avrcpm&page=3
As far as it was written there – you need some sort of “BIOS” for CP/M. And CP/M was designed to be easily portable.
http://www.cpm.z80.de/randyfiles/DRI/CPM_2_0_System_Alteration_Guide.pdf
A colleague and I ported CP/M to the FutureData AMDS in one single all-nighter. He knew the guts of CP/M and I knew the guts of the AMDS. http://www.pcmuseum.ca/details.asp?id=574
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
Steve Ciarcia, now that is a living legend, designed “open source” IBM PC clone in 1982! (published in circuit cellar)
Late to the party, but that Z80 version was ZCPR.
I remember using CP/M on an Apple ][ e which had 64KB of RAM, so I don’t see why it would not be possible technically.
http://www.glitchwrks.com/images/vintage-misc/a2cpm/cpmprompt.jpg
That Apple must’ve had a Z-80 SoftCard, which was a plug-in card with a Z-80 on it and a port of CP/M.
Those were awesome. Except for the part about being limited to 140K diskettes (unless you happened to have a 5M Corvus drive attached).
It was powerful enough, and had enough drive space that I ran a BBS on one for a couple of years.
Never knew that, but it explains to me how an old BBC Micro could run CP/M if you had a Z80 (co-)processor running over the tube interface.
https://en.wikipedia.org/wiki/Tube_(BBC_Micro)
I see my hotlink catcher is working correctly :) That wouldn’t be a picture of *your* IIe, now would it?
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 ;)
Of course it can.
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.
The Z-80 CPM code is still available at several sites including http://www.cpm.z80.de/binary.html
What are the rules of the digit Tetris game?
From the youtube caption, “Falling number must be addition or subtraction of lower two ones.”
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.
It is simple. Transmitting from keyboard is suppressed. CPU allow it for a while if key input needed. No interrupts. Keys are cached in keyboard buffer while reading occurs.
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 ???
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.
Yes, it is stable and working. But I plan to add some more features to final release.
With that amount of memory you could run M/PM, the multi user version of CP/M. Source for all of it is available free: http://www.cpm.z80.de/
And for all the other programs: http://www.classiccmp.org/cpmarchives/
FYI the term BIOS comes from CP/M days
I wonder if it will run DOS. It would be cool to even run TRS-DOS.
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
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.
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.
Lol. Yeah sorry … flash back… Must have been the number of all-nighters getting that rig running
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.
Seriously? The Quick Basic compiler ran in 4K? I did not know that.
Not a BASIC interpreter, but 256 bytes: https://linusakesson.net/scene/a-mind-is-born/
@[olduino]
There were versions of BASIC in just 2k.
i would love to have a z80pi, better yet an 8088pi but thats wishful thinking xP
can it play manic miner?
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.
ZX Spectrum’s ULA chip was (amongst other things) responsible for video generation. If one would take the “clone” route, there is a comprehensive book about it, “The ZX Spectrum ULA: How to design a microcomputer” : http://www.zxdesign.info/book/bookAnnounce.shtml
And even a free, open source CPLD/FPGA implementation based on it ! : https://opencores.org/project,zx_ula
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.
A really powerfull 8k-16k machine could play Lunar Lander.
Better will be to use VDP form not working MASTER SYSTEM or MEGA DRIVE…
http://md.squee.co/VDP
Better to repair the Sega console then…
better to use ESP8266 ;)
Or VDP videoprocessor + PSG soundchip in FPGA :D.
Not the smallest.
http://noplabs.com/cpm50/cpm50.html
No schematic, no place to buy a board so not very real anymore. Sad.
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”.
> 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.
You can still but NMOS versions up to 8MHz.
Yep, and I seem to have a plethora of old NMOS Z80s here in the workshop.
I think it’s time to take on this “smallest Z80 claim”. :-)
If you’re gonna do it, use a Zilog Z84C15.
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
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.