Re: Mouse interface stuff - K.O.?...

From: Hársfalvi Levente (
Date: 2000-09-18 18:26:32

Hi Richard!

> I haven't looked into this as much as you, Levente, so forgive me if this
> is completely unhelpful, but: doesn't the fact that the PS/2 mouse uses a
> synchronous protocol clocked by the _host_ machine help? The docs might
> specify a fairly high clock rate, but you can (as far as I am aware)
> change it, and even send pulses at non-regular intervals; the state
> machine in the PS/2 mouse won't know...

The problem is: the data is clocked by the _mouse_ and not the host
machine :-(. As I read the docs, the mouse communicates the same way as
the PS/2 keyboard does, and other docs say the keyboard data stream is
clocked by the keyboard itselves.

This still won't be a problem if I could delay receiving bits, but
unfortunately I can't. The interface is implemented using two lines, clk
and data, and the lines are driven by OC drivers. There is a possibility
in the protocol inhibiting data transfer (by simply pulling the clock
line to low) thus delaying data bytes, but not for bits. If the host
pulls clk low while the keyboard (or the mouse) transmits data, it'll
drop transmitting remaining bits and resend the whole byte as soon as
the host releases that line.

Dealing with such relatively high-speed stream with the PIC is possible,
but unfortunately, the microcontroller has two time-critical tasks to
run at the same time, and neither one is fully predictable. The SID POT
cycle can 'start' anytime, since the SID is not always connected to the
joystick port (it is controlled via the CIA portbits and a 4066). And
one addition is that the 'answer' must be IRQ-driven, because of the
needed cycle-exact timing. The mouse data stream is more friendly at the
first sight, since it can be delayed until a 'safe' receive time, but
unfortunately the bit length is not predictable: it can well be between
30-60 microseconds :-(. I'll have to see it closer again, but it doesn't
seems to be really hopeful...



This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail

Archive generated by hypermail 2.1.1.