close-circle
Close
0%
0%

A 4$, 4ICs, Z80 homemade computer on breadboard

No iron, no cry! Build a mini 4MHz Z80 64kB RAM system with Basic and Forth interpreters, CP/M 2.2, QP/M 2.71, Assembler and C toolchains

Similar projects worth following
close
This is the Z80-MBC (Mobile Breadboard Computer), a mini 4MHz Z80 64kB RAM system with Basic and Forth interpreters, CP/M 2.2, QP/M 2.71, Assembler and C toolchains.

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 with a single command (like in the Arduino IDE).

More, it can be easily expanded and it has an "Arduino heart" using an Atmega32A as an "universal" I/O emulator, and can be used and powered with a tablet or smartphone too...

This project has grown a lot on the way (more than I've supposed at the beginning...) and now is renamed as "Multi Boot Computer" and is available on PCB (thanks to Bill Westfield) too.

In the "Instructions" section there is a quick building guide updated to the last developments.

In the "Files" section there are the components list and BOM for both the versions.

During some surfing on Ebay I realized that with 4$ it is possible to buy enough ICs to build a complete Z80 system that can be done using a breadboard, and taste some flavor of retro computing.... So I did it and here it is the story!

Here is a video with the Z80-MBC in action:

and here with a smartphone (so it is explained the word "Mobile" in his name...) with a common OTG cable (the various test clips in this video were used for some measurements with a Logic Analyzer):


* * HARDWARE OVERVIEW * *


The needed ICs are:

  • Z80 CPU CMOS (Z84C00) 4Mhz or greater ($1.16)
  • Atmega32A ($1.70)
  • TC551001-70 (128kB RAM) ($1.10)
  • 74HC00 ($0.25)

Total cost: $4.21

The wires were taken from salvaged broken LAN cables, and the other components were salvaged from others unused breadboards.

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

Flash the Arduino bootloader at first (with the method you prefer), next you can start to build the whole thing!


Of course I used the Arduino IDE to develop the IOS (I/O Subsytem) that interacts with the Z80 bus and "virtualizes" the peripherals seen by the Z80 CPU.
As oscillator it is used the internal 8MHz Atmega32A oscillator, so no quartz is needed, and from this one is derived the 4MHz clock for the Z80 CPU (so the "Internal 8MHZ osc." bootloader variant must be chosen when flashing the bootloader from the Arduino IDE!).


The 74HC00 is mainly used as RS flipflop to stop the Z80 CPU during I/O operation, giving the needed time to the Atmega32A to interact with the Z80 bus.
The 128kB RAM TC551001 is used only for half (64kB) because the Z80 address space is only 64kB (I've chosen this IC for the low cost).
Note that only the CMOS version of the Z80 CPU can be used here. This because only CMOS version, under given condition that are respected in this schematic, has logical levels compatibles with Atmega32A and 74HC00.


NOTES ABOUT THE COMPONENTS:


You can use any Z80 CMOS speed grade, because the lowest is 4MHz.
The 74HC00 can be substituted with a 74HCT00 if you already have one.
The RAM chip TC551001-70 can be substituted with any suitable 64kB RAM (do not use < 64kB RAM).
The USER led (D5 in the schematic) MUST be blue or white just to be sure that V(forward) is >= 3V.


Here is a video that shows a simple basic program that interacts with the "USER led" and "USER key":



On the breadboard there are others status led: the HALT led turns on if an HALT instruction is been executed and the Z80 CPU is in a Halt state, the DMA led turns on during DMA operations when the Z80 bus is in Hi-Z, the IO_OP led turns on when the Z80 CPU is accessing a I/O virtual device "emulated" by the Atmega32A (as the serial port), the LED_D0 led is the classical "Arduino" led (that one connected to D13 pin on the Arduino Uno) that here is connected with the Arduino D0 pin and is turned on normally as a power on indicator.


The serial port SERIAL-USB (see schematic) can be connected with a TTL-RS232 adapter, or with a serial-USB adapter.
I've used a serial-USB adapter that acts also as power source for the Z80-MBC, and has the DTR signal for the "autoreset" driven from the Arduino IDE. For a terminal that has a serial TTL port no adapter is needed.


In the schematic there is also the IOEXP port to expand the I/O capabilities, i.e. adding GPIO ports or a RTC for future expansions.

... Read more »

S221116_R100218_Z80.ino

The sketch for the Atmega32A (New release. Fix the "ghost RTC" bug: when there isn't any Virtual Disk (only Basic and Forth) the RTC clock was always incorrectly found).

x-arduino - 167.93 kB - 02/10/2018 at 16:45

download-circle
Download

Z80-MBC PCB version - BOM.xls

Component list and BOM for the Z80-MBC PCB version (see schematic and gerbers at: https://github.com/WestfW/4chipZ80)

ms-excel - 28.50 kB - 10/17/2017 at 07:05

download-circle
Download

Z80-MBC - BOM.xls

Component list and BOM for the Z80-MBC on breadboard

ms-excel - 28.50 kB - 10/17/2017 at 07:04

download-circle
Download

SRecord-custom.zip

Batch and custom files for SRecord utility to make custom virtual disk images.

Zip Archive - 16.06 kB - 05/29/2017 at 15:03

download-circle
Download

CPMtools-custom.zip

Batch and custom files for CPMtools utility to make custom virtual disk images.

Zip Archive - 4.48 kB - 05/29/2017 at 15:02

download-circle
Download

View all 30 files

  • 1 × For the breadboard version see the file "Z80-MBC - BOM.xls" in the Files section
  • 2 × For the PCB version see the file "Z80-MBC PCB version - BOM.xls" in the Files section

  • Bug fix: the "ghost RTC"

    Just4Fun02/10/2018 at 17:01 0 comments

    Reading this Japanese article on a kit sold in Japan to build a Z80-MCB, I realized the presence of a possible bug seeing this two images:

    As you can see, there is a Z80-MCB without any Virtual Disk or RTC attached and in the resulting screenshot the RTC appears present.

    After a quick check I found a little bug in the RTC discovery routine that see a "ghost RTC" when the Virtual Disk is not present.

    So I've uploaded a new "sketch" (S221116_R100218_Z80.ino) that fix the bug.

    Note that if you have the Virtual Disk already installed, there isn't any real need to upgrade.

  • How to make custom Virtual Disk images

    Just4Fun05/29/2017 at 14:29 1 comment

      To do that you need two really powerful tools: Cpmtools to create CP/M disk images and SRecord to manipulate ROM/EPROM images.
      Take in account that the structures of the virtual disk 0 and 1 of the Z80-MBC are different. Disk 0 has the two first tracks reserved for the system image (loaded into RAM by the CP/M loader), instead disk 1 doesn't have this "reservation". This means that the images have a different "structure". More, because disk 0 must have the system image inside the two first tracks, the disk 0 image creation will be different if the OS is CP/M rather than QP/M.
      So to make things easier I've prepared some batch file to simplify the needed operations.
      As for the Assembler and C toolchains you need a Windows host or VM.


      Here all the steps to set up the needed tools:

      1. Create a working directory on your Windows Machine;
      2. Download Cpmtools and unzip in your working directory;
      3. Download last version of SRecord and unzip in your working directory;
      4. Download from the Files section CPMtools-custom.zip and unzip the files into the directory containing the Cpmtool executables (as cpmcp.exe). During the copy overwrite the file DISKDEFS because the new one contains the needed definitions for the Z80-MBC;
      5. Download from the Files section SRecord-custom.zip and unzip the files into the directory containing the SRecord executables (as srec_cat.exe).

      Now you are ready to create your custom image. First create a sub-directory (called e.g. CPM-files) in the cpmtools directory to store all the files to load in the disk image. Check that they fit into the 128kB avaliable space.


      Steps to create a Disk 1 image

      1. Go to the cpmtools directory and with an editor modify/add/delete in the file MakeDisk1.bat the various lines "cpmcp -f z80mbc-d1 %dskfile% CPM-files\xxxxx.yyy 0:xxxxx.yyy" to match the directory in your host (if needed) and all the files to load (xxxxx.yyy);
      2. From the cpmtools directory open the provided DOS command shell and give the following command (I'll use here the name disk1.dsk for the disk image file):
        MAKEDISK1 disk1.dsk
      3. After the execution copy the file disk1.dsk in the SRecord directory;
      4. Go to the SRecord directory, open the provided DOS command shell and give the following command:
        D1TOHEX disk1.dsk
      5. After the execution you will find four files named from disk1_SEG0.hex to disk1_SEG4.hex to upload into the virtual disk with iDisk.


      Steps to create a Disk 0 CP/M image

      1. Go to the cpmtools directory and with an editor modify/add/delete in the file MakeDisk0CPM.bat the various lines "cpmcp -f z80mbc-d0 %dskfile% CPM-files\xxxxx.yyy 0:xxxxx.yyy" to match the directory in your host (if needed) and all the files to load (xxxxx.yyy);
      2. From the cpmtools directory open the provided DOS command shell and give the following command (I'll use here the name disk0CPM.dsk for the disk image file):
        MAKEDISK0CPM disk0CPM.dsk
      3. After the execution copy the file disk0CPM.dsk in the SRecord directory;
      4. Go to the SRecord directory, open the provided DOS command shell and give the following command:
        D0TOHEXCPM disk0CPM.dsk
      5. After the execution you will find four files named from disk0CPM_SEG0.hex to disk0CPM_SEG4.hex to upload into the virtual disk with iDisk.


      Steps to create a Disk 0 QP/M image

      1. Go to the cpmtools directory and with an editor modify/add/delete in the file MakeDisk0QPM.bat the various lines "cpmcp -f z80mbc-d0 %dskfile% CPM-files\xxxxx.yyy 0:xxxxx.yyy" to match the directory in your host (if needed) and all the files to load (xxxxx.yyy);
      2. From the cpmtools directory open the provided DOS command shell and give the following command (I'll use here the name disk0QPM.dsk for the disk image file):
        MAKEDISK0QPM disk0QPM.dsk
      3. After the execution copy the file disk0QPM.dsk in the SRecord directory;
      4. Go to the SRecord directory, open the provided DOS command shell and give the following command:
        D0TOHEXQPM disk0QPM.dsk
      5. After the execution you will find four files named from disk0QPM_SEG0.hex to disk0QPM_SEG4.hex to upload into the virtual disk with iDisk.

      Remember that you...

    Read more »

  • A new OS: QP/M 2.71 and a RTC for timestamping

    Just4Fun05/23/2017 at 15:37 0 comments

      Here 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, so it should be ok for us. Anyway I've sent them a mail about this project.
      To enable timestamping you need a DS3231 based RTC module like this one:

      WARNING: these modules can cause battery "explosion"! How to fix it

      This cheap modules have a trickle charging circuit that may cause the "explosion" of the battery if you use a standard CR2032 cell. More, it can damage also a rechargeable LIR2032 cell (see this thread). So the safer thing is "disable" the trickle charging circuit (a CR2032 can last 5/10 years, so there is no practical need to a rechargeable battery, after all...).
      To avoid any charging current flowing into the battery you can take away the series limiting 200 Ohm resistor (or cut the trace). Alternatively you can take away the red diode, or destroy it (it is in series with the 200 Ohm resistor). In the following photo you can see the module with some Kapton tape (used as thermal barrier) before to desolder the 200 Ohm resistor (on the right marked as 201) with an hot air gun:

      And here after the desoldering:

      Now the module it's safe and a CR2032 can be used. To connect it use the SCL/SDA/VCC/GND terminals and connect them at the corresponding pins of the IOEXP/I2C connector of the Z80-MBC (pay attention because the position of the signals is different):

      QP/M quick set up guide

      The setup is quite similar to those used to install CP/M. The Assembler automated toolchain must be already set up and the Virtual Disk Module present.

      Here all the steps:

      1. Connect the DS3231 module (with the CR2032 battery inside);
      2. Update the IOS using the new file S221116_R100218_Z80.ino in the File section;
      3. Reboot the Z80-MBC and from a terminal emulator you'll see this:
        Press Y. If you are enough fast you have the RTC set up with the right date/time taken from the sketch compile time (if you are lazy like me you'll find this very handy...). In any case it is possible adjust the date/time manually too from the boot selection menu;
      4. Reboot the Z80-MBC again and select the iLoad boot mode;
      5. From the File section download the file "QPM271_DiskPack.zip", unzip it in the directory used for the Assembler automated toolchain;
      6. Upload the file "iDisk - S250317.hex" to the Z80-MBC using the Dos batch L.BAT (see Assembler automated toolchain) with the command:
        L "iDisk - S250317.hex"
        
      7. When iDisk waits for the input stream, from the Tera Term menu select "File" -> "Send file..." and choice one of the unzipped .hex file from QPM271_DiskPack.zip;
      8. Repeat step 7 for all the four files;
      9. Press the Reset button on the Z80-MBC and enter into the boot selection menu and select 4 to load the OS from disk 0 (and select the disk light ON if not already done, to have an idea of the behavior):

      NOTE: as already noticed, if you experience errors during the serial upload increase the delay after each line from the Tera Term menu (Setup -> Serial port -> Transmit delay -> msec/line). In my VM I set up a 90ms delay. This is due because Arduino serial port doesn't have any handshaking.

      Now you have QP/M 2.71 up and running, but you need further operations to enable the file timestampig (as stated in the QP/M Installation Guide):

      1. To enable file disk timestamping it is necessary run the utility QSTAMPX from A:
        and do the "disk timestamping" for both A: and B: disks.
        When done type the command D $T and check that the output is similar to this:
      2. Now to set up a starting date to all files give the command QSUB SETDATE to run a simple batch that I made to do this initialization easily;
      3. Copy the file SETDATE.QSB to drive B: (using the command QPIP B:=SETDATE.QSB) and repeat from B: the same batch (QSUB SETDATE)....
    Read more »

  • AUTOEXEC for CP/M

    Just4Fun05/02/2017 at 16:39 1 comment

      Playing with the Z80-MBC I realized that there was a missing feature: to run a program automatically after the "cold" boot.
      So after some searches I found a way to implement in the BIOS a function similar to AUTOEXEC.BAT for DOS using the CP/M SUBMIT command and a batch file that I called AUTOEXEC.SUB (of course...).
      Editing the AUTOEXEC.SUB file it is possible to run a sequence of commands after the cold boot (as with AUTOEXEC.BAT for DOS), and it is possible enable or disable the execution of the AUTOEXEC batch file from the IOS boot selection menu (but this isn't possible with DOS...).


      AUTOEXEC for CP/M quick set up guide

      You must have CP/M 2.2 already up and running (see CP/M 2.2, iDisk and a new IOS), and you can have also only a "single disk" installed (but I recommend the original dual disk configuration), meaning that only U1 (see the A110417 schematic) is populated. Of course the Assembler automated toolchain must be already set up.


      Here all the steps:

      1. Update the IOS using the new file S221116_R300417_Z80.ino in the File section;
      2. Reboot the Z80-MBC and select the iLoad boot mode;
      3. From the File section download the file CPM22SYS_BIOS_S050217_R300417.hex. This file contains only the new CP/M system image for the system tracks of Disk 0, so the "user files" will be left untouched;
      4. Upload the file "iDisk - S250317.hex" to the Z80-MBC using the Dos batch L.BAT (see CP/M 2.2, iDisk and a new IOS) with the command:
        L "iDisk - S250317.hex"
      5. When iDisk waits for the input stream:from the Tera Term menu select "File" -> "Send file..." and choice CPM22SYS_BIOS_S050217_R300417.hex. After the upload iDisk will show a summary, at this point press W to proceed and confirm your choice (as done for the CP/M 2.2 installation described in CP/M 2.2, iDisk and a new IOS). Wait until the write and verify phase is completed.
      6. Press the Reset button on the Z80-MBC and enter into the boot selection menu and select 4 for CP/M loader.


      All done!


      NOTE: as already noticed, if you experience errors during the serial upload increase the delay after each line from the Tera Term menu (Setup -> Serial port -> Transmit delay -> msec/line). In my VM I set up a 90ms delay. This is due because Arduino serial port doesn't have any handshaking.


      How use it

      To create or edit AUTOEXEC.SUB from drive A, you can use the ED command or an other editor like the Turbo Pascal editor. In this case remember to terminate the file with a CR, or "strange" things will occur when executing the SUBMIT AUTOEXEC command.
      You can test the execution giving the command SUBMIT AUTOEXEC from drive A (you can omit the extension .SUB inside the SUBMIT command).
      To enable the AUTOEXEC execution after the cold boot change the corresponding state to ON from the usual IOS boot selection menu.
      If the AUTOEXEC is enabled but the AUTOEXEC.SUB file doesn't exist in the drive A, an error will be displayed:


      New "disk packs"

      I've updated both "disk packs" in the files CPM22_DualDiskPack_v2.zip and CPM22_SingleDiskPack_v2.zip with the new BIOS in the system tracks. So if you are installing them for the first time or you need for any reason to reload them, the new BIOS will be installed. I've added an example of AUTOEXEC.SUB too.


      How it works

      The "trick" used was to inject the string "SUBMIT AUTOEXEC" into the CCP (the Command Processor of CP/M) input buffer. The BIOS after the cold boot checks if the AUTOEXEC flag is set in the IOS, and in this case makes the injection. When the CCP starts after the cold boot, it runs this injected command.

      In this video there is an in depth explanation for a "legacy" Altair 8800 clone.

      The CP/M 2.2 and the new BIOS sources are in the file "CPM22 BIOS - S050217 R300417.zip" in the File section.

  • CP/M 2.2, iDisk and a new IOS

    Just4Fun04/20/2017 at 20:36 1 comment

      CP/M 2.2 quick set up guide

      The set up is very simple. I've done an utility (iDisk) to simplify all the needed operations. Of course the Virtual Disk Module must be present, but you can have also only a "single disk" installed (but I recommend the original dual disk configuration), meaning that only U1 (see the A110417.pdf schematic) is populated.
      The Assembler automated toolchain must be already set up.


      Here all the steps:

      1. Update the IOS using the new file S221116_R130417_Z80.ino (or a newer version if present) in the File section;
      2. Reboot the Z80-MBC and select the iLoad boot mode (if not already selected);
      3. From the File section download the file "iDisk - S250317.hex" and copy it into your PC in the directory used for the Assembler automated toolchain . (Do not use the source file "iDisk - S250317.c" because it requires a special compiling option);
      4. From the File section download the file "CPM22_DualDiskPack.zip" and unzip it (for a single disk configuration download the file "CPM22_SingleDiskPack.zip"). Each disk image is divided into four .hex files called "segment" (32kB each) that are named accordingly (e.g. D0XXX_SEG1.hex means the segment 1 of disk 0);
      5. Upload the file "iDisk - S250317.hex" to the Z80-MBC using the Dos batch L.BAT (see Assembler automated toolchain) with the command:
        L "iDisk - S250317.hex"
            
      6. When iDisk waits for the input stream:
        from the Tera Term menu select "File" -> "Send file..." and choice one of the unzipped .hex file from CPM22_DualDiskPack.zip (or CPM22_SingleDiskPack.zip for a single disk configuration). After the upload iDisk will show a summary:
        at this point press W to proceed and confirm your choice.
        You don't have to follow any order in the "segments" upload sequence, iDisk will know how to do. To know before each upload what "segments" have been already written into the disks just see the "Disk segment write status":
        in the photo the segments 0, 1 and 3 of Disk 1 have been already successfully written, so you can choose any of the remaining;
      7. Repeat step 6 for all the eight (or four for the single disk pack) "segment" files;
      8. Press the Reset button on the Z80-MBC and enter into the boot selection menu:
        select 4 for the CP/M loader (and select the disk light ON if not already done, to have an idea of the behavior).

      All done!


      NOTE: if you experience errors during the serial upload increase the delay after each line from the Tera Term menu (Setup -> Serial port -> Transmit delay -> msec/line). In my VM I set up a 90ms delay. This is due because Arduino serial port doesn't have any handshaking.

      Disk speed

      The Virtual Disk Module is based on simple EEPROMs using a 200KHz I2C serial bus. Of course do not expect the same speed of an hard disk with a DMA controller!
      The speed probably is like using the floppy drive of those days...

      Single disk configuration

      You can have also only a "single disk" installed (but I recommend the original dual disk configuration), meaning that only U1 (see the A110417.pdf schematic) is populated.

      In this case you have about 120kB free, because the first two tracks of Disk 0 are reserved for the system image (Disk 1 doesn't have the system image, so all the 32 tracks are used for the file system).

      Because the BIOS is the same and is configured for a dual disk system, if you try to select the "B:" drive you'll get a "BAD SECTOR" error.

      Disk pack contents

      In the disk 0 image there are the various external CP/M commands, the Basic interpreter, the CP/M Assembler and the Macro Assembler.
      I've added also D, an alternative DIR command, and PEG, a bin to hex converter (and vice-versa) to exchange files:

      In the disk 1 image there is the complete Turbo Pascal compiler v3.01A with a sample program (SA.PAS):

      In the "single disk pack" the CP/M Assembler and the Macro Assembler are missing, and the Turbo Pascal is without the installing executable (not a big issue anyway) and without the sample program.


      In a next Log I'll explain how create custom...

    Read more »

  • Virtual Disk Module, a new IOS and ViDiT

    Just4Fun04/13/2017 at 19:37 3 comments

    It's time for a new "module", the Virtual Disk Module! In the photo is that one on the right, near the previous GPIO module.

    In the File section is possible see the simple schematic A110417.pdf with two I2C EEPROM 24LC1025.

    With this module it is possible to emulate two disks of 128kB each (probably like the floppy disk drives of those years).

    Each disk is divided into 32 tracks of 32 sectors. Each sector is 128 bytes long.

    Of course to manage this new HW there is a new release of IOS. The new file S221116_R180217_Z80.ino is in the File section.

    This new IOS checks if the module is present and prints a message if found:

    There is also a new item in the boot selection menu if the virtual disk is found, to use the User led as a disk activity led:

    I suggest to activate this option to have an idea of the behavior.


    ViDiT

    In the File section I've added a simple test program (file "ViDiT - S090417.c") to check the virtual disk. Of course you need to compile it with the C "toolchain":


    About I2C speed

    With this IOS the I2C speed is 200KHz. Note that if you are using a 16MHz external quartz to clock the Atmega32 the I2C speed will be 400kHz. In this case I suggest to lower the two 4k7 pull-up resistors (on SDA and SCL signals) to about 2k2.



    The next Log will bring the CP/M 2.2 up and running...

  • Forth language, new multi-boot selection and a new name

    Just4Fun02/17/2017 at 21:33 4 comments

    Forth


    Thanks to Bill Westfield now we have a new language for the Z80-MBC, the fig-FORTH v1.3 (here the link to the Bill GitHub repository with the source he adapted for the TASM assembler with the needed modifications for the Z80-MBC).

    The acronym "fig" stands for "Forth Interest Group", that was a world-wide non-profit organization (now dissolved) for the promotion of the Forth computer language.
    I've just started to play with this thing, and I must say that it is not the most friendly language I've seen... anyway it is an interesting different approach.

    To enable Forth just upload the new IOS release S221116_R120217_Z80.ino in the Files section, and select the Forth language from the new multi-boot menu (see next paragraph).

    Here it is a "blink" demo program:

    ( ****************************
    (                     
    ( Blink test - Forth - Z80-MBC
    (
    ( ****************************
    : ledon 1 0 P! ;
    : ledoff 0 0 P! ;
    : delay 4000 0 DO NOOP LOOP ;
    : blink CR ." Blinking..." CR BEGIN ledon delay ledoff delay 0 UNTIL ;

    To execute give the command "blink":


    If you are using Tera Term to send a text file to load a forth source, remember to set up a delay of 1ms for each character (serial port managed by the Arduino bootlader doesn't have any handshaking, so for now this is required to handle the serial stream without errors when sending a text file using a terminal emulator):


    New multi-boot selection


    Now pressing the User key after a reset brings to a new menu to chose the preferred boot mode. During this phase the LED-D0 will blink until you choose the boot mode:


    New name


    As you can see from the previous photos, from this release the MBC acronym changes to "Multi Boot Computer"...

  • An automated C language toolchain

    Just4Fun02/09/2017 at 21:26 0 comments

    Here how set up a toolchain to program the Z80-MBC using the C language. It is based on SDCC (Small Device C Compiler) and uses the same "process" of the previous Assembler toolchain.
    In the following it is assumed the the Assembler toolchain is already set up in a Windows host as described in in the Log: New iLoad boot mode and an automated Assembler toolchain.
    So only the SDCC relevant part is explained here.


    Here it is a short video with the toolchain in action:

    What you need to do:

    1. Create a working directory (or use the previous one) where to store the C sources and the two batch files (C.BAT and L.BAT) in the C_batch.zip file from the File section (if you are using the same assembler working directory overwrite the previous L.BAT);
    2. With a text editor search the line:
      "C:\Program Files\teraterm\ttermpro.exe" /c=3 /BAUD=9600 /w="Z80-MBC Terminal" /m=LoadZ80.ttl
      inside C.BAT and L.BAT and verify that both the path and the COM number (/c=3 means COM3) meet your system;
    3. Download and install SDDC from here;
    4. Download the file S030217_crt0.s from the Files section in the working directory;
    5. Open the DOS command line and give the command: "sdasz80 -o S030217_crt0.s".
      Then rename the generated S030217_crt0.rel as crt0.rel. Copy it in the SDCC directory "C:\Program Files\SDCC\lib\z80" (may be a bit different in your system) overwriting the old one.

    All done!

    As usual close Tera Term before every new upload.

    To check if it is all ok, download from the File section the file C_demo.zip and unzip it in the working directory.
    From the DOS command line give the command: "C Blink.c" to check if all the toolchain works as in the video.
    Try also the other demo ANSItest.c (taken from here) to check the ANSI capabilities of a different terminal emulator or a physical terminal:

    About SDCC

    I'm pretty new to SDCC. The SDCC documentation is 8051 "focused", so the given examples can be misleading if used with an other processor in mind.
    When "porting" SDCC to a target HW, there are 3 things to prepare:

    • customize the crt0.rel file that contains the initialization code for the target system;
    • add to the library the function putchar(char c) to send output to the console;
    • add to the library the function getchar() to read from the keyboard.

    I found the documentation quite missing about how to modify for a custom system.
    In particular in the provided crt0.s example there isn't a needed global declaration of three variables (l__INITIALIZER, s__INITIALIZED and s__INITIALIZER). Without this declaration the code will not compile.
    And to make this customization you need to know how the provided assembler works, but the assembler manual is not provided. So you must find it googling...
    If you are used to the Arduino IDE, read carefully the SDCC manual. This C compiler is a lot more "rude" about types and syntax... (as C standard is...).

    Last minute update

    Just found the assembler and linker documentation here!

  • Two layers PCB!

    Just4Fun02/06/2017 at 20:44 0 comments

    Thanks to Bill Westfield now we have a beautiful ready to made PCB!


    I've uploaded in the Files section all the Eagle files (schematic + PCB) zipped as 4chipZ80-Eagle-PCB.zip.
    There are two versions, the first one with some little bugs and a second one with the needed corrections (see the "readme" file inside the zip for the explanations).

    In any case I suggest to check at the Bill GitHub repository here for any update/information before sending it to a service (so you are sure to use the last updated version...).


  • New iLoad boot mode and an automated Assembler toolchain

    Just4Fun01/31/2017 at 20:36 7 comments

      This new IOS release (S221116_R230117_Z80.ino in the Files section) brings a new dual-boot mode. Now it's possible choose if boot with the usual Basic or use the new iLoad boot mode.
      iLoad (S260117.asm in the Files section) is an Intel-Hex bootloader that allows to load from the serial port a binary program using the Intel-Hex format, and execute it. I've used a large part of the source from this site.

      To select a boot mode just push the Z80-MBC Reset button and immediately after push the User button at least until the User led turns off.
      The selection works as a toggle switch, and is stored in the EEPROM.
      Here it is a video that shows how to switch:

      Using the iLoad boot mode it's possible to automate all the process from the source to the execution in the target.
      This video shows an automatic Assembler toolchain; only one command from the source assembler to the execution on the target (the source file BlinkDemo.asm used in the video is in the File section):


      HOW TO SET UP AN "AUTOMATED" ASSEMBLER TOOLCHAIN

      What you need to do:

      1. Set up a Windows host or a VM (Virtual Machine). I've used a Windows XP SP3 VM onto a linux host;
      2. Load the Windows driver for your serial-USB adapter. Remember that your dongle *must* have the DTR signal;
      3. Create a working directory where to store the assembler sources, the assembler program and the two batch files (A.BAT and L.BAT) in the asmbatch.zip file (see the File section). With a text editor search the line:
        "C:\Program Files\teraterm\ttermpro.exe" /c=3 /BAUD=9600 /w="Z80-MBC Terminal" /m=LoadZ80.ttl
        inside A.BAT and L.BAT and verify that both the path and the COM number (/c=3 means COM3) meet your system;
      4. Download and copy in the previous directory the TASM v3.2 assembler from here. The on-line manual is here;
      5. Download and install the "Tera Term" terminal emulation from here;
      6. Set up Tera Term. From the Tera Term "Setup" menu select "Serial port..." and configure the parameters for your COM<n> connection to your serial-USB adapter. Set 9600 Baud, 8N1, Flow control none, Transmit delay 40ms/line. Save configuration with "Save setup..." from the "Setup" menu;
      7. Copy the file LoadZ80.ttl (see Files section) in the "Tera Term" installation directory, where it is installed the main file ttermpro.exe (for a standard installation for an English Windows version should be "C:\Program Files\teraterm");
      8. Open the file LoadZ80.ttl with a text editor and go to line 10. Edit the "setdir" parameter to meet your working directory path and name created at point 3. on your system, and save the file;
      9. Open the DOS command line and go in the working directory (using the CD dos command), attach the serial-USB dongle to the Z80-MBC and for a VM "connect" the dongle to the emulated usb of your VM. All done!

      Now it's time to check if it is all ok. From the DOS command line give the command: "A blinkdemo.asm" to check if all the toolchain works as in the video. To load the last compiled program give the command "L" without parameters. To load a specific intel-hex file give the command "L <filename.hex>".

      Close Tera Term before every new upload.


      iLoad behavior

      Please remember that iLoad will take the first address of the intel-hex stream as the starting address of the program, and after the loading will jump to it.
      iLoad will check the hex stream for errors, and protects itself if "someone" try to load a program (or a part) over it ("illegal address" error).

View all 12 project logs

  • 1
    Quick instructions intro:

    All the detailed instructions are provided in the "DETAILS" section and in every "LOG".

    Because this project has grown a lot on the way (more than I've supposed at the beginning...) here you can find a short and simple build guide without "navigate" into all the various "LOGs".

    This short guide is referred to the current (at present date 31 August 2017) last "level" of development as described in "A new OS: QP/M 2.71 and a RTC for timestamping".

  • 2
    Add the Atmega32 support in your Arduino IDE:

    The standard distribution of Arduino IDE doesn't have the Atmega32 "core" support files.

    You need to add them from here.

  • 3
    Flash the Atmega32:

    First of all you need to flash the Arduino bootloader into the Atmega32.

    To do this there are a lot of ways. I use a cheap USBASP programmer that you can find "around" for less than 2$.

    Remember to select from Arduino IDE the "Atmega32 8MHz Internal" clock option before flashing the bootloader!!!

View all 6 instructions

Enjoy this project?

Share

Discussions

Just4Fun wrote 02/16/2018 at 07:33 point

If someone is interested, in the Z80-MBC GitHub Repository I've uploaded all the previous versions of the IOS "sketch" (under the "Old Versions" directory). The "Changelog" is inside each sketch, at the beginning.

I've uploaded also the Q/PM 2.71 "Diskpack" (to use the RTC), that was missing in the repo. To install Q/PM follow the "Log": A new OS: QP/M 2.71 and a RTC for timestamping.

  Are you sure? yes | no

Edgar Salgado wrote 02/12/2018 at 21:54 point

I finally got a working Z80-MBC soldered on the v2 pcb! Great! I flashed the ATMEGA but... I have difficulties having the terminal emulator send any text... I get stuck at the first promt (to set the RTC at compile time). I tried 9600 7 bits, but I can't find any valid setting to get it to send keystrokes :( Any good configuration for "screen" or "minicom", or putty under linux?

Thanks for this fun projet :)

  Are you sure? yes | no

Just4Fun wrote 02/13/2018 at 15:20 point

Use 9600, 8bit, N, 1S (no flow control).

Remember to upgrade the sketch to the last version (S221116_R100218_Z80.ino).

Under linux probably you need to enable USB for your username too.

  Are you sure? yes | no

Edgar Salgado wrote 02/13/2018 at 18:06 point

That worked great! It's been flashing the latest firm and works out of the box with "screen /dev/ttyUSB0 9600". It was that bug that was messing with the UART 😃

  Are you sure? yes | no

wenij wrote 02/11/2018 at 16:19 point

I try to trace the M32 code, but can't understand why need to do one BUSREQ_ for exit wait status?

==

digitalWrite(BUSREQ_, LOW);                // Request for a DMA
digitalWrite(WAIT_RES_, LOW);              // Reset WAIT FF exiting from WAIT state
digitalWrite(WAIT_RES_, HIGH);             // Now Z80 is in DMA, so it's safe set WAIT_RES_ HIGH again
digitalWrite(BUSREQ_, HIGH);               // Resume Z80 from DMA    

==

The BUSREQ will be check in last instruction T cycle, but the Wait should happen after T2  of the instruction cycle.  Why not just do WAIT_RES_ L and H?   

  Are you sure? yes | no

Just4Fun wrote 02/13/2018 at 15:16 point

BUSREQ_ is used to avoid data clash exiting from Twait and to handle the FF (because it is used in the "unstable" region too, when both R and S are asserted)

  Are you sure? yes | no

Just4Fun wrote 02/05/2018 at 16:07 point

Just as a starting point, here it is a first unfinished untested draft of what the Z80-MBC2 could be, with SD card and banked memory:


https://farm5.staticflickr.com/4740/25227641727_e48a4fdc31_o.jpg

and here a simulation of the memory bank controller (for CP/M 3):

https://simulator.io/board/QpvxBsvpV2/2

Only an idea, not having the time to do any HW/SW check/test/proof for now...

  Are you sure? yes | no

villaromba wrote 02/05/2018 at 19:19 point

Excellent!!! Some very interesting additions/enhancements. Good to go down the SD Card route for greater flexibility and ease of programs.  CP/M 3 with  banked memory - a welcome change to CP/M 2!!!! Look forward to some builds in the future.

  Are you sure? yes | no

Cyril V. wrote 02/06/2018 at 18:04 point

That look great, can't wait!

Quick question: Why do you need the two MMBT2907A?

------------

Thank you for the very clear explanation - as usual :)

  Are you sure? yes | no

Just4Fun wrote 02/09/2018 at 07:08 point

In the Z80 datasheet the maximum referenced I(OL) is 2mA. Probably it is possible sink more current at the cost of an higher V(OL), but this it is out of specs. So for a typical 4/5mA led it's safer to use a transistor (or a mosfet) to do the job.

The MMBT2907A is an smd PNP, but here I'll use a TH part (a "generic" 2N2907, that costs near nothing...).

  Are you sure? yes | no

kitguy wrote 01/29/2018 at 09:12 point

I only have ATMEGA328P-PU. Is it possible to use 328P-PU instead of 32A?

  Are you sure? yes | no

Just4Fun wrote 01/30/2018 at 06:52 point

Sorry, it isn't possible...

  Are you sure? yes | no

WestfW wrote 02/01/2018 at 06:11 point

(it needs pretty much all 40 pins of the Atmega32.)

  Are you sure? yes | no

jb.langston wrote 01/22/2018 at 00:28 point

I started working on a Z80 project a few weeks ago using a very similar approach to yours.  I didn't actually know about your project until after I started on mine but found it when browsing Z80 projects on Hackaday. I saw in your last comment that you are squeezed for I/O. I'm using a MCP23S18 to get extra I/O on my project.  Here's my code in case it has anything you can use... https://github.com/jblang/z80ctrl

  Are you sure? yes | no

WestfW wrote 01/20/2018 at 02:53 point

I've uploaded the V3 schematics, PCB, and gerbers to https://github.com/WestfW/4chipZ80

This version adds on-board I2C EEPROMs, at the expense of some of the prototyping area.

Once again, I haven't actually fabbed or tested these, so ... use at your own risk.  I'll let you know if I get feedback.

(Also note that at this point, none of the firmware in the github  repository  has been updated since the initial PCB, so it doesn't include any of the new stuff and is otherwise "stale.")

It's tempting to, say, use an ATmega128 (which are also very cheap)  to get some extra IO, do away with the prototyping area in favor of some sort of video-out circuitry, and maybe do some more SMT to make more room on the PCB, but I also feel like this should be kept "easy to hack hardware" by using through-hole components.  Sigh.

  Are you sure? yes | no

Cyril V. wrote 01/20/2018 at 13:59 point

We could have the two versions side by side.

A simple through-hole version like the V3.0 without AV and Keyboard easy to solder.

A SMD Verision with AV and Keyboard for people with more skill in soldering.

Another solution is to use a header board ATMega128 just for $2 more (this one is widely available):

https://www.ebay.com/itm/ATMEGA128-Adapter-Plate-Adapter-ATMEGA128-Plate-Development-System-Board/401255920894?hash=item5d6cb774fe:g:~wkAAOSw241YcTE0

  Are you sure? yes | no

wenij wrote 02/06/2018 at 03:45 point

for the temporarily solution, I use arduino 2560 + WestfW V2.1 and wire jump it to the M32 IC socket, and change the pin define in the Arduino  .ino file, and it still can work very well. Now, I have more extra pin can play more test ^_^.

share my modify arduino code and picture.

https://drive.google.com/drive/folders/1BWa1PmOornjm9QEJT2ijpwvvKtwBV4ul?usp=sharing


  Are you sure? yes | no

Just4Fun wrote 02/06/2018 at 07:37 point

OMG! I never thought of doing such a thing... Great!!

  Are you sure? yes | no

wenij wrote 01/21/2018 at 00:43 point

Is it possible to add  2 x 22pF load capacitors for ATMEGA32's XTAL1/2 to get external 16MHZ.

  Are you sure? yes | no

WestfW wrote 01/21/2018 at 05:56 point

You and CyrilV both want that.  There are pads on the xtal pin that might ALMOST work for a resonator with built-in caps (although they were mainly aimed at having extra IO pins on chips that let you reuse the pins if the internal osc was used (although, I'm not sure that there are any such chips.)
I'll give it a try for v4?  standard sized crystals?  Would it be OK to put some components UNDER the m32?  (requires use of a socket, of a particular type, or maybe putting the components on the bottom of the board.)  This strikes me as "riskier" than adding the EEPROMs; I'll need to move around some other key traces and stuff...

  Are you sure? yes | no

wenij wrote 01/21/2018 at 06:45 point

using standard crystals is good, and it should be ok to put under m32. ( using socket also give a chance to replace with more flash size  chip.  ex.  m644 or m1284p)

  Are you sure? yes | no

Just4Fun wrote 01/23/2018 at 11:18 point

Bill, I think that the grounding of the oscillator is not good...

Give a look here: https://electronics.stackexchange.com/questions/39136/competing-pcb-crystal-layout-recommendations

  Are you sure? yes | no

WestfW wrote 01/24/2018 at 07:04 point

Hmm. I'm not sure how much I can do, and I'm not sure I trust some of those app notes that apply to SMT high-speed oscillators when it comes to relatively low-speed TH parts (it seems to me like PCB traces here are similar in length to the pin/bondwire traces inside the chip, for instance.)
I can do a bit to help stop the "patch antenna effect" by providing an isolated path to CPU GND, maybe. Does this look any better?
https://photos.app.goo.gl/ppamAo90bjVazeKV2
(has anyone EVER seen a commercial or other published design that follows the Atmel "caps go between the pins and the crystal" recommendation?)

  Are you sure? yes | no

Just4Fun wrote 01/24/2018 at 10:38 point

For what I know, this it seems a lot better to me...

  Are you sure? yes | no

Just4Fun wrote 01/22/2018 at 17:17 point

Bill, it seems that someone (in Japan...??) is selling your PCB as a kit: https://store.shopping.yahoo.co.jp/orangepico/zwy7ve8yim.html

:-)...

  Are you sure? yes | no

Cyril V. wrote 01/22/2018 at 17:58 point

It is the V2 for $13.5 (1500 yen) it is not too bad.

  Are you sure? yes | no

WestfW wrote 01/23/2018 at 08:15 point

That's fine with me, if it's OK with you.  It's nicely attributed too, a far as I can tell...

  Are you sure? yes | no

wenij wrote 02/03/2018 at 06:51 point

I get the V3.0 PCB board today, build one board, and work very well. But maybe have a little issue, the 2nd EEPROM address seems change from 0x51 to 0x52. ( need to change the arduino code to use it)

#define   EXT_EEPROM1   0x52  // I2C EEPROM 1 address (128kB))

  Are you sure? yes | no

WestfW wrote 02/04/2018 at 22:30 point

Huh.  Sure enough, that's the way the address lines are set up in the schematic, despite the labels that say 0/1.  I wonder how I managed to do that - the "add on" for the V1 PCB that I drew up is correct.  Sorry about that.
On the bright side, the address pins for the EEPROMs are supposedly laid out so that it would be easy to cut traces and add jumpers on the bottom of the board to change their addresses (though in this case, the SW change sounds easier.)

  Are you sure? yes | no

Marcelo Dantas wrote 02/05/2018 at 21:45 point

Would you be able to refer me to a maker of good/cheap prototype boards of V3?

  Are you sure? yes | no

wenij wrote 02/06/2018 at 00:49 point

I use seeedstudio fusion service, you can check it. for this project, it only cost $4.9 but $18  for DHL. https://www.seeedstudio.com/fusion.html

  Are you sure? yes | no

Just4Fun wrote 02/06/2018 at 07:25 point

I usually use ELECROW (https://www.elecrow.com/pcb-manufacturing.html).

5 PCBs 10x10cm @ $4.9 (any color) plus about $8 for shipping in EU using the cheapest "registered airmail". It usually takes about 20 days from the order.

Sometimes they add one or two PCBs more for free.

This is last batch I did with them: https://farm5.staticflickr.com/4480/37621987006_84a53aa93f_o.jpg
They added two more PCBs for free...

  Are you sure? yes | no

wenij wrote 02/06/2018 at 09:05 point

wa..  the shipping cost of ELECROW servicve is  cheap than seeedstudio. thanks, this good info.

  Are you sure? yes | no

WestfW wrote 02/07/2018 at 03:22 point

Most of the Chinese suppliers are running "up to ten 10x10cm boards for $5 (or less)" deals these days, so shipping costs tend to dominate, and run about $20 for all but the cheapest shipping methods (that many vendors seem unwilling to use.) (and 5 boards might be cheaper to ship than 10.)
The PCB itself is very conservative - min 0.3mm traces and 0.6mm vias, which is about twice the typical advertised limits.  Anywhere should be able to make them.

  Are you sure? yes | no

Ronald Lens wrote 11/24/2017 at 21:27 point

Just received my PCBs from China. Could not find an affordable PCB manufacturer around here (the Netherlands), now have 5 v2 PCBs for 1$ apiece excluding shipping. Have to say the boards look very good. If anyone around NL would like one, let me know, I order 5 which is the minimal order.

https://imgur.com/wbaBLA6

Looking forward to putting it together.

  Are you sure? yes | no

Edgar Salgado wrote 11/25/2017 at 19:30 point

Hello Ronald, what about selling and sending one to me via normal post to Spain? Is that an option? :)

  Are you sure? yes | no

WestfW wrote 11/15/2017 at 03:36 point

New commit for the PCBs at https://github.com/WestfW/4chipZ80


Add VCC/GND labels to bottom silk for new prototype-area vias.Bump version to V2.1 to account for the new power vias in prototype area.
rename files to reflect version number (Z80-4chip-v2.1.*)
Add zip of v2.1 gerbers to Gerbers-V2 directory.

(also fixes the r16/r17 "problem.")

@Cyril V. says he's built and tested a V2 PCB; since V2.1 changes are so minor, it should work as well.  I've got a tentative V3 that adds the I2C memory, but I'm hesitant to make that level of change when the chances of someone actually building or testing them is so small.  Unfortunately (?), a "working" V1 with things added to the proto area is "good enough" for my uses.

  Are you sure? yes | no

Just4Fun wrote 11/15/2017 at 07:23 point

Great!

BTW: these days I'm just started a new FPGA project... It should be "Grant's Multicomp" compatible, so it should "run" a complete VHDL Z80, 6800, 6809, 6502 system with VGA and Keyboard... Hmmm, long way... may be this time I'll see the Magic Smoke go away.... :-)

  Are you sure? yes | no

legacy wrote 11/26/2017 at 19:37 point

cosi poi ci sbrodoli nuova merda cinese a basso costo? vero?

  Are you sure? yes | no

Cyril V. wrote 11/15/2017 at 18:17 point

Thank you for you work West. If you post it (V3) I will order a batch.

  Are you sure? yes | no

john wrote 11/15/2017 at 22:39 point

Cyril - I’ll kick in a little $ for a couple of boards from that batch...

  Are you sure? yes | no

Greg Walker wrote 11/04/2017 at 11:49 point

Interesting concept. I like the idea of utilising the ATmega MCU as a bootloader and to transfer the OS to RAM. I note the pull down resistors R5-R12 on address lines A9-A15. As the Mega is limited to the first 1K of address space I'm not sure how you're loading above that memory space. I understand why you'd put them there to prevent the inputs floating.

Think I'll have to have a good read through the ATMega code to work out how you're uploading beyond the first 1K.

Good work on this! I think I've found my next project.

  Are you sure? yes | no

Just4Fun wrote 11/05/2017 at 21:24 point

Thanks! You can find some info about the boot process here:

SOFTWARE INTERNALS: The boot process

  Are you sure? yes | no

Peabody1929 wrote 11/02/2017 at 17:15 point

Instead of adding an EEPROM with an I2C interface, why not build an I2C interface for a Flash EPROM?  It could be as simple as a pair of MSP23017SP and a 29F040.  This would give I2C R/W access to a 512KB flash disc.   

  Are you sure? yes | no

Just4Fun wrote 11/05/2017 at 21:44 point

The next Z80-MBC-2 very likely will use a SD disk, so probably no more eeprom...

I've "planned" the development of the new Z80-MBC-2 after the completion of a new FPGA project I've just started now...

  Are you sure? yes | no

siffland wrote 11/01/2017 at 02:37 point

How hard would it be to add a 24LC256 as a third 256k disk (i think cp/m can address 256k.)


Also has anyone gotten xmodem or zmodem to work, i got kirmet on there (custom disk image), but cannot get it to transfer files across the serial port.

Sorry just playing around, always want it to do more.  OK i just want to play zork.

  Are you sure? yes | no

Just4Fun wrote 11/01/2017 at 08:42 point

Hi, about the 24LC256... it is a 256Kbit EEPROM so... it is 32K x 8bit = 32KB (B=bytes).... I don't think that it would be so useful... :-)

  Are you sure? yes | no

siffland wrote 11/01/2017 at 23:52 point

Your right, just trying to get more space.  I didn't read the spec sheet. 

Would adding more disks be as easy as defining more EXT_EEPROM?'s and giving them new addresses?  Formatting them might be problematic, but i can probably figure that out.

  Are you sure? yes | no

Just4Fun wrote 11/05/2017 at 21:31 point

You need to modify the BIOS too, as stated in the "CP/M Alteration Guide"...

And modify some code in the Virtual Disk "engine", inside the sketch...

And modify iDisk...

And probably other things...

  Are you sure? yes | no

villaromba wrote 10/22/2017 at 13:22 point

Yes, well done indeed!! I have learnt a lot  successfully constructing this project all the way through with all the add-ons.  The software side (not my main strength) has also taught me a lot and given me a much broader understanding.  I do hope that further developments can take place but fully aware that  these  don't happen overnight !!! 

  Are you sure? yes | no

Just4Fun wrote 10/22/2017 at 16:10 point

Thanks you! I'm currently "playing" with some CPLD/FPGA stuff (as you can see), but I've a lot of improvements for this project too. Of course they will require deep changes a lot of time...

  Are you sure? yes | no

WestfW wrote 10/22/2017 at 00:28 point

Congratulations!
https://hackaday.com/2017/10/21/these-twenty-projects-won-1000-in-the-hackaday-prize/#more-277969

(There are two things that particularly impress me with this project:

1) The number of people that have actually constructed it (and in several different ways.)

2) the amount of additional work that has gone into improving the project.

These are really significant accomplishments, in a world where so few "things" ever get much past the original version by the original designer.)


  Are you sure? yes | no

Just4Fun wrote 10/22/2017 at 16:04 point

Bill, thanks you a lot for yours beautiful words!

  Are you sure? yes | no

john wrote 10/23/2017 at 14:06 point

Totally agree - aside from this being fun from the retro-computing angle, having built it, debugged my sloppy wiring and modifying the code for my specific changes was a great way to learn and was time well spent!

  Are you sure? yes | no

Just4Fun wrote 10/26/2017 at 19:59 point

  Are you sure? yes | no

joel076 wrote 10/16/2017 at 18:13 point

When i try to upload hex files it doesnt display the data, what could i be doing wrong?

  Are you sure? yes | no

Just4Fun wrote 10/20/2017 at 09:06 point

Hi, could you add more details...?

  Are you sure? yes | no

joel076 wrote 10/28/2017 at 10:41 point

The computer is working and it displays the choices but when i try to upload a hex file the macro just stops at line 40 and doesnt display any data.

  Are you sure? yes | no

WestfW wrote 09/11/2017 at 09:58 point

Sigh.  I keep going down this path:

1) gee, it should have a front panel!  To monitor the address and data buses, you know.

2) Binary or Hex?   Hex, I guess; I've got all those 4-digit displays.

3) So you need a binary-to-7seg (hex) decoder, eh?

4) Sure!  I'll use a micrcontroller.  I can get 4digits (multiplexed) worth out of a $2 micro; cheaper than 7447s were, back in the day...

5) 24bits (16 address, 8 data) worth, though?  Ok - another ATmega32!  Or two.  Maybe an m328 to read the bits and an m8 to drive the displays?

6)  ANOTHER couple of AVRs?  You've now got more memory in the support micros than in the Z80 system...  (depressed.)

(What about switches?!)

  Are you sure? yes | no

Just4Fun wrote 09/11/2017 at 12:36 point

LOL...  Are you thinking about an Altair like front panel...? :-)

May be something like this... https://hackaday.io/project/20011-altair-8800-front-panel-ardiuno-shield

  Are you sure? yes | no

WestfW wrote 09/14/2017 at 08:42 point

I think I have something like the KIM-1 readout in mind, or maybe a COSMIC ELF (though that used expensive internally decoded dot matrix displays, and only two of them, IIRC.)
I keep wandering off into thoughts of  HCMS29xx, OLED, and LCD displays, too.  NO!  I bought that big box of clock LED displays and I WILL USE THEM!

  Are you sure? yes | no

Dutchman wrote 08/28/2017 at 01:52 point

Hi, i have a question about the Z80, i couldn't find your z80 (Z84C004) and could only find the Z84C0020, and from what i understood the only difference between these two is the speed at wich they need to run (your z80 at 4Mhz and mine at 20Mhz), since im quinda of noob could you explain what are the alterations to be made to the board in order for these to work ?

  Are you sure? yes | no

Just4Fun wrote 08/29/2017 at 06:20 point

Hi, you can use the Z84C0020 without any change. The minimum clock frequency for *any* CMOS Z80 is 0Hz (DC)!

  Are you sure? yes | no

WestfW wrote 08/09/2017 at 21:30 point

Can you attach a "license" of some kind to the design and various firmware bits?
I had someone asking about the PCB license (now explicitly CC BY-SA 4.0, unless that's unacceptable to you.)  Various institutions and distribution mechanisms get pretty fussy about having an explicit license that their lawyers can understand.

  Are you sure? yes | no

Just4Fun wrote 08/10/2017 at 06:33 point

Hi, I'm completely a noob about "licensing"... :)

So you mean that is better to add an explicit  disclaimer on "every" schematic and SW source file....?

I've added in the bottom of the "Details" a last "paragraph" about licensing. Do you thing that it is enough?

I've added also a licensing note in my git repository (https://github.com/SuperFabius/Z80-MBC). I've "choose" GPL v3 but I haven't no idea if CC BY-SA 4.0 could be "better".

This things drive me crazy....

Could give me some guidance....?


BTW (after some googling...): in the creative common site they say that the CC license is not appropriate for SW/HW....  (https://creativecommons.org/faq/#Can_I_apply_a_Creative_Commons_license_to_software.3F), but here (https://www.fsf.org/blogs/licensing/cc-by-4-0-and-cc-by-sa-4-0-added-to-our-list-of-free-licenses) they say that are "compatible" with GPL v3...  OMG!!!

An other interesting article about HW: https://forum.kicad.info/t/using-the-l-gpl-as-an-open-source-hardware-license/1925/2

  Are you sure? yes | no

WestfW wrote 08/11/2017 at 07:55 point

Grr.  Long reply deleted by the Hackaday.io software...
Interesting links:

http://www.ladyada.net/library/openhardware/license.html

https://www.oshwa.org/faq/

Personally, I'm not fond of "viral licenses" like GPL that insist that everything that comes near them also become open source, and prefer MIT for software.  Other people think that the viral property is really important.

Hardware seems to be problematic because OSSW licenses are based on copyright, but copyright only protects a particual expression of intellectual property.  In theory, when I re-write your pdf schematic in EAGLE and make a PCB, that's a different enough expression that it wouldn't violate the original copyright.

One thing that I think is particularly important is some sort of "statement of intent" - just write what you want to allow and disallow, in plain english rather than license-eese.  It may not hold up in court, but at least people will have a good idea whether they're intentionally going against your wishes or not.  For example, you can find Arduino statements to the effect that they intend to allow commercial and proprietary products to be based on the Arduino core (and hardware), which is comforting in spite of the fact that some of the licenses they use are pretty ambiguous when it comes to embedded firmware...

  Are you sure? yes | no

Just4Fun wrote 08/11/2017 at 10:57 point

To keep it simple, now there is a "Licensing" paragraph at the end of the main "Description/Details" paragraph, and on the git repository the "LICENSE" file too (as you did in your repository). All GPL v3, that should be compatible with CC BY-SA 4.0.

I've added a "fair" request to mention the author if someone uses this material... :)

I think that now it should be sufficient (isn't it...?).

  Are you sure? yes | no

k8lh wrote 07/27/2017 at 23:27 point

Very nice project. 

Can an ATMEGA1284P be used instead of the ATMEGA32A?  If so, are any changes required in the Arduino sketch?

Cheerful regards, Mike

  Are you sure? yes | no

mick wrote 07/28/2017 at 19:13 point

They look very similar to me, apart from the increased memory spaces on the 1284P. Pinouts & operating voltages seem to be the same.  I should think that it would be ok. The Mightycore boot loader supports that chip too. If you've already got one it would definitely be worth a try.

  Are you sure? yes | no

Just4Fun wrote 07/29/2017 at 19:54 point

Hi, yes it is  possible.

An other user (Steve) has successfully used an Atmega644 that it is quite similar to yours (search among the comments). He changed the clock activation code. This is necessary because Atmega644/1284 have some differences in some register naming.

Here the modification he did:

// Initialize CLK @ 4MHz. Z80 clock_freq = (Atmega_clock) / (OCR2 + 1) = (Atmega_clock) / 2
  ASSR &= ~(1 << AS2);
  TCCR2B |= (1 << CS20);
  TCCR2B &= ~((1 << CS21) | (1 << CS22));
  TCCR2A |= (1 << WGM21);
  TCCR2A &= ~(1 << WGM20);
  TCCR2A |= (1 <<  COM2A0);
  TCCR2A &= ~(1 << COM2A1);
  OCR2A = 0;   pinMode(CLK, OUTPUT);

May be that this works in yours case too without others variatons

Let me know...

  Are you sure? yes | no

mick wrote 07/25/2017 at 18:30 point
I think it's one of those things - people find time to play with it when they can. :) That's my position at the moment. Too much stuff all happening at the same time. However, I've also been doing a bit of work on porting Nas-Sys 3 over to make this system look very much like a Nascom 2 running through a tty. Probably not a lot of interest in that (other than for myself!). Is anyone still interested in having somewhere to act as a repository for custom disk images for this project? They aren't very big and I still have quite a bit of spare space on my web site where I could perhaps host them as zip files.

  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