Close

Testing the keyboard

A project log for Evaluation board shield for Tang Nano 9k FPGA

The extension board with switches, buttons, leds, VGA output and general interfaces.

pavelPavel 3 days ago0 Comments

Here is just a video of keyboard test.

For each button pressed, an individual LED on the row on the left lights up.

------

During testing the works of keyboard, several issues were found - one was that press on one button would be registered as press to it and simultaneously to the one to the left of it, or as it was on the second row, the press was registered on adjacent button instead of one pressed. This turned out to be caused by RC delays due to non-negligible resistance of the buttons, and fairly low resulting current of scan sequence. Adding delay around a microsecond between asserting row address and readin column values remedied the problem. 

The second issue was that bottom two rows almost didn't worked at all, except of one button which was working intermittently. The problem turned out to be residing on Tang Nano 9k FPGA board itself, as these lines were connected to pins shared with HDMI output. Those had capacitors connected, and were too slow to respond to changing inputs. To solve the problem, a modification of the FPGA board had to be performed.

------
There are 8 pins used for scanning 16 buttons in keyboard, 4 address rows, and other 4 address columns, press on each button makes path between one pin from first group and one from the second group conductive. The contacts on keypresses are not shorts, but have resistances close to 1 kOhm (less when button pressed firmly, more when lightly).

Here is closeup on keyboard pins:

As one can see, there is actually 10 pins instead of 8, but this is due to manufacturer made additional holes in PCB that are not connected to anything. Thus, the pins on the edges are just providing some additional structural support, and have no electrical connections.

------

Verilog description of the keyboard controller is added to files section of the project.

Discussions