Close

Extra PCBs / Improved Keyboard Controller

A project log for Flounder Z180 Computer

Standalone single-board computer based on the Zilog Z180 CPU

colin-maykishColin Maykish 11/08/2022 at 03:100 Comments

Two quick things today:

I realized the PCB manufacturer actually sent me six PCBs instead of five. I've fully built up two, but I really don't need the others. If anyone is interested in assembling a board, I'd be happy to send you one. Let me know in a PM.

My first big update since the end of the Retro Challenge was to improve the PS/2 keyboard handling on both the CPLD and in the firmware. On the CPLD side, the scan code state machine now provides a way for the CPU to acknowledge receipt of the code. The CPU can poll a register to check for a key press and then write back to another register to clear the buffer once it has read the key value. This bit of back-and-forth makes it a lot easier to manage the state on the firmware side. The CPU will poll for non-0 key values and when it reads one, it writes the acknowledgment byte and the buffer value goes back to 0.

PS/2 scan codes come in with a "make" byte which is effective a key-down event, and a "break" byte which is always 0xF0 followed by the key-down byte again. The monitor firmware code can now handle this. It reads single key values and repeated (key held down) values and it can deal with out of order make and break bytes for multiple keys.

The serial monitor program had its serial input replaced with the PS/2 controller and its output replaced with the LCD display. The  monitor is now fully functional without being tethered to a PC via serial port. The monitor features are still fairly limited, but my next goal is to write a driver for the CH376S USB module and this will allow me to load programs from USB.

It might be cool to add a simple assembler or interpreter so Flounder is fully programmable in addition to being able to load pre-compiled programs.

Discussions