NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » PS/2 Interface - dropping characters

December 21, 2012
by mbrowen
mbrowen's Avatar

I am working with the PS/2 example code. My keyboard is wired as in the example. The code works, but it seems to drop characters if I type rapidly. Am I missing inturrupts or creating too many? Sometimes I get a "?" in place of a character I typed (when typing quickly). I don't know if this is a matter of buffering or if I am overwhelming the Atmega168 with interrupts, which doesn't seem likely to me. I'm trying to understand what would cause this behavior. Any ideas?

December 21, 2012
by pcbolt
pcbolt's Avatar

mbrowen -

The PS/2 protocol is fairly slow (clock at 10 - 20 kHz)compared to SPI which can be 10x faster, so I don't think you are overloading the MCU. One possible cause may be the connections used to attach the keyboard wires to the MCU. Even the breadboard itself can contribute to noise in the system that can corrupt the signal over the data/clock lines. I wired up a PS/2 mouse to the ATmega and the wires were pretty small inside the mouse cable. I ended up wiring the small wires to a terminal block and connecting larger wires between the terminal block and the breadboard. Fortunately I had an oscilloscope to track down the problem.

Post a Reply

Please log in to post a reply.

Did you know that an analog comparator can tell when one voltage input crosses another? Learn more...