I added keyboard and mouse support to BoxLambda. The plan was to use PS/2, but when NAND2Mario announced their usb_hid_host core, I couldn’t resist. I added a Wishbone frontend and some CDC logic to cross from the 12MHz USB clock domain to the 50MHz system clock domain. I plugged in a keyboard and mouse, and it all worked fine. End of story…
Almost. The original usb_hid_host core does not include support for controlling USB keyboard LEDs. Adding that feature required a deep dive into the usb_hid_host implementation and the USB spec. I also needed a way to test it all in simulation, in other words, I needed a USB keyboard and mouse emulator.
Recap
This is a summary of the current state of affairs for BoxLambda. We have:
An Ibex RISC-V core, Wishbone Interconnect, timer, two GPIO ports, UART core, and internal memory.
DDR3 external memory access through the Litex Memory Controller.
OpenOCD-based Debug Access, both on FPGA and Verilator.
VERA-based VGA graphics: 2 layers tile or bitmap mode, 2 banks of 64 sprites, 128KB Video RAM, 256 color palette.
Dual YM2149 PSG Audio.
SD Card Controller and FatFs File System.
... continue reading