Showing posts with label Z80. Show all posts
Showing posts with label Z80. Show all posts

Friday, April 16, 2021

CP/M 80 in 2021?

Yes, what reason would there be to use CP/M in 2021? The reason could be, because...!

There can be a multitude of reasons why we might be tempted to discover something other than the boring soup we are served all day long, the digital world : in fact 'shits' for everyone, and huge profits for a few!

And why not take ownership of the tool and have it do something else? Obviously, you probably won't be able to use these simple systems for typing your new bestseller, listening to music, send the latest information of your exciting life to the whole earth or watching series. But there might be more things you can do that you can't do with your MAC or PC.

For that, a system must be simple and easy to use while being inexpensive. At the beginnings of the democratization of computing, in the early 80s, one of the flagship microprocessors was the Z80 in normal (2,5MHz) version or 'A' (4MHz) version and the dream version 'B' (6MHz). 

At that time, there was an operating system for this type of processor, the CP/M, called CP/M 80 when a version was developed for the first IBM PC and named CP/M 86, which later became the Microsoft DOS.

At the beginning of the 90s, I had recovered a CP/M 80 machine from a company which had switched to PC/DOS. Unfortunately, I no longer own this machine but this is what it looked like:

Wikipedia

Wikipedia

This type of equipment was sold for around $ 2,000 in the early 1980s, or something like $ 6,000 today. All that for 64K or 128K of RAM, a floppy drive of a few tens of Kbytes and a processor at 2MHz, possibly 4MHz : fantastic!

An operating system offers all the tools necessary to use a computer and, above all, allows a program to be loaded into RAM memory from storage memory and then to be executed, basically. 

The question is: is it still possible to get a CP/M version for Z80 and is it possible to adapt it to a preferably new machine with more capacities?

Good news, the answer is yes! More interesting, there is even a more general system which allows to launch CP/M but not only, and which is compatible with a certain number of systems based on Z80 or Z180 : the RomWBW from Wayne Warthen.

And so .... It only remains to find a hardware on which to implement this system. And precisely, while browsing the distribution of RomBWB I discovered the compatibility provided for a board named 'Easy Z80' designed by Sergey Kiselev :

https://github.com/skiselev/easy_z80

As this project is open source, I therefore made the printed circuit board in several copies and assembled one using components I own. My tests were carried out with a 4MHz oscillator because I do not have Zilog components certified at 10MHz (the CTC & SIO). 


I assumed this should still be fine because the SIO (UART) has its own clock independent of that of the processor. Obviously, if the operating system integrates calibration loops, the times provided will not be correct. But hey, for a first test this should not pose a problem ...

Indeed, it works :


So far I haven't pushed the tests any further. The characteristics of this system are very interesting. It is designed to operate at a frequency of 10MHz. Not even imaginable at the time. Has 512Kb of backed up SRAM of which 384Kb is reserved for drive A. Two serial ports are available as well as an RC2014 compatible expansion port. All for less than $ 100 when assembled.

As a first step, it is an ideal system to get acquainted with CP/M. The only small lack is the absence of inputs / outputs. But this can easily be offered later thanks to the extension port. In development mode it is necessary to connect this system to a terminal or a PC / MAC with terminal emulator. But simple and inexpensive solutions exist to allow the connection of a keyboard and a VGA screen. I intend to test this type of solution soon, which would make this system completely autonomous in the same way as the Color Maximite II.

Saturday, December 5, 2020

uPF--2? In fact, an uPF--1 in FPGA!

A few months ago, I started switching from the uPF--1 compatible kit based on Z80 from Wichit Sirichote to a version fully integrated in an FPGA. Basically, this kit is interesting, but has some shortcomings which make it rather inefficient to use : 


As you can see, this kit uses a keyboard consisting of standard and low-end tactile switches. This certainly allows the product to be offered at a low price, but in fact makes its use very inconvenient.

It is impossible to hit the keys quickly, which makes repetitive operations tedious and therefore does not allow efficient use of this kit. 

For me, the first thing to do was therefore to offer a keyboard with real keys like the Cherry key. But I thought it was a bit 'silly' to integrate this new keyboard to the FPGA board for several reasons. The first is that it would force me to develop a large board with actually few components on it. The second reason is that in fact, this type of keyboard could be used for other kits without having to develop a new version again, for new kits. Also, I developed this:


This is a prototype on which I integrated a connector for real-time debugging. The finalized version will not include this connector but only the 'audio' type connector allowing this keyboard to be connected to the processor board by a serial type link.

Obviously, this way of doing things requires the implementation of a serial link into the FPGA. This does not present a problem, knowing that it is possible to modify the source code of the monitor to integrate this interface. In the end, the whole thing looks like this:


the third reason was to offer a real serial link for file transfer. In fact, on the original kit, the serial link is directly managed by the processor thanks to the use of a bit of an input / output port. Bit detection is performed using timers in the form of code loops. Therefore, even at 2400 bits per second, after a certain number of bytes received, synchronization is lost. The result is that it is not possible to properly load a hex file from a PC to the kit. The received file is systematically corrupted!

Once again I built a real serial ports into the FPGA and modified the monitor to use this new device. It is therefore now possible to load a file at a speed of 38400 bits per second, or 3840 characters per second without problem. I did not push the communication speed any further because the processor still has to handle this flow of byte. On the FPGA board, the serial port will be USB compatible. Because the RS232 standard for this kind of kit is really not practical these days.

Here is a very basic example of sending a message on the display, downloaded then executed on the kit :


Note that the latest version of the source code provided by Wichit Sirichote is incomplete. Some functions do not perform correctly and require rewriting. So I did this work, in addition to that necessary to take into account the new material like serial ports and others... 

I am very satisfied with the result:



And now? It's time to move on to making the FPGA board. In order to work more efficiently with development software, I am in the process of remaking a PC based on a Ryzen 9 3900X processor. My current machine is equipped with an Intel Dual Core E5800 @ 3.2GHz from 2012. A bit outdated today! A good processor in its time but, anyway : bye bye intel ;-)


Monday, October 26, 2020

Retro keyboard.

Iin 2016, Wichit Sirichote created learning kits for different types of microprocessors, including the Z80 : 


This kind of kit is very interesting but suffers from some problems in my opinion. The first of these, and certainly the most important, is the keyboard. The tactile switches used are not suitable for precise, regular and comfortable typing. These are front panel switches, intended to configure a device, but certainly not to serve as an element of 'dialogue' with a computer. 

I'm not even talking about the self-adhesive plastic film where the key symbols are printed. It just makes typing painful : 


So I decided to create a keyboard equipped with real input keys. For this, I start by creating a prototype of what should be the type of keyboard that I will use for my future developments :


After a few days of waiting, I received the printed circuit board and soldered the components that will allow me to perform the programming of the on-board microprocessor :


Why an embedded microprocessor on this keyboard? Because this will allow the development of a keyboard, I hope, adaptable to a large number of materials, without having to recreate it each time.