A PS2 Keyboard Input FPGA Code with an LCD Output Display.
This
circuit example extends the capability of our previously described
V2 PS2 Keyboard input port. Here we
display the PS2 pressed key directly on a 1602 LCD display. You should look at
theV2 LCD Display FPGA
code before going further.
There are no hardware changes to the board if you already have the PS2 keyboard
port and 1602 LCD installed and working.
Interfacing the PS2 module to the LCD display module is very simple.
Here is a picture of the code in action.
This circuit is one of the components of the
FPGA Board Shield #1 board.
Here is the core FPGA code.
A few things to keep in mind. First remember that the 1602 LCD display
first needs to be initialized by sending it a few data bytes before it is
operational. We do this with its "RS"
pin low. Sending each byte by pulsing its "EN"
pin. These signals come across on the
LCD_INIT_DATA_BUS[7..0]
and arrive on the actual LCD pins through the 2:1 MUXs, the
MUX_Switch
being HIGH. When the initialization is done the
MUX_Switch
goes from high to low. The data then going to the LCD display comes from
the PS2 keyboard via
KB_DATA_OUT[6..0].
It's quite impressive that with a few simple diagrams and a few wires how
sophisticated a circuit one can draw with these FPGAs!
To do this is 74LSxxx hardware with or without a CPU would take a far larger
effort.
Again this is a very simple example of using our Cyclone IV to interface a PS2
keyboard with a LCD display.
Please study the files below to understand completely what is going on.
Bugs
There is a minor bug in the program in that if you reinitilize the LCD display
(ie. upload the code again) without a power down the LCD display gets confused.
(More code needs to be added to reset the LCD upon reset).
PS2_LCD.ZIP
(V1.0 10/18/2018)
This page was last modified on
03/24/2019