News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Cwiiis

A simpler mouse adapter for the Amstrad Plus?

Started by Cwiiis, 14:34, 11 November 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cwiiis

I finally have an M4, but I completely forgot that I don't have any way to get mouse input on my Plus other than via my RSF3 (which is great, but makes it a bit pointless to use the M4, and I expect will conflict with the Gemini memory expansion once that comes about). This gets me to thinking, what's the best way to get a mouse working on the Plus?

There's always PS2Mouse https://www.cpcwiki.eu/index.php/PS2Mouse - but with the split joystick ports on the Plus and the power socket not being particularly close to them, it's a bit of a fiddly mess, especially if you want mouse-wheel support.

There's the new Albireo board https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/albireo-usbsd-interface-for-cpc-new-version-without-serial/ - very feasible, but maybe a bit overkill if all you want is mouse support? No idea if it conflicts with the M4 or other expansions either...

It got me to thinking - could you use the light-pen connector on the Plus to provide mouse input without having to mess with Y cables? You have +5V and GND from it, though I don't know how the LPEN signal is encoded to know if it would be enough to communicate mouse coordinates... Presumably you'd also still lose the mouse-wheel... What about the analogue joystick port, have there been any mouse interfaces that have endeavored to use that?

I'd be interested in prototyping something if I could get some help on some of the details :)

Prodatron

If I don't have a SF2/SF3/RSF3 connected, I am always using the Albireo (USB) or the MultiPlay (Amiga) for having a mouse on my CPC.
But yes, I am curious as well, if the analog joystick port could be used for this with a special interface?

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Bryce

Hi,
    there's lots of space inside the Plus. You could wire a PS2 to Joystick interface inside the case and create a PS2 port.

Bryce.

Cwiiis

Quote from: Bryce on 14:54, 11 November 22Hi,
    there's lots of space inside the Plus. You could wire a PS2 to Joystick interface inside the case and create a PS2 port.

Bryce.
Actually, I love this idea... A PS/2 port to go with my tape port - I guess time to get the components then :)

Still interested in discussing an analogue joystick or light-pen port mouse adapter though, seems a shame to have those ports practically defunct.

Cwiiis

@Bryce is there any danger in having the mouse permanently wired to the joystick port without any kind of switch? I assume if both a joystick and the mouse are plugged in at the same time, they would just both work without causing any damage to anything, but I don't fully understand the circuit yet and adding current to something that doesn't normally have it scares me :)

Bryce

I think when I did it I added a switch to switch off the mouse port if needed (It just disconnected the ground). Not because it could damage anything, but because you could mess up in a game if you knocked against the mouse as these would be seen as joystick inputs.

Bryce.

GUNHED

There is a mot to add an AtariST mouse to the CPC6128.
Without the diodes (the 6128plus contains the diodes already on the pcb) this simple adaptor should work with 6128plus too (I should try, but don't have time now).
The adapter can be found in cpcwiki itself. (It's proportional!)

About Analogue port, it's proportional too. How proportional?
Have a look at the first couple of seconds: arrow moving

https://www.youtube.com/watch?v=_OnEdP0DK5w


The problem with all proportional HID is that they are not joystick compatible. Well, being proportional is the advantage itself.  ;)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Cwiiis

#7
I contacted Duke on the chance that I could circumvent doing some work and just use an Imperium Solo (and get the added benefit of joystick support too!), but unfortunately, like most things, it's affected by the parts shortage.

So I'm going ahead and designing a board for my use that replicates Bryce's circuit that I'll layout in a convenient way to embed somewhere in my Plus. The attached is Bryce's circuit from the wiki, but modified to always auto-detect, ignoring pin 8 on the joystick port (which is disconnected on the Plus) and using a USB connector. Does this look correct? Something I notice is that there's no filter cap for the LS240 VCC, but perhaps that's unnecessary? And I'm not sure what's going on with the 10K resistor to GND on the USB VCC? It'll be a while before I have all the parts anyway, just thought I'd get a bit of a head-start.

Bryce

#8
That won't work, you would end up with a screen full of unwanted characters. Pin 8 isn't an Autodetect, it's ensuring that the mouse circuit ONLY sends data when the AY is scanning the joystick port and NOT when the AY is scanning the keyboard. However, you have made a further mistake:  You haven't connected the OE pins to GND, just to VCC via a resistor, so the mouse circuit will actually do nothing at all at the moment.

Bryce.

Cwiiis

Quote from: Bryce on 13:57, 14 November 22That won't work, you would end up with a screen full of unwanted characters. Pin 8 isn't an Autodetect, it's ensuring that the mouse circuit ONLY sends data when the AY is scanning the joystick port and NOT when the AY is scanning the keyboard. However, you have made a further mistake:  You haven't connected the OE pins to GND, just to VCC via a resistor, so the mouse circuit will actually do nothing at all at the moment.

Bryce.
Oh balls, I mixed up pin 8 with pin 5! Pin 5 I suppose will need to be connected to somewhere near the keyboard connector given it has no connection with the joystick port on the Plus - thanks for looking this over, I'd like to think I would've noticed this eventually, but probably not before an extended period of tearing my hair out :)


Regarding the 10K to GND on the USB VCC, can that be ommitted? My best guess is that it makes more sense with PS/2, but I don't really see what it's doing in this case (sorry if this is obvious, my electronics knowledge is extremely limited...)

Bryce

I have no idea why you added the 10K between USB VCC and ground. My circuit doesn't have that. As for pin 5, this is the undocumented "Fire 3" button on the classic CPC. It won't do anything on a Plus, but I would leave it connected so that your circuit has this feature if used on a classic CPC.

Bryce.

Cwiiis

Spotted a silly mistake connecting VDD on the PIC, but that was pretty obvious. Corrected the previous defects that Bryce spotted and did an initial layout, but it's way more convoluted than it should be (especially given Bryce's excellent layout on the wiki), so I'll probably give that another shot at some point before ordering a batch.

I've laid out the DB9 connections in the same order as the last 8 pins of the internal joypad header so that should make connecting them nice and easy (and reversible). Pin 5 is on pin 1 and I should be able to connect that to X7 on the keyboard connector (or NR02 if I want a slightly lower risk place to connect to, I suppose).

I plan on mounting the board just behind the keyboard between that and the disk drive - I figure I'll get ground and power by running wires underneath the motherboard from either IC7 or the floppy power connector. I suppose the latter would be more in keeping, though the route would be slightly longer... The USB port itself I plan on putting just to the right of the floppy disk slot as I'm already using the other obvious space for a tape port. Now it's just a case of waiting for components... I have a spare 464+ with a dodgy ASIC that I can test this on before committing to the changes in my working 6128+ when the time comes, so this ought to be pretty low risk.

Nemo59

Hi. I use à PS/2 mouse connected to the  joystick port. It works fine but its not very beautiful ;D

With the CPC+ I use a hardware sprite to manage the mouse cursor. For exemple a video capture of my CM14 screen : 

It's in French but the machine translation in English is not too bad.
CPC 6128+ / CPM+/ Turbo PASCAL v3
https://cpcrulez.fr/auteur-nemo59.htm

GUNHED

Quote from: GUNHED on 13:45, 12 November 22There is a mot to add an AtariST mouse to the CPC6128.
Without the diodes (the 6128plus contains the diodes already on the pcb) this simple adaptor should work with 6128plus too (I should try, but don't have time now).
The adapter can be found in cpcwiki itself. (It's proportional!)

About Analogue port, it's proportional too. How proportional?
Have a look at the first couple of seconds: arrow moving

https://www.youtube.com/watch?v=_OnEdP0DK5w


The problem with all proportional HID is that they are not joystick compatible. Well, being proportional is the advantage itself.  ;)
Pretty awesome video. Is there a document how to built such a mouse adapter?
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Cwiiis

So I had some PCBs made up and I'm testing it at the moment - the mouse seems to initialise correctly, but I'm not getting any joystick input on the Amstrad and the LED stays dark. I can see that power is at least going to both ICs correctly and I've verified the PIC is programmed correctly (when the mouse I'm testing with initialises, I get a little haptic click, but perhaps that only signifies power rather than initialisation?)

Given the LED is hooked up directly to a PIC pin, I assume it should either be on when a mouse is connected or when data is transmitted? So I guess either the PIC firmware doesn't like this mouse or something is wired wrong... I programmed the PIC using a PicKit3 and MPLAB IPE - I wasn't certain whether it should hold in reset or release, but neither seem to work.

Anyway, ongoing, tips appreciated!

ComSoft6128

#15
If you ever make an external interface for sale, I'll buy (assuming its cheap enough) one for testing with the Advanced Art Studio, MicroDesign & the Desktop Environment System. I was seriously unimpressed with mice available "back in the day" and it would be marvellous to have one that works OK :)

Bryce

Unfortunately, most of the mice available for the CPC just converted the mouse movements to joystick inputs, just like this device does too. So you may be equally unimpressed by the performance.

Bryce.

ComSoft6128


Cwiiis

@Bryce could you confirm what the behaviour of the LED should be? My current thinking is that I've not programmed the PIC correctly, the circuit is pretty simple and I can generate key input by shorting relevant pins to ground, but it seems like the PIC is doing nothing... I've tested the LS chip too, it's working fine. I note you specify oscillator and fuse settings, I assume these are embedded in the hex file? There doesn't seem to be another way to change them in MPLAB IPE, so perhaps that could also be a cause of issues if they aren't?

Bryce

PIC's are a bit different to AVR. The HEX file should be all you need, there are no additional fuse settings. As for the LED: If it recognises the mouse as compatible (it has to be a mouse that support PS/2 mode, ie: not some really modern 16 button mouse) it will turn on for 1 second and then turn off. After that it will quickly flash every time it receives valid data from the mouse. If it flashes (one second intervals) continuously, then the mouse doesn't support PS/2 mode.

Bryce.

Prodatron

Quote from: Bryce on 16:19, 28 November 22Unfortunately, most of the mice available for the CPC just converted the mouse movements to joystick inputs, just like this device does too. So you may be equally unimpressed by the performance.
True, it's not possible to emulate a real proportional mouse with a Joystick compatible device. A joystick can move 50 pixels in a second, while a real mouse can move over the whole screen multiple times in a second. But IMHO for a GUI it's still better to use a joystick compatible mouse which tries to emulate a mouse than just using a joystick.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Cwiiis

Quote from: Bryce on 20:17, 28 November 22PIC's are a bit different to AVR. The HEX file should be all you need, there are no additional fuse settings. As for the LED: If it recognises the mouse as compatible (it has to be a mouse that support PS/2 mode, ie: not some really modern 16 button mouse) it will turn on for 1 second and then turn off. After that it will quickly flash every time it receives valid data from the mouse. If it flashes (one second intervals) continuously, then the mouse doesn't support PS/2 mode.

Bryce.
So I'm not getting any activity on the LED at all, so I suppose that indicates that the PIC isn't running(?) I'll check the clock, I just need to remember how to use my oscilloscope properly :p If there's no mouse plugged in at all, would the LED flash or stay unlit?

Bryce

With no mouse the LED stays off as far as I can remember.

Bryce.

Cwiiis

Quote from: Bryce on 09:10, 29 November 22With no mouse the LED stays off as far as I can remember.

Bryce.

Ok, no luck so far - I've been trying to make some sense with a scope, but tbh, this is a bit beyond me (though I'm eager to learn!) My first thought is to just verify the obvious things, that power and clock are fine. Power is fine, CLKOUT is a sine wave going between 0V and ~5V - is this expected? CLKIN also looks weird - where it just seems stuck at around 2.5V with some noise. I see a little flash of a sine wave when I touch the probe to it, but then it gets stuck at 2.5V immediately after - is that expected?

The resonator I used is the Murata CSTLA4M00G55. It has a capacitance of 30pF (though the ebay page says 33/39pF - not sure why two values, or why higher than the datasheet...) - I note that's higher than the 22pF you quote on the wiki page when using a crystal, is 30pF (or 39?) too slow?

Any tips for debugging this would be gratefully received!

Bryce

Because you are using a passive probe (not an active probe), you are most likely stopping the clock by touching it with the probe tip. The capacity of the probe is enough to collapse a crystal signal. To measure a clock directly at the crystal you either need to use an active probe (these cost a lot more than your scope) or use a non-contact method (NF Probe, which also cost a bunch).

Bryce.

Powered by SMFPacks Menu Editor Mod