Hello,
I am making a device that uses a (st9) microcontroller and i have the clock and the data lines attached to some i/0 lines on the microcontroller. The other two lines of a ps/2 mouse are thepower and ground lines and they are hooked to the same 5v power source as my microcontroller. The clock and data lines have weak pullups on them as per the way ps/2 mice and keyboards should be interfaced, so these lines are normally high unless me or the mouse decides to bring them low in the course of generating signals.
My question is this: how can detect if the mouse is attached to my microcontroller since the user could unplug or plug it in at any time?
Since the clock and data lines have pull ups they wont go low when the user unplugs the mouse.
Should i do it by detecting the current the mouse draws when it plugged in? I basically want to make this thing plug and play. But i am guess that since personal computers dont do this after all these years, that is simply is not doable.
I am a bit of a newbie when it comes to elecronics to i might be missing something obvious,
Thanks! ~ Mark