Menu

Keyboard Interface

Nick Metcalfe

The keyboard interface should be able to use any PC/AT style keyboard (not USB) for input. The interface is fully bi-directional allowing control over the keyboard by the Mega 80. This is used to set the keyboard LEDs to reflect the state of the lock keys.

The keyboard interface software runs synchronized within the video framebuffer ISR and checks the keyboard four times per scanline. Captured scancodes are placed in a 32 level circular buffer. If user code is checking the application-side key input routines they retrieve the scancodes from the buffer and translate them to ASCII before returning the final keypress to the application.

It is worth noting the current consumption of the keyboard as it is easily overlooked and some early models can consume 300mA or more. In a low-power or battery-operated system this can be wasteful and could easily overstress a 78L05 or equivalent 5v power supply regulator.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.