Wednesday, May 12, 2021

µPF--2, a µPF--1 clone.

Since a few months, I have been in the process of recreating the well-known µPF--1 microprocessor kit :

Wilipedia.
In fact, this kit has already been recreated, by Wichit Sirichote with the addition of downloading binary files from a PC via a serial interface. 


This solution, more modern than the original kit seems perfect, except that it has some drawbacks and a small operating problem. First, the serial interface comes in the form of a Standard RS232C interface. It would have been really more interesting to offer a serial interface via a USB port. This would have greatly facilitated the use of this kit. On the other hand, the fact that it is the Z80 processor which fully manages the serial interface, the maximum throughput remains very low, at around 1200 Bauds and receives erroneous characters randomly. Downloading even small files takes too long and is unreliable.

Also, I decided to redevelop this kit by offering a much more efficient USB hardware serial interface. I added a serial interface for an external keyboard. The original Wichit Sirichote keyboard being totally unusable. The switches used are not intended for this type of use.

I also added some possibilities and modified the software system accordingly. This allowed me to recreate the kit on a standard FPGA board:

This new system works very well, but on the one hand the FPGA board used is generic and not really suitable for the intended use. This FPGA board also does not offer a USB serial port and the expansion port is not suitable for setting up Z80 type extensions.

So I decided to recreate a system based on an FPGA. After several attempts and configurations considered, I arrived at this system:


Implementing an FPGA is a bit tricky, so I went with a pre-made FPGA board. Going through this type of configuration removes some of the implementation difficulties, and as a bonus, allows me to offer a more 'powerful' FPGA than the circuit originally planned.

The result remains compact and suitable for intensive use. Note also that this system can be used for something completely different than the recreation of the µPF--1 kit since it has 5V compatible serial and parallel inputs / outputs, a 2x16 LCD display in addition to the eight 7-segment displays.

After shipping the design files, I received the printed circuit board. The first thing I did was to see if the FPGA module can be correctly inserted:


Once this check was done I was able to start mounting partially the system. I started by mounting the power parts and checked the absence of 'magic smoke':


Fine! And the USB / serial interface circuit is correctly detected by the system, Win10 in my case.

I was able to continue mounting the board by installing all the components necessary for a first start of the system, i.e. the eight 7-segment displays and the LCD display as well as the interface circuit which will be used to receive the information from the external keyboard:


The FPGA module starts up correctly, The small example which makes the D5 LED flash works. The LEDs and the 7-segment displays are slightly lit which is normal given that all the I / O not used of the FPGA are positioned as inputs with low PULL-UP when it starts up.

It now remains to adapt the code of the FPGA previously developed to this new board.



Friday, May 7, 2021

Easy Z80: A very cool Z80 CP/M SBC

Since my last post about this Easy Z80 board, I installed the integrated circuits in 10MHz version. And that changes everything. At this frequency of 10 MHz, the system is very responsive and becomes very pleasant to use.

Hum... The first time I order a Zilog 10MHz CPU, SIO and CTC directly from Mouser. Brand new and all manufactured in 2020! My first contact with the Z80 was in 1987 with the µPF1+. Wow! And now, 34 years later, a real CP / M system version 2.2:


In summary, this system has a read-only storage unit including the CP / M system plus some necessary utilities. 384K writable storage space is available for downloading external applications. In addition, two communication ports are available in the 115200 Bauds version. 

Note that the RAM storage space is backed up by an external battery. The system has an extension bus but unfortunately no I / O port. It's a bit regrettable. So how to test this system?

So I decided to check if I could create the same type of app that I created earlier using a Color Maximite 2 board. This consisted in using the temperature sensor of the expansion board that I created for the Colour Maximite 2 and sending the information to a French Minitel:


It works perfectly with the Coulour Maximite 2. As the Easy Z80 board does not have an I / O port, I therefore decided to recover the temperature from Maximite and send it to the Minitel using Easy Z80. Obviously, this application may seem 'without interest', except that it allows to implement the entire development chain around CP / M.

The development system used is the Z88dk kit : https://github.com/z88dk/z88dk
Nothing more than this kit is necessary except a little knowledge of C and assembly language.

The principle of the application consists in sending the home page from the Easy Z80 SRAM disk to the Minitel, then retrieving the temperature via the serial link coming from the Maximite 2, and sending this information to the Minitel.

The only difficulty of this project is to use the second communication port of Easy Z80 in configuration 1200, E, 7, 1. This is not particularly obvious because the system is designed to operate from at 115200 Bauds. Fortunately, it is planned to be able to use the CTC present on Easy Z80 to generate the clock to the UARTS.

It is therefore necessary to connect the output of channel 2 of the CTC to the channel 2 clock of the SIO. This connection is available on the printed circuit board. It is enough to connect it with a small soldered wire after having cut the original connection.

Once this intervention is done, it is necessary to write a few lines of assembler to configure the CTC and the SIO. Do not forget to remove the RS232 converter U8 from the board because Minitel uses TTL signals.

Finally, the source code is simple and easy to understand:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Ressources :
//
// https://www.seasip.info/Cpm/bdos.html
// https://github.com/wwarthen/RomWBW
// https://github.com/z88dk/z88dk/wiki/Platform---CPM
// http://www.z80.info/zip/um0081.pdf
// https://pila.fr/wordpress/?p=361
// https://www.goto10.fr/minitel/specifications/stum1b.pdf
//
// Compilation : zcc +cpm -lm -o main.com main.c
//
#include <stdio.h>
int main()
{
FILE *fp;
int Data;
unsigned char Index, Misc ;
   
	// Start application
	printf("Starting the Minitel application\n"); 
	// Configure the SIO chanel B for 7, E, 1 & NOT CTS ctrl
	#asm
		PUSH AF
		LD A, 0x33	; PTR WR3
		OUT(0x83), A	; ACESS WR3
		LD A, 0x41	; 7 bits RX, NO CTS, RX enable
		OUT(0x83), A	; WRITE WR3	
		LD A, 0x34	; PTR WR4
		OUT(0x83), A	; ACESS WR4
		LD A, 0x47	; E parity, 1 stop
		OUT(0x83), A	; WRITE WR4
		LD A, 0x35	; PTR WR5
		OUT(0x83), A	; ACESS WR5
		LD A, 0x28	; 7 bits TX
		OUT(0x83), A	; WRITE WR5
		POP AF
	#endasm
	// Configure the Com port n#2 baudrate (CTC) at 1200 for the Minitel
	#asm
		PUSH AF
		LD A, 0x47	; Counter mode
		OUT(0x89), A	; Control Word
		LD A, 0x60	; Counter value for 1200 bauds
		OUT(0x89), A	; Counter Word
		POP AF
	#endasm
	// Opening the Minitel Home page
	fp = fopen("Home.dat", "r");
	if (fp == NULL) {
		printf("Error opening Home.dat");
	return 0; }
	// Send the Home page to the Minitel
	Data = fgetc(fp);
	while ( Data != EOF ) {
		bdos(4, Data );
		Data = fgetc(fp); }
	// Infinite loop
	while (1) {
		// Print the 3 char for the display coordinate + 
		// the 5 char from the Colour Maximite II temperature
		// formatted as : 12.55
		// So, 8 char to relay
		for ( Index = 8; Index; Index-- ) {
			Data = bdos(3, Misc);
			bdos(4, Data ); } }
	// Close the Home page file	
	fclose(fp);
	// End main
    return 0;
}

Note also that CP / M offers 'services' in the form of a generic call by providing some information. This interface is provided in the form of the 'bdos ()' function and is used here to communicate with the communication port # 2.

And the result:


Conclusion: this CP / M board is really very pleasant to use and program with the Z88dk kit. It has an RC2014 type connector for the connection of various extensions. It could be interesting to install a PPI8255 or a Zilog PIO there.

RESSOURCES :




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.

Friday, March 26, 2021

Omega computer : USB keyboard interface.

A few weeks ago, I talked about Sergey Kiselev's MSX2 compatible processor board project. I have completed the assembly of a copy of this board. I like a lot the style of the result:

Personal picture.

I equipped this board with the system, also MSX compatible, C-BIOS ver 0.29. The whole system works perfectly.

Personal picture

But, for the moment, I do not have a keyboard or cartridge to interact with the machine. Given the cost of building this type of material that uses original components, I decided to test the adaptation of a standard USB type keyboard instead.

I have therefore developed a small circuit which will take place in the keyboard connector of the Omega board and will directly provide an input for a USB keyboard:

Personal picture

The finished prototype should look like this:

Personal picture

I must also plan to use a ROM or FLASH cartridge in order to test some software applications. The MSX environment is increasingly dynamic. New games continue to be produced. 2021 looks promising! 

I have some ideas to try to improve the performance of this type of material ...





Wednesday, February 3, 2021

RETROCOMPUTING & MSX2

 Assembly of an MSX2 compatible computer based on an original work by Sergey Kiselev.

github.com/skiselev/omega/blob/master/

The small problem is that making such a printed circuit individually is not profitable. Generally having 5 copies made, as I did, doesn't cost much more and it's certainly less 'stupid' in terms of transport.

So here I am with 5 circuit boards on the desk from the Omega computer motherboard:


And of course a big box full of components to be placed and soldered by hand :


Obviously, this requires a certain financial and time investment to make these motherboards. Spending all that time for a single bord wouldn't have been really interesting. 

If all goes well with the build, maybe I'll save two boards for myself. It will therefore remain available for enthusiasts who would like to discover this type of computer.

Compared to the new FPGA versions, these boards offer real cartridge ports. They are therefore easier to use. It is also possible to make your own vintage style extension cartridges!

I report that games continue to be released for these platforms...


Sunday, January 31, 2021

The inevitable MC68000 Single Board Computer

Since the mid-1980s and the announcement of the Sinclair QL, which 'never happened', I have always been interested in the Motorola 68000. My means did not allow me to buy a Mac, but I could have buy a QL. In short...


OldComputers.net

 And then the time passed and I got down to the PC. So I never owned, either, atari of the ST range :

Wikipédia

Then the years passed again and in the early 2000s, I decided to develop my own 68000 board. Nothing very complicated. A 68000, RAM, ROM, real time clock, LCD display and serial port plus a small extension connector. Which gives this schematic: 



This schematic has some small errors, especially on the side of the MC68B50 serial converter. However, nothing serious since once corrected on the board, the system worked fairly quickly.

The PCB : 


Originally, this board was designed to operate at 10MHz. Once the operation was validated, I have not touched this system since 2004. It has now been over 15 years. 

Since a few months, I decided to take up the subject of processor boards. This is the reason of this blog dedicated to retro-computing, with current technology.

Fortunately, I kept all of the project files. In addition, all the logic of the board is contained in a PLD so that it is possible to modify the behavior of the system. 

Wen I wanted to put this board back into service, I noticed that it no longer included the 10MHz oscillator. 

Impossible to find him. On the other hand I had a version of 16MHz. So I looked to see if it was possible to adapt the board to this new frequency.

As I am using EPROM emulators with very short access time, I have not changed the DTACK delay. I only modified the generation of the Baud Rate and took the opportunity to go from 9600 baud to 19200 baud. 

At 16MHz, the clock speed is a little too fast for the 68B50 which is given for 1.5MHZ. Well, 1.6MHz should pass. 

And here we are!



I was able to reprogram without difficulty the circuit EPM128SLC84-15 with version 13.01 of Quartus II. I short, the programmable circuit diagram with Quartus :




By resuming the study of this circuit, I noticed with surprise that I had used the graphics method plus the Verilog coding. I don't use these methods at all today. I go exclusively through VHDL coding. 

Anyway the modification of the source code took me only a few minutes, programming of the CPLD included. 

The modification of this system was also an opportunity for me to test the new Momik ROM emulators :

(Fee advertising)

This emulator can emulate up to 27C040 type EPROMs. Originally this board was intended to work with AT29C040A type Flashes. I had to accommodate the differences between these two types of circuits. 

The result is that this system works great at 16MHz with two of these EPROM emulators. After successfully restarting this board using the two Momik EPROM emulators, I programmed two FLASH AT29C040A for fully autonomous operation this time. 

In fact, this is the first time this microcomputer has operated in this way. I had never inserted a real AT29C040A until now : 



Despite the fact that the 68000 used is a 12MHz version and that with a frequency of 16MHz, the serial converter is also slightly over clocked, everything works perfectly. I am satisfied with the result. And the hours spent studying this system at the time are not wasted!


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 ;-)