View Single Post
Old 15th Apr 2013, 6:42 pm   #14
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,586
Default Re: ZX Spectrum AMX mouse comms format?

Quote:
Originally Posted by ajs_derby View Post

For extra hacker cred points, use a PIC microcontroller to talk to a modern PS/2 or USB mouse (a USB mouse may be able to speak PS/2 if it decides it is not plugged into a proper USB port, even if no adaptor was supplied with it; they probably all use the same ICs internally) and output the same XA, XB, YA and YB signals as an original AMX mouse!
I've already written some rough PIC 'C' code to receive keycodes from a PS/2 keyboard - they are so cheap now that it makes sense to use one for any microcontroller project that needs more than a few buttons for input. I never got around to finding out exactly how a PS/2 mouse speaks to the PC, although I would be surprised if the general format is not exactly the same as is used by the keyboard.

USB, aggh, you must be joking. I'm staying away from that for as long as I possibly can, but I agree that many USB keyboards and mice can talk to PS/2 ports on PCs when connected only via a simple physical converter with no form of interface or intelligence in it, so they must have a PS/2 'fallback' mode.

If I did involve a microcontroller then it would make sense to replace the PIO with that and use it to mimic the behaviour of the Z80-PIO on the Spectrum bus. I believe some of the larger PICs do have a special 'parallel peripheral' mode, typically on PORT D, which enables the PIC to be connected directly to an 8-bit microprocessor system bus and to appear to be a dedicated peripheral IC complete with read / write / chip enable pins, etc. It's up to the person programming the PIC to decide what it will do when the host system accesses it.
SiriusHardware is online now