CE 433 Embedded Devices

HW9: USB
Name: Lucien Verrone
Email: ljverrone@fortlewis.edu

Introduction:

This assignment required working with a USB keyboard as an input for the FPGA board.

Task 1:

Task one was to implement a program that reflects USB keyboard inputs on corisponding LEDs. The first eight bits (MSB) are the scancode from the USB keyboard, and the last eight bits (LSB) are toggled when the corisponding key is pressed on the USB keyboard.

Figure 1: USB to LED code.

Figure 2: USB to LED demonstration.

Task 2:

Task two was to modify the code in task one to display the input from the USB keboard as an ASCII character on a connected serial monitor using the UART protocol. A glitch was encountered where the last rather than the current value of the input key is output to the monitor rather than the current one.

Figure 3: USB to serial monitor code.

Figure 4: USB to serial monitor demonstration.

Discussion:

This assignment was a good introduction to the USB protocol, and it fit well with the ASCII work completed in the UART protocol homework. I think everything went relatively smoothly, however I am frustrated I wasn't able to figure out why the last key is output rather than the current one or how to fix it. I think a delay between the transmission of the USB input to the UART protocol and the trasmission of the ASCII code to serial monitor to allow time for the data to be both read and sent by the UART module could help with this, but I wasn't sure how to implement it. I attempted moving the assigning of uartData to a different state in the top module, but this resulted in double values being output along with the delay problem stated above..