Close
0%
0%

LM80C Color Computer

A Z80 homebrew computer with 32KB SRAM & 32KB ROM, TMS9918A VDP (video) and AY-3-8910 PSG (audio)

Similar projects worth following
This is a full working 8-bits computer based on the Z80 processor with BASIC interpreter, TMS9918A for video and AY-3-8910 for sound.

I always desired to build my own 8-bits computers. Back in the '80s I was a Commodore 16 user, and a lot of friends of mine had C64 and MSX computers. They had sprites and sound, I only had 121 colors. Now I want to build my own system, to bridge that gap. 

I looked around, started studying projects of other homebrew enthusiasts and eventually made my choices:

  • CPU: I chose a Zilog Z80 because it has a lot of registers, it has I/O features, it can set the stack anywhere into the RAM, it can handle interrupts in different ways.
  • RAM: 32KB of SRAM. I think that, at the moment, this amount of memory is enough to do some good programming.
  • ROM: 32 KB of EEPROM. I chose an EEPROM chip because I can easily burn my firmware with an Arduino board connected to my computer. Also, 32KB are enough to store a BASIC interpreter and some other stuff.
  • VIDEO: TMS9918A. I wanted a video chip that was able to render a colorful image, with a good image size, easy to interface and that had support for hardware sprites. 
  • AUDIO: AY-3-8910 (or its variant from Yamaha, the YM219F). It features 3 voices with environment and white noise. It also has 2 input/output ports, that were used to read the keyboard or the joystick ports.
  • I/O
    • parallel I/O: a Z80 PIO that, at the moment, only drives some LEDs
    • serial I/O: a Z80 SIO/0, used to interface with a computer through a serial connection (FT232 serial/USB converter)
    • timer/counter: a Z80 CTC used to generate the serial clock and to increment a software timer counter

Why did I choose the Z80? Initially, I chose the Motorola 6809, then the 6502 but both of them had PROs and CONs. The 6502 has very few registers and it doens't support I/O instructions so every peripheral chip must be mapped into RAM, leading to complex address decoding systems. The 6809 is similar to the 6502 but it has some more registers, it has I/O instructions and a lot of addressing modes but it wasn't very used at its time so there aren't a lot of resources available. So I decided to use the Z80, because it's still manufactured by Zilog, it has a lot of peripheral chips specifically made for it (so that it's easy to interface each other), it can use I/O ports, it has a lot of registers, and so on.

The RAM and ROM are at the moment of 32 KB each: I think that this is a good amount of space, both for user programs and for firmware too. Maybe in the future I could implement a system to deactivate the system ROM and add another 32KB SRAM chip, to let the user to load very big programs (the same thing was done by engineers for the C64, where the ROM could be disabled, showing up the underlying RAM).

Video section. I only had few options. I discarded the MOS VIC-II from Commodore because it's very expensive online and it was developed to work with a 65xx processor. I also discarder the 6845 because it was just a video signal generator. I also discarded solutions based on moderm microcontrollers: I could have used an Atmel MCU and program it to geneate a VGA signal but I wanted to use only solutions that were available at that time. So I chose the TMS9918A, that is still available on Ebay at a resonable price, it's easy to interface since it only needs few lines between the CPU and itself and since it can generate an image of 256x192 pixels with 15 colors and 32 sprites.

For the audio section the choise was easy, the AY-3-8910: widely available, easy to interface, good to use as an I/O periphery too, and cheap. There is also the YM2149F: this is (almost) the same chip manufactured by Yamaha under license by GI. So that I could choose the one I was able to find first.

The I/O is the reachest part of the computer. Since Zilog made a lot of peripheral chips and since all of these chips are still in production, you can find parallel & serial interfaces very easily. I decided to add a Z80 PIO (Parallel Input/Output)  to drive 8 LEDs via an ULM2803, then a Z80 SIO (Serial Input/Ouput) to connect the system to my primary...

Read more »

TommyPROM.zip

Schematics and Arduino code to realize the EEPROM programmer used to burn the firmware for the LM80C computer.

Zip Archive - 1.15 MB - 05/01/2019 at 09:23

Download

LM80C.zip

This archive contains both the firmware source and the schematics of the computer at the current stage: PIO, SIO, CTC, TMS9918A fully working

Zip Archive - 203.68 kB - 04/29/2019 at 21:08

Download

  • 1 × Zilog Z80B CPU Possible product code: Zilog Z86C0006PEG (Z80 CPU in CMOS, 6MHz)
  • 1 × Zilog Z80 PIO Possible product code: Zilog Z84C2006PEG (Z80 PIO in CMOS, 6MHz)
  • 1 × Zilog Z80 SIO/0 Possible product code: Zilog Z80C4006PEC (Z80 SIO/0 in CMOS, 6MHz)
  • 1 × Zilog Z80 CTC Possible product code: Zilog Z84C3006PEG (Z80 CTC in CMOS, 6MHz)
  • 1 × GI AY-3-8910 or Yamaha YM2149F

View all 9 components

  • New firmware R3.4

    Leonardo Miliani03/29/2020 at 16:19 0 comments

    Another firmware release for the LM80C Color Computer. The new R3.4 introduces several changes:

    • Removed POINT and SET statements and their legacies: continues the deletetion of old, useless, statements;
    • changed default colors for screens 1 & 4: new color theme, with light blue for border, white for background and black for text. This is done to differentiate a bit the LM80C from other TMS9918-based computers;
    • enhancements on serial communication: now a buffer overrun of the SIO won't freeze the system anymore, but leads to a break in serial operation and a block of RX/TX functionalities while the line still continues to be open; with SERIAL 1,1 we can re-activates the serial functionalities;
    • fixed TAB behaviour: now, it moves the cursor to the correct column.

    Download it now at https://github.com/leomil72/LM80C.

  • New firmware R3.3

    Leonardo Miliani03/15/2020 at 10:22 0 comments

    Another minor update for the LM80C firmware. The new release R3.3 includes code cleaning and improvements for LIST command: now line intervals can be passed as arguments to list the whole program, just a single line or only portions of the code.

    It can, as usual, downloaded here: https://github.com/leomil72/LM80C

  • New firmware R3.2

    Leonardo Miliani03/09/2020 at 17:37 0 comments

    Another release for the LM80C firmware: version 3.2 is out now! Some code cleaning and one major adding: now the SCREEN statement gets 2 additional arguments to set the sprite size & magnification. In addition, I’ve fixed a little bug in the cold/warm reset routine that lead the system to keep into the input buffer the key pressed so that the first input walways generated a “syntax error”.

    Enjoy the new firmware:

    https://github.com/leomil72/LM80C

  • New firmware release R3.1

    Leonardo Miliani03/04/2020 at 18:00 0 comments

    Another update of the firmware for the LM80C Color Computer! This release introduces the new XOR statement, to complete the offer of boolean operators integrated into the LM80C BASIC (AND, OR, NOT), it fixes a bug discovered into the SERIAL statement (any char sent to serial was converted to $01), it sees the removal of NULL statement (an obsolete legacy from old terminal times) and the adding of date & time of compilation into the ROM file.

    https://github.com/leomil72/LM80C

  • New major firmware release R3.0

    Leonardo Miliani02/28/2020 at 17:20 0 comments

    Hello everybody, I carried on the development of the firmware of my LM80C Color Computer and I'm happy to announce the availability of a new major release, the version R3.0.

    With this release the computer is now a stand-alone in every way: it is now possible to move the cursor anywhere around the screen and digit commands and statements freely. When you'll press the RETURN key the kernel will analyze the on-screen text, acting as the old home computers from the '80s.

    Another big change is the SERIAL statement, introduced with the version R2.15 of the firmware, that let the user to open/close the serial line.

    Here is a little demo of the new functionalities:

    Please refer to my Github repo to get the new sources and ROM file:
    https://github.com/leomil72/LM80C

  • New firmware release R2.13

    Leonardo Miliani01/27/2020 at 21:41 0 comments

    Another new release for the LM80C firmware, this time with version R2.13:

    - code improvements

    - faster cursor flashing

    - complete support to ALT & CTRL keys to print graphics chars on the screen

  • Firmware R2.10 released

    Leonardo Miliani12/26/2019 at 17:51 0 comments

    New firmware R2.10 released. 

    Changes: 

    • SIO init code cleaning & improved support for serial RX;
    • added extended char codes (128-255) for 6x8 fonts;
    • removed double chars in 8x8 fonts

    Available as usual on my GitHub repo:

    https://github.com/leomil72/LM80C

  • Cursor now can be moved anywhere

    Leonardo Miliani12/23/2019 at 16:31 0 comments

    Added support for cursor keys so that now I'm able to move the cursor anywhere on the screen


  • New firmware R.2.8.2

    Leonardo Miliani12/15/2019 at 16:55 0 comments

    New release R2.8.2: fixed a bug caused by changes introduces with previous R2.8.1 that lead to wrong functioning of several BASIC statements (LOCATE, VOLUME, etc..), keyboard input, system tick counter, and other.

    Get the latest firmware from here:

    https://github.com/leomil72/LM80C

  • Interfacing with an external keyboard

    Leonardo Miliani12/08/2019 at 17:48 0 comments

    Typing on a C16 keyboard and getting input on my LM80C… Today I’ve also implemented the SHIFT key, so that now I can input a program directly in a stand-alone configuration without the need of a remote PC anymore. At the moment the SHIFT key is the only special key that is implemented, because I needed to input chars like double quotes, parentheses, and other chars. The next control key to be implemented will be the… CTRL. And then the C= that will be used as an ALT key, to get graphic chars.

View all 23 project logs

  • 1
    Z80 chips

    Choose CMOS versions of the Z80 family chips: they usually have a "C" in the middle of the produc's code, i.e. Z84C006PEG for the Z80 CPU.

    Also, choose 4MHz- or, better, 6MHz-compliant chips. You can see the different models by looking at the last number of the product's code, i.e. Z84C006PEG is 6MHz tolerant.

  • 2
    74HCTxx family

    Choose chips of the 74HCTxx family. The "HCT" indicates a type of circuitry that is 74LS-compatible (the "LS" series was the original 74 family). The chips of the HCT series are compatible with the LS ones, because they have the same logic levels (despite the HC series, that don't). Since the LS series is difficult to find, I suggest to use chips of the HCT series.

  • 3
    TMS9918 Vs. TMS9918A

    Pay attention when you buy the video chip. The "A" letter at the far right of the name of the chip indicates a newer variant of the chip that Texas Instruments released to add support for bitmap graphics. The TMS9918 only supports graphics 1 (tiles) mode, text mode and muticolor mode, while TMS9918A adds the bitmap support, in graphics 2. 

View all 4 instructions

Enjoy this project?

Share

Discussions

Leonardo Miliani wrote 02/28/2020 at 17:10 point

Hello. To draw the schematics I used a lib with footprints and symbols for the Z80 peripherals, VPD, PSG, and other ICs partially developed by me, so I would have to release both schematics and lib, but to do this I have to make some order in the files. Please keep patience, I think that I will release them soon.... I hope...

  Are you sure? yes | no

bmxpie wrote 02/20/2020 at 22:01 point

Ciao Leonardo,

molto interessante il tuo progetto LM80C, ma...è troppo avere gli schemi su files per Kicad?

Grazie,

Massimo.

  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