UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 26th Sep 2011, 11:19 pm   #1
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default ZX Spectrum AMX mouse comms format?

This query seems obscure even to me, but I've been amazed by some of the detailed responses I've seen to other unimaginably obscure queries on these forums, so here goes:

Once upon a time, AMX made a mouse peripheral for the ZX Spectrum called the 'AMX mouse' - I'd like to make one of these, or a modern circuit which exactly emulates one, and I've got the diagram for the original interface (which used a Z80-PIO), but not for the mouse itself.

One surprise (to me) is that the interface does not contain any intelligence or eprom, so the onus was upon the supporting software (software such as the 'OCP Art Studio') to do all the reading / polling / interpretation / interrupt handling.

The sketchy information I have says that the AMX mouse communicated via IM2 (interrupt mode 2) interrupts, (ie, whenever there was a mouse movement it caused an IM2 interrupt) and that the value placed on the data bus at the time conveyed the mouse movement vectors.

The three mouse buttons appear to have their own I/O mapped circuitry done in a similar way to some joystick interfaces of the time - this circuitry is independent of the PIO, which only uses ASTB and PA0 of port A to handle the X axis and BSTB and PB0 of port B to handle the mouse Y axis. The other PIO port pins are used to support a parallel printer port and / or general I/O.

From the terminology used for the mouse signals (XA, XB, YA, YB) it sounds like an unmodified Amiga or ST mouse could possibly be pressed into service with the original interface circuit - (except that those mice only have two buttons).

The alternative would be to use a microprocessor to interface a PC serial or PS2 mouse to the Spectrum, but then I'd need information about the traffic which originally passed between the PIO and the Spectrum in order to emulate it.

Has anyone done this already?
SiriusHardware is online now  
Old 27th Sep 2011, 2:23 am   #2
julie_m
Dekatron
 
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
Default Re: ZX Spectrum AMX mouse comms format?

The AMX mouse for the BBC plugged into the User Port, and used the computer to process the raw signals from the opto-sensors. The outputs were X direction, X step, Y direction and Y step. Each step caused an interrupt and depending on the direction at the moment, increased or decreased a count.

The ZX Spectrum version almost certainly uses a very similar arrangement, with an I/O port for reading the sensors.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments.
julie_m is offline  
Old 27th Sep 2011, 8:52 am   #3
cmjones01
Nonode
 
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,669
Default Re: ZX Spectrum AMX mouse comms format?

A quick look at the Z80-PIO data sheet:
http://www.datasheetcatalog.org/data.../285929_DS.pdf
shows that it's capable of working in a similar way to the 6522 PIA in the BBC Micro, which the Beeb's AMX mouse depended on, as AJS says. Of the two quadrature signals from each axis's shaft encoder, one acts as 'step' and the other as 'direction'. If you get them the wrong way round, the movement is just reversed.

To wire up an Amiga or ST mouse, or even a BBC AMX mouse, you'd have to connect XA to nASTB, XB to PA0, YA to nBSTB, YB to PB0. If the movements are wrong way round, swap XA/XB and YA/YB. The relevant signals are available inside any PC 3-button mouse - just ignore the controller chip and take them straight from the shaft encoders.

Implementing the interface is probably easiest with an actual Z80-PIO, if you can find one, though emulating enough of it in programmable logic would be an interesting project. I had a quick look at opencores.org to see if there was a Z80-PIO core but couldn't see one. There might be one for the more common 8255, which seems pretty similar to the Z80-PIO and could be used as a starting point, but it might be quicker just to implement the bare minimum from scratch - the Z80-PIO has loads of features the mouse interface will simply never use.
cmjones01 is offline  
Old 27th Sep 2011, 6:38 pm   #4
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: ZX Spectrum AMX mouse comms format?

Thanks for the replies, gents - it has always been a strange habit of mine to buy interesting looking junked microprocessor boards whenever I see them at radio rallies and so on, and so I have acquired a little collection of classic 80s microprocessors and their associated support chips, including, fortunately, at least one genuine Z80-PIO.

The dilemma I originally had in mind was whether to just build the original dumb PIO interface and find or create a suitable mouse (option 1) or use a PC serial / PS2 mouse and try to make a microprocessor based interface which imitated the AMX mouse interface, (option 2).

Thanks for the info that the same basic signals are available inside any PC three button mouse - if that's the case then it's looking increasingly like building a copy of the original interface is the better (and certainly the more satisfyingly retro) way to go.

Thanks also for the description of the operation of the BBC AMX mouse as well. I am 90+ percent certain the mouse itself would have been absolutely identical to the one supplied for the Spectrum (it should only be the interface which would be different).

Incidentally, using another similar device (ie, 8255) is not an option here - the aim is to use this project with -existing- AMX mouse compatible software which will undoubtedly send Z80-PIO specific setup information (Port pin direction setup, port interrupt enable, and so on) to the interface before starting to read the mouse.

Last edited by SiriusHardware; 27th Sep 2011 at 6:54 pm.
SiriusHardware is online now  
Old 28th Sep 2011, 7:40 am   #5
Jack Spark
Retired Dormant Member
 
Join Date: Aug 2008
Location: London, UK.
Posts: 47
Default Re: ZX Spectrum AMX mouse comms format?

This may help?

http://velesoft.speccy.cz/othermouse-cz.htm

Regards

Jack
Jack Spark is offline  
Old 28th Sep 2011, 8:58 am   #6
cmjones01
Nonode
 
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,669
Default Re: ZX Spectrum AMX mouse comms format?

The mouse in that link looks to have the same 20-pin connector on it as the BBC Micro mouse (of which I still own one), and the pinout in the schematic looks pleasingly compatible with the Beeb's user port, which is a good sign that the mouse itself is identical to the Beeb one.

By the way, when I mentioned starting with an 8255, I meant a *model* of the 8255 in VHDL or Verilog as a starting point for developing a Z80-PIO model which would be compatible enough with the existing software. I appreciate the originality of using the original parts, but re-creating something functionally identical using modern technology
also appeals to me
cmjones01 is offline  
Old 28th Sep 2011, 9:51 pm   #7
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: ZX Spectrum AMX mouse comms format?

Quote:
Originally Posted by cmjones01 View Post
By the way, when I mentioned starting with an 8255, I meant a *model* of the 8255 in VHDL or Verilog as a starting point for developing a Z80-PIO model which would be compatible enough with the existing software
Appeals to me too, but although I have been putting together microprocessors and microcontrollers since the late seventies I have absolutely no experience with or tools for using programmable logic (sorry if that's not what you are talking about - I'm assuming it is) - it would probably be a pretty hefty (and expensive) learning curve for me now.

I have a lot of admiration for what people seem to be able to do with them though - there's a guy who has built a modern version of Sinclair's original home computer (the MK14) and most of it seems to be a large programmable device used to replace most/all of the original separate logic.

Still, the best solution for me seems to be replication of the original Spectrum AMX mouse interface.
SiriusHardware is online now  
Old 28th Sep 2011, 9:55 pm   #8
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: ZX Spectrum AMX mouse comms format?

Quote:
Originally Posted by Jack Spark View Post
Yes, thanks, that's the diagram I have. You'll note that it doesn't include a circuit diagram of the mouse, but that would appear to be due to all mice of that era having used a 'dumb' 4-wire interface for movement transmission.

Oh, wait, I've just noticed something interesting. There's no WR (write connection) between the Spectrum and the PIO. Surely that's impossible? Without it, the Spectrum won't be able to set up the data direction registers, won't be able to turn the port interrupts on, and certainly won't be able to send anything to the PIO-Connector. Must be an error?

Last edited by SiriusHardware; 28th Sep 2011 at 10:03 pm.
SiriusHardware is online now  
Old 11th Apr 2013, 4:36 pm   #9
BobPowell
Retired Dormant Member
 
Join Date: Apr 2013
Location: Newport, Gwent, UK.
Posts: 1
Default Re: ZX Spectrum AMX mouse comms format?

Hi, I am the original designer of the AMX Mouse for the ZX Spectrum.

The original mouse used on the prototype was one from an Apple Macintosh of the day.

The PIO was mapped into the Spectrum's IO space and used the interrupts from two 8 bit ports to generate an X or Y trigger. Two bits of IO, one for each port were used to determine the direction of the movement.

The other bits in the PIO were used to create a Centronics parallel printer port.

If you want to emulate the thing I don't suppose you really need to emulate the entire PIO.

Bob.
BobPowell is offline  
Old 12th Apr 2013, 6:54 pm   #10
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: ZX Spectrum AMX mouse comms format?

Hello Bob! A genuine spectrum era celebrity! . Thanks for the info about the origins of the mouse. There are bound to be a few of those around, I'm sure.

I started this thread a long time ago, my interest in the AMX mouse came about because I wanted to try using my favourite Spectrum art / drawing utility ("The OCP Art Studio") with a mouse, something I never had the luxury of at the time.

As mentioned earlier, I do have a genuine Z80-PIO in my collection of antique 80s-era ICs, so emulation isn't really required - in theory, I can just build a replica of the real thing.

However, the version of art studio that I still have is the 128K specific version and I have a vague memory of having read that either the AMX mouse was not supported in that version, or the AMX mouse was incompatible with 128K hardware. Can you stretch your mind back that far and possibly remember whether there was any issue in that respect?
SiriusHardware is online now  
Old 13th Apr 2013, 12:03 am   #11
julie_m
Dekatron
 
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
Default Re: ZX Spectrum AMX mouse comms format?

It's very possible there may have been an address clash between the AMX mouse and the 128K Spectrum hardware extensions. Even if so, you could always build your mouse interface to sit on different addresses and patch the software to suit. I used to be able to look at a column of hex numbers and see the instructions in my mind's eye, back in the days .....

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!
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments.
julie_m is offline  
Old 15th Apr 2013, 9:56 am   #12
richrussell
Heptode
 
richrussell's Avatar
 
Join Date: Jul 2008
Location: Selby, North Yorkshire, UK.
Posts: 979
Default Re: ZX Spectrum AMX mouse comms format?

If it helps, I've got a full boxed copy of the 48K OCP Art Studio, complete with nasty Lenslok device.

Alternatively, you could just download the TAP or TZX image from www.worldofspectrum.org. There are utilities to convert these to audio so they can be recorded back to cassette for loading on real hardware.
richrussell is offline  
Old 15th Apr 2013, 6:18 pm   #13
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: ZX Spectrum AMX mouse comms format?

Quote:
Originally Posted by richrussell View Post
If it helps, I've got a full boxed copy of the 48K OCP Art Studio, complete with nasty Lenslok device.

Alternatively, you could just download the TAP or TZX image from www.worldofspectrum.org. There are utilities to convert these to audio so they can be recorded back to cassette for loading on real hardware.
Thanks for the info - in actual fact I did own the 48K version first and bought it again in 128K guise when I added a 128K Spectrum to my original 48K Spectrum. A while later, I moved on to the Atari ST and gave virtually all of my 48K software away to someone who was still using a Spectrum, and kept only the few items of 128K software that I had.

Both versions are indeed available on World Of Spectrum but the image files are so perfectly original that they still feature the dreadful Lenslok protection - there is a Lenslok emulator available which creates a transparent window which can be moved around the screen - you hover it over the lenslok query screen on your spectrum emulator and it unscrambles the two letter code just as badly as the real thing.

I haven't yet resolved the question of whether the 128K version of OCP is / is not compatible with the AMX mouse. I'm hoping Bob Powell may be able to enlighten me on this point.
SiriusHardware is online now  
Old 15th Apr 2013, 6:42 pm   #14
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
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  
Old 15th Apr 2013, 8:27 pm   #15
Guest
Guest
 
Posts: n/a
Default Re: ZX Spectrum AMX mouse comms format?

Quote:
USB, aggh, you must be joking. I'm staying away from that for as long as I possibly can
It's not perfect but once you get into doing USB things using a microcotroller (PIC) it is so usefull. My latest thing has a keyboard, touchscreen, com port and mass storage (not that mass but enough). And you get power too!
 
Closed Thread

Thread Tools



All times are GMT +1. The time now is 2:52 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.