Jump to content
  • 0

How do I stop Basys 3 from sending keyboard commands


name9006

Question

Hi,

I am trying to use a keyboard with my basys 3. I am able to get the demo program up and running and displaying keycodes to a putty terminal on my pc. The problem is the fpga seems to recognize as soon as the keyboard is not sending data and then fpga goes into some idle state (for example, the "busy" led next to the USB port slowly turns on and off). If I try to press another key on the keyboard then the keyboard freezes for a second then sends code 0xAA, the self-test response. My understanding is that this means the fpga issues an FF reset command to the keyboard each time and has to wait for the keyboard to respond.

I have read every square inch of the documentation Digilent has and cannot understand how to prevent this. There is a sentence in the keyboard section that states "(if the host device will not send data to the keyboard, then the host can use input-only ports)" however I cannot find information on how commands are sent TO the keyboard; they only list what those commands are.

Has anyone worked with a keyboard before and have some wisdom to share? How can I stop the fpga from sending commands to the keyboard and how does sending commands to the keyboard work in the first place? Is it even possible to stop this behavior or is the PS/2 converter in the basys 3 hardwired to send commands to the keyboard without your explicit instruction for it to do so?

Reference to digilent basys documentation: https://digilent.com/reference/programmable-logic/basys-3/reference-manual

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @name9006

There's a PIC24 microcontroller on the board that handles the USB interface to the keyboard and emulates a PS/2 interface for the FPGA. There is communication that can occur with keyboards or other devices outside of just the commands sent by the FPGA. It reaches out to identify USB devices and handles communication over USB. Also, the PIC24 firmware source code is closed source.

The statement in the manual about input-only ports refers to the FPGA design / Vivado project. Either tri-state inout ports can be used, which would allow the FPGA to send commands to the device - like to set a caps lock LED or to request a mouse position - or input ports can be used if this is not necessary. It's not relevant for whether the demo is working on your board though - the demo uses input-only ports and does not implement any features that would require sending commands back.

Does the same behavior appear with other keyboards? Functionality may depend on the keyboard used. For example, if a keyboard included an integrated USB hub, it would be unlikely to be detected by the PIC24 in the first place, due to lack of hub support in firmware. I've personally had success using a Logitech K120, but not with a Varmilo VA108M. There's more information in this thread about the Nexys A7, which features the same style of microcontroller to handle the USB HID interface:

Thanks,

Arthur

Link to comment
Share on other sites

  • 0

Hey @artvvb

I first tried with a Varmilo VA87M and couldnt get any data to come out of the keyboard. I tried with a DK-3188B (not sure of the brand) and was able to get keycodes when pressing keys but ran into that issue where the board would go idle then return AA on next press, freezing input during that self-test period. I just now tried an HP KU-1469 and it seems to be working as expected. My theory is that most keyboards have a micro controller in them that the fpga does not get along with very well. 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...