Close
0%
0%

Z80-MBC2: 4ICs homemade Z80 computer

8MHz Z80, 128kB banked RAM, RTC, Disk on SD, Basic and Forth interpreters, CP/M 2.2 and 3, cross Assembler and C (SDCC) toolchains

Similar projects worth following
The Z80-MBC2 is an easy to build Z80 SBC (Single Board Computer).It is the "evolution" of the Z80-MBC (https://hackaday.io/project/19000-a-4-4ics-z80-homemade-computer-on-breadboard), with a SD as "disk emulator" and with a 128KB banked RAM for CP/M 3 (but it can run CP/M 2.2 and QP/M 2.71 too).

It has an optional on board 16x GPIO expander, and uses common cheap add-on modules for the SD and the RTC options. It has an "Arduino heart" using an Atmega32A as EEPROM and "universal" I/O emulator (so a "legacy" EPROM programmer is not needed).

It is a complete development "ecosystem", and using the iLoad boot mode it is possible cross-compile, load and execute on the target an Assembler or C program (using the SDCC compiler) with a single command (like in the Arduino IDE).


* * HARDWARE OVERVIEW * *

The needed ICs for the "base system" are:

  • Z80 CPU CMOS (Z84C00) 8Mhz or greater
  • Atmega32A
  • TC551001-70 (128kB RAM)
  • 74HC00

If you want the 16x GPIO expansion (GPE option) add a MCP23017 too.

The schematic and the BOM are attached in the Files section. The MCU Atmega32A is used as universal I/O subsystem, as Eeprom, and as reset and 4/8MHz clock generator for the Z80 CPU.
Inside the Atmega32A it is flashed an Arduino bootloader taken from here, and it is possible to use the Board Manager of the Arduino IDE to "import" it.

Flash the Arduino bootloader at first (with the method you prefer), next you can upload the IOS "sketch" (the I/O Subsystem that interacts with the Z80 bus and "virtualizes" the EEPROM and all the peripherals seen by the Z80 CPU) using Arduino IDE.

You can use the on board ICSP port J3 (also called ISP port) to write the bootloader, but remember to disconnect any other connector when using it. Also both SD and RTC modules (if present) must be removed from the board when the ICSP port is in use.

As clock source for the Z80 CPU it is used the 16MHz Atmega32A oscillator, so the "external 16MHZ osc."...

Read more »

SD-S220718-R260119-v2.zip

The content of the microSD needed to run CP/M 2.2, CP/M 3.0 and QP/M 2.71 with IOS S220718-R260119. Adds the XMODEM protocol support. Fixes a issue with MBASIC.

Zip Archive - 2.76 MB - 03/24/2019 at 17:15

Download

S220718-R260119_IOS-Z80-MBC2.zip

The sketch for the IOS (with the needed libraries). Unzip into a folder and open the .ino file (with Arduino IDE). IOS is required for CP/M 2.2, CP/M 3.0 and QP/M 2.71 (the SD module is mandatory). Adds the XMODEM protocol support. NOTE: now the default serial speed is 115200 bps.

Zip Archive - 38.24 kB - 03/10/2019 at 15:19

Download

S220718-R260119_IOS-Z80-MBC2.ino.with_bootloader_atmega32_16000000L.hex

The sketch for the IOS in executable format (.HEX) with the bootloader. This executable file is intended for use with a programmer as the Atmel Ice or AVRISPmkII or others (Fuse bits: High Byte 0xD6, Low Byte 0xAF, Lock Byte 0xCF)

x-hex - 55.75 kB - 03/12/2019 at 16:41

Download

STARTREKV2.BAS

The famous game Super Startrek kindly debugged by a RetroBrew Computer Forum user. Play with Caps-Lock activated! Now the animation works...

bas - 20.18 kB - 08/07/2018 at 16:32

Download

TREKINST.BAS

Instructions for STARTREKV2.BAS

bas - 6.80 kB - 08/04/2018 at 21:48

Download

View all 11 files

  • 1 × See the file "A040618 BOM v2.ods" in the FILES section.

  • FuzixOS preview: Unix for Z80!...

    Just4Fun6 days ago 1 comment

    First test with FuzixOS on the Z80-MBC2 (many many thanks to Alan Cox...)!:

    Stay tuned...

  • uTerm is out!

    Just4Fun05/14/2019 at 07:40 0 comments

    I've done a separate "project page" for uTerm here.

    uTerm can be mounted horizontally or vertically to the Z80-MBC2.

    All the details including the 3D printed custom angled brackets .STL files are there.

    uTerm is a VT100 terminal with VGA out and  PS/2 keyboard with a power supply (for the Z80-MBC2 too). It has a "transparent" USB-TTL adapter connector, so you can upload firmware or load an Intel-Hex file (with iLoad) while the card is inserted. Both the "mixed" power supply scenarios (USB-TTL adapter not powered from USB but Z80-MBC2 powered and vice-versa) are managed. The video terminal is based on the ChibiTerm (https://hw-by-design.blogspot.com/2018/07/low-cost-vga-terminal-module-project.html).








  • Z80-MBC2 @ Hackaday Prize 2019

    Just4Fun04/07/2019 at 10:05 0 comments

    Hi all, if you liked the Z80-MBC2 please vote it...!

    Thanks!

  • uCom preview: a RS232 adapter for the Z80-MBC2...

    Just4Fun04/05/2019 at 17:00 0 comments

    Currently working on a RS232 add-on card for the Z80-MBC2.

    As the uTerm board, it has a power supply for the Z80-MBC2 and a "transparent" USB-TTL adapter connector, so you can upload firmware or load an Intel-Hex file (with iLoad) while the card is inserted. Both the "mixed" power supply scenarios (USB-TTL adapter not powered from USB but Z80-MBC2 powered and vice-versa) are managed.


    Here connected to an Ampex 210 terminal (sold and relabeled by Kyber):


    Stay tuned...

  • New IOS for XMODEM support

    Just4Fun03/10/2019 at 10:54 4 comments

    * * * UPDATE!!! * * * 

    There is a problem with this new IOS with the MBASIC Basic interpreter. The "GPELED.BAS", "RTC.BAS" and "USERLED.BAS"  example programs don't work anymore. It seems that the way MBASIC does some I/O checks using the new virtual serial port interferes with others virtual I/O ports. Further analysis is required...


    * * * UPDATE 2 * * *

    I think to have found the origin... now thinking to a possible solution...


    * * * UPDATE 3 * * *

    The new SD image (SD-S220718-R260119-v2.zip) is out in the Files section. It fixes the MBASIC issue for CP/M 3 and 2.2. Please update your SD image.


    * * * * * *

    Because some people requested to use the XMODEM protocol to exchange files through the serial port, I've added the support for this protocol into CP/M 2.2 and CP/M 3 (banked only).

    XMODEM needs a full 8 bit binary data transfer, and this is not possible with the CON port (the CP/M port used for the console) with a "legacy" CP/M system installation because the CP/M Alteration Guide says to strip the eight parity bit when reading a byte from the console input.

    More, because the Z80-MBC2 uses a virtual serial port without handshaking there is also a timing problem when dealing with the 128 bytes packets used by the XMODEM protocol.

    So the support to the XMODEM protocol has requested changes in the IOS and  in the CP/M BIOS, and also in the Arduino core to extend the serial input buffer.

    Please note that with the new IOS the default speed of the serial port is now 115200 bps.

    To have the XMODEM support active, before the update of the new IOS firmware and the new SD image (see in the Files section),  you have to manually create a new "board variant" in the Arduino IDE and then change the default Rx input buffer size to 128 bytes in the "core" of this new variant.

    If you aren't interested into the XMODEM support, you can simply update the IOS and the new SD image as usual  without the need to create the new board variant. In this case the XMODEM will not work in the receive direction, but only in the send direction (from the Z80-MBC2 to a PC with a terminal emulator).



    HOW MANUALLY CREATE A NEW BOARD VARIANT (LINUX)

    In the following I'll assume an Arduino IDE 1.8.5 installation on a linux host and the MightyCore ver. 1.0.8. Anyway I've tried to make the procedure enough general to be used for other versions too.

    ... Read more »

  • uTerm preview: a VT100 terminal for the Z80-MBC2...

    Just4Fun12/28/2018 at 10:16 1 comment

    Currently working on a VT100 terminal with VGA out and  PS/2 keyboard with a power supply (for the Z80-MBC2 too). It has a "transparent" USB-TTL adapter connector, so you can upload firmware or load an Intel-Hex file (with iLoad) while the card is inserted. Both the "mixed" power supply scenarios (USB-TTL adapter not powered from USB but Z80-MBC2 powered and vice-versa) are managed. The video terminal is based on the ChibiTerm (https://hw-by-design.blogspot.com/2018/07/low-cost-vga-terminal-module-project.html).

    Stay tuned...


    Working on a new revision (A071218-R250119):


    Waiting the new PCB, I'm playing with the current PCB "patched" to perform like the new one.
    Here a session with Wordstar 4 configured to use all the 30 rows of uTerm:

    In the photo you can see that also the serial-USB adapter is attached to the uTerm using the "transparent" port. This allows to use two keyboards and two monitors in the "same" time (one keyb and monitor attached directly to the uTerm, and another keyb and monitor of the terminal emulator on a PC connected with the serial-USB). This allows also to use XMODEM (e.g. between the Z80-MBC2 and a PC) or to flash the Atmega firmware with the uTerm connected.

    Or you can use the monitor attached to the uTerm and the keyboard of the terminal emulator on a PC. This is exactly the "configuration" I used in the photo to make the test (as you can see, there isn't any keyb attached to the uTerm).


    Catchum demo with uTerm (a sort of Pacman...). Leaving the game alone, after a while the "demo mode" starts:

    Here last version assembled horizontally with the Z80-MBC2:


    Currently making custom 3D printed mounting brackets for a solid vertical assembling:

  • Overclocking the Z80-MBC2...

    Just4Fun11/02/2018 at 09:51 0 comments

    Because the Mighty Core gives the chance to choice a 20MHz bootloader, I've decided to try to "overclock" the Atmega32A using a 20MHz quartz:

    You don't need others HW changes, just use a 20MHz quartz instead of a 16MHz one. The Z80 clock speed will be at 10MHz.

    You have to select the "20MHz external" option in the "Toos" menu of Arduino IDE before flashing the 20MHz bootloader:


    Of course you need to load the sketch again (using the "20MHz external" option). IOS will display the new clock speed:


    Remember that using a 20MHz quartz you are out of the Atmega32a specifications (the Atmega32a is rated at 16MHz max.), so you are in a "grey area" where things "may works"...

  • CP/M 3 up and running on the Z80-MBC2!

    Just4Fun10/11/2018 at 06:58 0 comments

    With the latest IOS revision and the corresponding new SD image (see the Files section) there is one more option: the CP/M 3.0!

    With CP/M 3.0 it is possible use the 128KB banked RAM to have a wider user area (TPA) for programs and a more "evoluted" OS.


    TWO VERSIONS

    Just as example of how it is easy with CP/M 3.0 manage multiple configurations, I've done also a "non-banked" 64KB version. The switch from one version to the other can be done simply running a batch from the console itself.

    I've prepared two simple batch files to do that. From drive A: the command:

    submit sys64

    will set the 64KB "non-banked" version and then reboot the system.

    To activate again the 128KB "banked" version give the command (from drive A:):

    submit sys128

    NEW DISKDEFS FILE

    To use cpmtools or cpmtoolsGUI with the virtual disks of the CP/M 3.0 environment, you must update the DISKDEFS definition file (from the SD in the folder <SD>/cpmtools/) and use the "z80mbc2-cpm3" entry for all the 16 disks:

    Please note that for the CP/M 3.0 environment all the 16 virtual disks have the same structure and for this there is only one entry for all the CP/M 3.0 virtual disks.


    AUTOEXEC

    The AUTOEXEC switch for CP/M 3.0 works in a different way from the CP/M 2.2 and QP/M 2.71 implementations.

    Now there is a custom utility (AUTOEXEC) that checks the IOS flag and sets the exit code accordingly (using the BDOS function 108). This allow to use the CP/M 3.0 batch conditional execution (see the CP/M 3 Programmer Guide par. 1.6.3) to run any wanted command or program based on the status of the IOS AUTOEXEC flag.

    I've prepared an example using an other CP/M 3.0 feature, the "PROFILE.SUB" batch that is automatically executed at cold boot (if it exists). To activate it (in the drive A:) rename the file PROFILE.SU as PROFILE.SUB with the command:

    ren profile.sub=profile.su

    Now you can see how it works setting the AUTOEXEC flag on or off with the IOS "Select boot mode or system parameters" menu.

  • QP/M 2.71 up and running (with IOS multi-boot management...)!

    Just4Fun09/17/2018 at 18:26 0 comments

    With the latest IOS revision and the corresponding new SD image (see the Files section) there is an interesting alternative to CP/M developed by MICROCode Consulting that supports also file timestamping, and it is 100% CP/M 2.2 "compatible".
    MICROCode Consulting has released the original installation files and all the documentation in their site with the "restricted usage" condition, that means free for non-commercial use and for personal use only.

    To enable timestamping (see upper screenshot) you need to install the optional RTC module.
    I suggest to read the QP/M documentation for the various commands (see the Downloads section in their site).


    AUTOEXEC

    The QP/M uses for the batch file the .QSB extension. So the AUTOEXEC file is now renamed AUTOEXEC.QSB. To enable the AUTOEXEC execution after the cold boot change the corresponding state to ON from the usual IOS boot selection menu. In the drive A: there is an example of AUTOEXEC.QSB file ready to run.


    IOS MULTI-BOOT MANAGEMENT

    Now the IOS has a new entry (8) in the boot menu to manage the OS multi-boot configuration:

    Each OS is associated with a set of virtual disks called "Disk Set", and changing the "Change Disk Set..." entry (8) will switch all the virtual disks of his "environment".

  • CP/M 2.2 up and running on the Z80-MBC2!

    Just4Fun09/08/2018 at 18:24 0 comments

    The new IOS is out, and the CP/M 2.2 OS with it, and 16 disks are available (from A: to P:), each 8Mbyte large.

    With IOS (not for IOS Lite) the SD module is mandatory to run not only CP/M 2.2 but also for the stand-alone Basic and Forth interpreters. You need a microSD card (FAT16 and FAT32 are both supported) to store the content of the SD image file, retaining the directory structure.

    Pay attention on how the modules are inserted because their positions are fixed and absolutely not swappable (see the upper photo).

    To add, extract or delete files inside a virtual disk (virtual disks filenames on SD are "DS0Nxx.DSK", where "xx" is the disk number) it is possible use the cpmtools or cpmtoolsGUI utilities, with the diskdefs file in the \cpmtools directory of the SD zipped file.

    I suggest to use  cpmtoolsGUI (only for Windows) because is very easy.

    Unzip it into a folder and put the diskdefs file in the same folder.
    Select "z80mbc2-d0" only for disk 0, and "z80mbc2-d1" for the others (disk 1 - 15):

    NOTE: use cpmtoolsGUI only to add, extract or delete files inside a virtual disk. Not try to create new virtual disks files with cpmtools or cpmtoolsGUI because further processing is required for a valid virtual disk file.

View all 11 project logs

Enjoy this project?

Share

Discussions

frank maertin wrote 12/21/2018 at 20:47 point

Got  my 5  pcb's today. Does anybody needs one?

Shipping only to Germany. 1 Toshiba RAM, ATMEGA and Z80 are also avialable, if needed.

  Are you sure? yes | no

SupraJames wrote 11/25/2018 at 22:05 point

Just want to share something I’ve found tonight. I had an ESP8266 module in my collection and using esp-link (https://github.com/jeelabs/esp-link) my Z80-MBC2 is on my wireless network and I can play with it from anywhere using telnet - and even remotely reset the board and re flash the Arduino part via a web page. It’s beyond cool! Just connected the ESP8266 instead of the USB serial module.

  Are you sure? yes | no

villaromba wrote 11/26/2018 at 09:58 point

Interesting concept, had a read on jeelabs and thought I would give it a go. The ESP8266 is only a few dollars from Aliexpress as well - so well affordable !!!

  Are you sure? yes | no

Just4Fun wrote 11/25/2018 at 10:12 point

Thanks guys..!

BTW: Currently I'm "playing" with a new "thing":

https://www.retrobrewcomputers.org/forum/index.php?t=msg&th=223&goto=560555&#msg_5605

Stay tuned.... :)

  Are you sure? yes | no

John wrote 11/23/2018 at 22:15 point

Thank for a great project. Been wanting to run CP/M on a real Z80 now i have it :)

Regards

Jman 

  Are you sure? yes | no

asorc wrote 11/23/2018 at 20:28 point

Hello, 

I ordered 5 pcbs and I've received them today. I am looking at the layout guide, and I have a question about the legend which says 10 k 8. What does it mean? What's that? I've read something about SIP. But I do not know what's that. Could anyone help me? Thanks a lot  in advance. 

  Are you sure? yes | no

villaromba wrote 11/23/2018 at 20:58 point

You'll find in the Bill of Materials (In Files section) the parts list.

The SIP used is 8 x 10k resistors in a Single Inline Package (SIP) with a common pin for all 8 resistors making 9 pins in total. They are also called a Resistor Array Network.

  Are you sure? yes | no

Jeff Davis wrote 11/24/2018 at 02:14 point

I made a google docs BOM with corrections and longer item descriptions: https://drive.google.com/open?id=145w-IAsDimTIEjg6kTirIJTWtZTU7UPEflaH5Kcza1Q

  Are you sure? yes | no

asorc wrote 11/24/2018 at 13:33 point

Thanks a lot. I've read about resistors array later on. I do not have much knowledge... Btw, I have around 1n5819 instead of 1n5817, and 2n3906 instead of 2n2907. Could I use them?

  Are you sure? yes | no

Just4Fun wrote 11/25/2018 at 10:06 point

Yes, you can do it for both the components. The 2N3906 must be in TO-92 package, so the pins are in the right place...

  Are you sure? yes | no

SupraJames wrote 11/23/2018 at 17:21 point

I am pleased to show my first proper Z80 assembler program. It's a memory tester, which might be useful in the homebrew world. It does bank switching so we can test almost all the 128k which the Z80-MBC2 has, except for the little area where the program runs!

Just paste the .hex into iLoad to give it a go, or look at the source.

Comments? https://github.com/SupraJames/z80-mbc2

  Are you sure? yes | no

villaromba wrote 11/23/2018 at 22:11 point

Nice one, just ran a quick mem test - perfect!! Will check out monitor late weekend ....

  Are you sure? yes | no

SupraJames wrote 11/13/2018 at 21:51 point

i noticed that the old MBC was using the serial port at 38400 baud but the new one is 9600 only. Is there a technical reason for that?

  Are you sure? yes | no

Jeff Davis wrote 11/14/2018 at 08:47 point

I changed the avr ios program's serial from 9600 to 38400, compiled and uploaded to the avr, and it seems to run just fine (played startrek), which makes sense since the serial port is handled by the avr cpu. 9600 just feels more retro I think since the terminal draws a lot faster at 38400.

  Are you sure? yes | no

nemfield wrote 11/11/2018 at 21:05 point

Hi. I have read through this (mostly) and it looks like fun.  I live in Ontario Canada and if anyone has a spare PCB I'd appreciate it. I can paypal you for the cost. Thank you.  Gabe (nemfield@gmail.com).

  Are you sure? yes | no

nemfield wrote 11/11/2018 at 22:33 point

OK. Replying to my own comment. I ordered 5 boards. I used China Post. I'm in Canada. when I get them I'll share them for postage costs to others near me. I advice you do NOT use DHL. Here in Canada they always add some silly brokerage fee and hold you hostage unless you pay it. They are a great service, but do not come clean on all charges.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/11/2018 at 22:35 point

That's basically their business model...

  Are you sure? yes | no

Bartosz Makara wrote 11/12/2018 at 09:35 point

I'm living in Germany and when I'm ordering from outside the EU I'm always trying not to choose DHL because I know I have to pay some extra fees. It's terrible! If you order ar PCBway you can also choose E-Packet. I think this is a little bit faster than China Post and costs only a little bit more. And I've never had any problem with extra costs with this shipping way.

  Are you sure? yes | no

Bartosz Makara wrote 11/11/2018 at 13:59 point

Hello, I have two questions about the used parts where I am not completly sure about.

1. question: The "user LED" should be a 2.7V version or higher but what about the voltage of the other five LEDs? Since nobody else asked this here I'm pretty sure I've overseen some information or simply I'm too stupid. :D

2. question: The two tactile switches used in the schematics are per default closed and interrupt the ground line, right? Or do I have to use a reversed switch version? The more I'm trying to get it the less I'm sure about this. 

  Are you sure? yes | no

villaromba wrote 11/11/2018 at 20:13 point

Q1: ther 5 LEDs aren't 'critical' but if you want to keep to the original design I've copied below from the BOM. (In FILES)

D1  LED-3MM  HALT Red
D11 LED-3MM SD Red
D2 LED-3MM  DMA White
D3 LED-3MM  IO_OP White
D4 LED-3MM  IOS Green
D5 LED-3MM  USER Blue

Q2: The 2 switches are normally open (standard tactile switch!) as per the schematic. Depress switch to operate.

  Are you sure? yes | no

Bartosz Makara wrote 11/12/2018 at 09:33 point

Oh great, thank you very much! :)

I knew I'm overlooking something!

  Are you sure? yes | no

Bartosz Makara wrote 11/07/2018 at 07:48 point

Does anybody know a good DIY project to build a serial terminal with a samll display which would work with this little Z80-machine? Probably something based on an Arduino Uno (I have a sapre one here ;). Unfortunately I'm not good in developing something like this for myself.

  Are you sure? yes | no

Mc John wrote 11/07/2018 at 08:13 point

This is a complete ASCII VT100 compatible video terminal in a single chip RS232/USB

http://geoffg.net/terminal.html

  Are you sure? yes | no

Bartosz Makara wrote 11/07/2018 at 12:09 point

Awesome! :) Thank you very much!

  Are you sure? yes | no

mustower wrote 11/03/2018 at 17:07 point

Hi, I am new to hackaday.io. This project ist really amazing. I wondering how I can get a PCB ? Any help/infos are apreciated.

  Are you sure? yes | no

Just4Fun wrote 11/03/2018 at 17:24 point

Thanks!. I've prepared an "easy link" to order a small lot (5 pcs min.) here: https://www.pcbway.com/project/shareproject/Z80_MBC2__4ICs_homemade_Z80_computer.html or you may ask if someone has a spare PCB... (my last spare PCB is now in Sweden...)

  Are you sure? yes | no

SupraJames wrote 11/03/2018 at 22:04 point

if you are in the UK I’d be happy to post you one of my PCBs which should be here in a couple of weeks

  Are you sure? yes | no

villaromba wrote 11/04/2018 at 16:06 point

I too have a spare PCB  you can have FOC  if you are in the UK !!!

  Are you sure? yes | no

SupraJames wrote 11/01/2018 at 21:57 point

Got bored of waiting for my PCBs so got it all up and running on breadboard. It booted first time which was unexpected! CP/M 3 also works. Really happy I found this project! https://imgur.com/gallery/kduyfE3 Next step, an LCD display module!

  Are you sure? yes | no

Just4Fun wrote 11/02/2018 at 08:31 point

Wow... That remembers me the first previous version (Z80-MBC) I made on breadboard (now destroyed... sigh...) .

Great!

  Are you sure? yes | no

SupraJames wrote 11/02/2018 at 10:50 point

I'm finding it a little hard to get started with 'bare bones' development. I want to try writing assembler and then presumably load it with iLoad. I've tried running TASM but it refuses to work on 64 bit windows, so I compiled z80-asm from http://wwwhomes.uni-bielefeld.de/achim/z80-asm.html on Linux, but it seems not to like your example .asm files.

Can you advise what I should be using as my toolchain here please? :)

  Are you sure? yes | no

Just4Fun wrote 11/02/2018 at 13:23 point

Give a look here: https://hackaday.io/project/19000-a-4-4ics-z80-homemade-computer-on-breadboard/log/52682-new-iload-boot-mode-and-an-automated-assembler-toolchain

It was for the Z80-MBC, but will work with the MBC2 too. I use a VM with WinXP to run TASM... (on a linux host)

  Are you sure? yes | no

SupraJames wrote 11/02/2018 at 14:55 point

Nice one. Well I actually found my own solution. zasm (https://k1.spdns.de/Develop/Projects/zasm/) generates .hex files perfectly for iLoad. So that's another way to do it.

Would be cool also if we had an assembler under CP/M too!

  Are you sure? yes | no

villaromba wrote 11/02/2018 at 16:23 point

I still have my v1 breadboard (something to pass on to the grandchildren!!!) but I love v2. Have added an LCD display and LED backback (4digit) onto the i2c buss by adding some new OPCODEs .  Big learning curve for me on the programming side. Also added a relay board on to the GPIO - just because!!!

  Are you sure? yes | no

SupraJames wrote 11/02/2018 at 18:11 point

@villaromba are you me? I just came here to say the same thing! Took an hour or so to get my head around the opcodes business, but I can write to my LCD from BASIC and assembler, so I'm well happy. THIS is how you learn how a computer works. https://imgur.com/gallery/d7qgD2P

  Are you sure? yes | no

Jeff Davis wrote 10/31/2018 at 04:56 point

I've build my board and after fixing a bad solder joint on the sd card slot it boot up and runs, but my leds are not working as expected. 

Since I plan to put my board in a case, I soldered in 0 ohm resistors for the 6 leds, and soldered in jumper pins where the leds would go. 

I now have a breadboard with resistors and leds hooked up, and after the board boots the IOS, DMA, and IO_OP leds stay lit all the time. In fact it seems like they are acting logically backwards - when I do "stat a:" the DMA and IO_OP leds flash, like the led is indicating work happening by going to 0 volts and not lighting the leds, then when work is done they go back to on again. Anyone have any ideas?  

Here's my breadboard for context: https://drive.google.com/file/d/1kBfibaxGbCGJAtdZY2VeKpLQNkp1D6As/view?usp=sharing

  Are you sure? yes | no

Just4Fun wrote 10/31/2018 at 12:57 point

That seems normal (see the video)...

  Are you sure? yes | no

Jeff Davis wrote 11/01/2018 at 08:09 point

Ah I see, most of the leds are connected to active low pins. I modified your cpu test program that used HALT to test most of the leds; I couldn't figure out how to get the z80 to assert BUSACK so the DMA led is skipped. See https://drive.google.com/open?id=1uFqvNtlX2qfkbOiuGQzfBF28c3NXDE-Y

  Are you sure? yes | no

Bartosz Makara wrote 10/29/2018 at 09:54 point

Hey this is an awesome project. I've never used CP/M before but I love old computers and related matters. I've ordered 10 PCBs at pcbways.com and all needed parts in China. Now I have to be patient. ;)

I'm not very good in these things so probably this is a stupid question: Is there any possibility to access the GPIO with BASIC somehow? Or differnetly asked: How can I interact with the GPIO and the system?

  Are you sure? yes | no

SupraJames wrote 10/29/2018 at 13:02 point

Look at Examples with Basic.txt in the Files section - it shows how you can access the I/O ports from Basic.

  Are you sure? yes | no

Bartosz Makara wrote 10/29/2018 at 14:28 point

Oh yes, that's it! Thank you very much! :)

  Are you sure? yes | no

SupraJames wrote 10/26/2018 at 20:13 point

Hi! I'm going to build this and my PCBs are being fabricated. Yay!

I actually have an RTC module and an SD module already from playing with Arduino and wonder if they are suitable.

The SD module is https://imgur.com/gallery/Rzh1O1i and seems to be fairly generic, but not sure how to map the pins.

The RTC module is https://imgur.com/gallery/VnwoS8V and based on a DS1307 chip.

Would these work at all? Pin layout aside?

  Are you sure? yes | no

SupraJames wrote 10/26/2018 at 20:57 point

OK so I might have at least answered my own question regarding the RTC module. It looks like it will not work out-of-the-box but I could probably modify the IOS sketch to support it, which sounds like fun.

According the data sheets, the I2C address is the same, but the DS1307 is less accurate and does not have a status register, so no Oscillator Stop Flag. Also no temperature sensor to read.

It might need initialising in a different way - there's a CH flag in register 0 which needs to be set on power up.

Apart from that I think the time registers are the same.

  Are you sure? yes | no

Just4Fun wrote 10/26/2018 at 21:22 point

Hi, that SD module seems have an on board 3.3V regulator and level adapter, so just pay attention to use the right pins...

About the RTC, as you said you should tweak the code just a little... (no temperature sensor, but I think you can live happily without that one too...)

  Are you sure? yes | no

SupraJames wrote 10/26/2018 at 21:42 point

Great, thanks! Looking forward to getting started. The only other deviation from the design I am planning is the use of a different memory chip. It's an Alliance AS6C1008-55PCN - https://uk.farnell.com/alliance-memory/as6c1008-55pcn/sram-1mb-2-7v-5-5v-128kx8-pdip32/dp/1562896

Pinout is the same, it's just a faster chip. You think I'll be OK?

  Are you sure? yes | no

Just4Fun wrote 10/27/2018 at 06:41 point

Yes, it is ok!

  Are you sure? yes | no

SupraJames wrote 10/28/2018 at 20:17 point

Well I'm rather confused about the SD reader. I have mocked up the Arduino parts of the MBC2 on breadboard (No Z80 and no SRAM) as per your schematic. The built-in SD library from Arduino works fine, and I can list all the files on the FAT32 formatted SD card I have using the CardInfo example sketch, so I know the wiring and hardware is good.

However, when I flash the IOS, I get a brief flash of the SD LED and:

IOS: SD error 2 (NOT_READY on MOUNT operation)
IOS: Check SD and press a key to repeat

Get the same with two different cards. Any ideas?

  Are you sure? yes | no

Just4Fun wrote 10/31/2018 at 13:05 point

The error means that is not possible initialize the SD due to a hard error or no medium...

Try to power off the Z80-MBC2 and power on it again (after a few seconds) with the SD adapter connected and the SD into it.

  Are you sure? yes | no

SupraJames wrote 11/01/2018 at 15:37 point

Update with the SD card module, I actually ordered a new module similar to the ones you suggested, mainly to get the correct order of pins for the PCB, and the new module works fine. So there must have been something odd about my one which meant it worked OK with the arduino SD library but not with picofat.

  Are you sure? yes | no

George Warner wrote 10/23/2018 at 11:33 point

I’m working on bringing up CP/M 3.0 banked on Bill Shen’s z280rc board… but could use some clues… is your banked BIOS sources available anywhere?

  Are you sure? yes | no

Just4Fun wrote 10/23/2018 at 11:43 point

All the custom BIOS sources are in the SD zip file under "/src".

  Are you sure? yes | no

George Warner wrote 10/23/2018 at 11:45 point

Thank you. Much appreciated.

  Are you sure? yes | no

villaromba wrote 10/13/2018 at 08:52 point

If you do need to use the TL866 direct, the only fuse settings you need to select are :-  SUT0, SUT1, SPIEN, BOOTSZ1, BOOTSZ0 - (this gives CF & D9) - make sure everything else is not selected. I've used these settings every time - and every time a success!!!

  Are you sure? yes | no

scottie4442 wrote 10/12/2018 at 13:56 point

OK, just got the new IOS for cp/m 3 uploaded and copied the sd image to a blank fat32 formated sd card.  when I boot the z80-mbc2 I get the menu. I set the rtc to the correct time and change diskset to 2, the CP/M 3 set. when I try to boot the os I get Z80 is running from now I either get the prompt again and cannot type or I get nothing, it looks like it just hangs. I have run down the menu and I get this same behavior from basic, forth, CP/M 2.2, QP/M 2.71 and CP/M 3.0. not sure what to do now.

  Are you sure? yes | no

Just4Fun wrote 10/12/2018 at 14:20 point

Try to flash IOS-LITE ( https://cdn.hackaday.io/files/1599736844284832/S220618_IOS-LITE-Z80-MBC2.ino ) and tell me if the various options work...

PS: this is the first time you run the board...?

  Are you sure? yes | no

scottie4442 wrote 10/12/2018 at 15:43 point

OK, I uploaded the IOS-LITE and I get the same thing, when I try to load basic, forth or the iload, I get Z80 is running from now and then nothing it just sits there and I get nothing else.  I tried to reset and the menu come back but when I make a selection it does the same thing.  I have check that my soldering is ok and that the chips are seated properly.

  Are you sure? yes | no

Just4Fun wrote 10/12/2018 at 16:11 point

An other user had exactly the same issue... it was a faulty SRAM (it could be a faulty Z80 or 74HC00 too, but the SRAM is at first place).

The Atmega seems work properly.

PS: Are you sure to have a CMOS Z80...?

  Are you sure? yes | no

scottie4442 wrote 10/12/2018 at 16:47 point

chips are :

Zilog z84c0008PEG

Alliance AS6C1008-55PCN

Atmel ATMEGA32A

TI SN74HCT00N

MCP23017-E/SP

All these are brand new chips from Mouser

  Are you sure? yes | no

Just4Fun wrote 10/12/2018 at 16:54 point

Chips numbers seem ok.

Which method have you used to flash the bootloader?

  Are you sure? yes | no

scottie4442 wrote 10/12/2018 at 21:57 point

with usbasp and arduino ide. I did remove the rtc and sd card reader as suggested and plugged the usbasp in according to the info above.  I also have a tl866 programmer that I can program the atmega32a with but I was not sure of the fuse settings.

  Are you sure? yes | no

Just4Fun wrote 10/13/2018 at 09:36 point

Ok, given that all seems as expected and excluding ghosts and black magic, the suspects are on the SRAM and CPU again...

I've prepared a IOS-LITE modified test version to test the CPU only. This simple test will force the Z80 into HALT, so the HALT led will turn on. The SRAM is not used, so this test can be run also without any SRAM chip installed.

The sketch is downloadable from here: https://drive.google.com/open?id=1irVxE3IF_Ilte1c547ZSuzLTaaWIfeeC

If you press RESET, the HALT led will turn off for about one second, then it will turn on again.

  Are you sure? yes | no

scottie4442 wrote 10/13/2018 at 13:32 point

OK, I think I found part of the problem (I am an idiot sometimes).  I went back to start fresh and  when I did the boot loader step I realized there is a USBasp and a USBasp(MightCore). I chose the USBasp(MightCore) this time and it is getting further seem like, but now when I try to load Basic, Forth or iLoad, the IOS and Halt led's are solid and the DMA is blinking occasionally the goes out. Hopefully this is progress. Oh I used IOS again for this not IOS-LITE

  Are you sure? yes | no

Just4Fun wrote 10/05/2018 at 22:00 point

  Are you sure? yes | no

Jay Sissom wrote 10/05/2018 at 18:58 point

Hello, I can't find the vendor and model number of the RTC and SD card adapters.  Can you  please provide that?  Thanks.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates