I've built myself an arduino-based PS2 keyboard -> USB keyboard converter (that also switches some keys around). I'm ironing out the last few kinks. I've got a SparkFun Pro-Micro (ATmega 32U4@5v+16MHz) wired directly to the PS2's Data&Clock pins with the sole source of power being the host computer (attached via USB).
Very occasionally, usually after I've left the computer completely alone for a while, when I wake the computer up (e.g. with the mouse), I see an event that I'm pretty sure is the PS2 clock pin flip-flopping just once (or maybe twice; not quite sure). In any event, the PS2 interrupt fires, but it's not followed-up by the rest of the protocol, it's just a glitch.
It happens so rarely I can't claim to have solid data. Sometimes I know the host computer was asleep and the phantom blip happened right as the host machine woke up. This has happened on two different workstation class computers with quality power supplies. The keyboard didn't lose any settings, so it wasn't a full loss of power. There have been times when it's happened when I don't think the host was actually asleep, but the monitors were black, so I think a power issue could still be in play here as the video card would have suddenly sprung back into gear.
My questions are these:
- Do you agree with me that the likely cause is a power-dip on the USB 5v line as the computer comes back from sleep?
- It seems to me like slapping a capacitor across power/ground might help. Are there guidelines about how to craft such a circuit to best effect?
Or am I completely off-base here? Is there something in the USB protocol that could be the cause of this? Something on the Arduino (I've got a SparkFun Pro Micro, ATmega 32U4 5v 16MHz).
Thanks!