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