Andy4495 / USB_Host_ASCII_Keyboard

Converts USB keyboard into plain ASCII over Arduino Serial port using USB Host Shield.
Other
0 stars 0 forks source link
arduino ascii ascii-keyboard max3241 max3241e retro-computing usb-host

USB Host ASCII Keyboard

Arduino Compile Sketches Check Markdown Links

This sketch implements a simple USB to ASCII keyboard translator for use with a USB Host Shield for Arduino. It uses Serial.print() to output the ASCII character of the key pressed on the keyboard. ASCII control characters are also supported (e.g. [CTRL]-M prints ASCII 0x0D -- carriage return).

This setup can be useful for interfacing with retro computer builds that do not support USB.

The sketch has been tested on keyboards with and without built-in USB hubs.

Optional LED

An LED/Resistor combo can be connected to the Host Shield output pin 7 and GND to indicate that a Keyboard is connected and running. Note that this is using the GPIO available on the MAX3421E chip, not the Arduino I/O.

Host Shield Hardware

I used this generic shield from Amazon, along with a SparkFun RedBoard.

However, any shield based on the MAX3421E chip along with an Uno-type Arduino should work with this sketch.

For the specific shield that I used, a few hardware configuration changes are necessary to function properly:

If attempting to use an Arduino Pro instead of an UNO, note that a separate 3.3V regulator is needed, since the Pro does not provide 3.3V power. In additon, the 3.3V "Power Select" pad should be left open (otherwise the Pro will supply 5V to the 3.3V logic on the shield.

References

License

The sketch USB_Host_ASCII_Keyboard.ino is released under the GPL-2.0 license, as is the sketch it is based off of.

The other files in this repository are released under what is commonly called the MIT License.

See the file LICENSE.txt in this repository.