![]() |
![]() |
#1 |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
HID USB Mouse to Amiga
So I don't have a mouse for the A500 that I just acquired - I ordered one of those PS2 Compatible USB mouse adapters but they sent an ST version, oops!
While I wait for the correct one to come I thought I'd just make my own using an STM32 microcontroller I have sitting about. Anyhow, total parts cost is ~ 7 quid. MCU is a WeAct stm32f401CCU6 from Aliexpress like this -> https://www.aliexpress.com/item/4000...archweb201603_ (Not the F411CEU6, the code would need modifying to work with that). There're 2x 5v to 3.3V bidirectional level shiters to cope with the 7 GPIO lines the Amiga uses for left, mid, right buttons, and the X&Y signals (4 lines for those in quadrature encoded format). One of the level shifters also steps the 5v power from the amiga down to 3.3v to power the MCU. A 9 pin Female D-sub Some wires, solder, and a breadboard/prototyping board (or a custom PCB if you have time). A USB A female to USB C adapter. Code is here on github -> https://github.com/BennehBoy/F401_AMIGA_HID I need to do some documentation yet. Crappy photo of the prototype below Looks a bit more complicated than it is in reality because the programmer and serial converter I was using for debugging are still connected. I am NOT going to be building these for people, just sharing a days effort for anyone else capable. PS This can be made to run on other hardware by anyone familiar with STM32 Cube IDE. For example an STM32F105RBT6 I may add HID Controller support if I get bored, it's not hard to bake in. |
![]() |
![]() |
#2 |
-
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,916
|
Wow, that's a lot of work. You can change the Atari ST mouse adapter into an Amiga one by swapping pins 1 and 4 at the D connector.
|
![]() |
![]() |
#3 | |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
Quote:
And in terms of work, I've probably spent 3 hours on it - most of which was getting to grips with Cube IDE after coming from Arduino (No USB Host support in the STM32 Arduino core). PS Oh, and the adapter is being RMA'd so I didn't want to chop it. |
|
![]() |
![]() |
#4 |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
At the moment the mouse needs to be replugged each time the amiga is powered on - I'll be including some USB re-enumeration to fix that soon.
|
![]() |
![]() |
#5 |
Registered User
Join Date: May 2020
Location: Iowa, USA
Posts: 154
|
Nice work. I'm on a "modernization" kick right now and HID is high on my list of concerns. Glad someone is sharing their efforts. Kudos!
|
![]() |
![]() |
#6 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,157
|
Nice work - thanks for sharing! I want to explore HID -> PS/2 at some point since nice PS/2 keyboards are now more difficult to obtain these days.
|
![]() |
![]() |
#7 |
Registered User
Join Date: Mar 2018
Location: Austria
Posts: 617
|
That's the real hacker! Send me the correct item or I will build it on my own while waiting for the replacement.
![]() Nice work! |
![]() |
![]() |
#8 |
Registered User
Join Date: Sep 2017
Location: IT
Posts: 178
|
Similar projects:
https://github.com/EmberHeavyIndustries/HID2AMI https://github.com/simoninns/SmallyMouse2 https://gitlab.com/SukkoPera/unijoysticle2 (should have mouse support soon) |
![]() |
![]() |
#9 | |
-
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,916
|
Quote:
One niche you could serve with your adapter is: KVM support. A single adapter that supports those multi device HID implementations where both mouse and keyboard come in via the same USB cable. No-one has designed or sells an Amiga USB adapter like this to my knowledge. |
|
![]() |
![]() |
#10 | |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
Quote:
![]() |
|
![]() |
![]() |
#11 | |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
Quote:
I'm not familiar with any other combined KB/Mouse devices that someone may wish to interface with an Amiga, got any links? How would the KB signals be interfaced with the Amiga? There's no single option here right, I think the big boxes, 500, a600/1200 all use different connectors (granted the underlying circuitry is the same just embedded in the motherboard or the keyboard sub board), but it's getting access to those in order to connect something that's a pain. And I only have an a500 here. It's more likely that I'll just expand the software for this to cover game controllers, and have a menu to switch the GPIOs to accommodate Atari + others - but anyone with wiring knowledge can do this in the hardware side (and this sharing is really aimed at those who can build things). I won't be providing the level of software support that HID2AMI does, as this is just meant to be a quick hack - anyone wanting extended support should go support that project. But anyone wanting a quick mouse hack bodge and has the skills might find this useful. PS Scope creep - the death of all projects ![]() |
|
![]() |
![]() |
#12 | |
Registered User
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
|
Quote:
|
|
![]() |
![]() |
#13 |
-
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,916
|
KVMs are commonly like this, but you can find them closer to home.
These ps2 -> usb adapters show up as a keyboard and mouse simultaneously. ![]() Also the very commonly found Logitech Unifying Receiver does keyboard + mouse simultaneously. ![]() As for the keyboard, in my opinion a short male ps2 pigtail would be fine, then people can use what ever extension cords and adapters to connect it to their computer. The main difference between wedge/big box: how ctrl-amiga-amiga reset is handled. Wedge amigas have a separate keyboard reset signal, big box machines pulse the clock line low for a while. Even this could be left as an exercise to the end user. Have the ps2 connector -> wedge amiga adapter include this. On the other hand, this could be a problem that is worth solving in the USB domain instead of making it Amiga specific. Last edited by Jope; 22 April 2021 at 10:49. |
![]() |
![]() |
#14 |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
OK I'm with you now, so these are mainly combination receivers for wireless mouse/kb devices.
It ought to be simple enough to handle, those will just be USB Composite devices. STM's USB stack should just seemlessly add each unless they use some proprietary drivers. I'd need to add a KB handler to the code and the appropriate h/w to spit out the PS2 signals. Might be something to look at from a 'bored got nowt to do' perspective, but my test chain might be a bit precarious because 1) I don't have any of these combined devices so would need to test with just a USB KB connected, and 2) I don't have any device that natively handles PS2 input - I _do_ have a PS2 to USB adapter (sat in a tub since USB first appeared and manufacturers supplied adapters with new PC mobos), so could do a double conversion to test... |
![]() |
![]() |
#15 |
-
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,916
|
Cool. No obligation to deliver - just a thought if you want to differentiate.
Up to you whether your PS2 connector has PS2 or Amiga signaling, PS2 might have some ready made libraries available, but otoh USB -> Amiga KBD is a thing that may have been solved in an open source manner too. I haven't been following that closely. |
![]() |
![]() |
#16 |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
https://github.com/borb/amigahid
Arduino based implementation - will have a look later to see if can be ported to HAL... I can't move my code to Arduino because there's no USB Host support in the stm32 Arduino core. |
![]() |
![]() |
#17 | |
Registered User
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
|
Quote:
|
|
![]() |
![]() |
#18 |
Registered User
Join Date: Sep 2017
Location: IT
Posts: 178
|
In order to deal with multiple HID devices at the same time, you need multiple USB PHY on the chip.
I know that STM32F405 supports two USB OTG, but I suspect that F401 has only one. Just a couple of "lessons learned": - STM's USB stack is free, but it's bugged as hell. If you are going to start a "serious" project, I would recommend going to a more stable USB stack (google for lots of them) - Keyb support is fair easy to implement: there's a good "copy & paste" example in STM's demo application notes Last edited by sampedenawa; 22 April 2021 at 11:22. |
![]() |
![]() |
#19 | |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
Quote:
You're correct regrarding the 401, but I've got a stack of 407's here too, cheap and v capable, just a bit more bulky in dev board form. As for buggy USB stacks, you're not wrong at all, the partial 'cruft' of the HAL stack into STM's own Arduino core has been a bug bear on this front for a while, so much so that the lead STM dev on it is looking towards tinyusb as an alternative. |
|
![]() |
![]() |
#20 |
Registered User
Join Date: Apr 2021
Location: England
Posts: 58
|
Anyhow... for _this_ project the next step is the USB disconnect/re-enumeration to prevent the mouse having to be replugged at cold start.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
HID2AMI - *Any* HID mouse and HID gamepad to Amiga adaptor/converter | sampedenawa | Hardware mods | 238 | 22 May 2024 21:56 |
New USB HID Keyboard adapter for the classic Amiga | spidi | News | 49 | 06 May 2021 08:51 |
New USB HID mouse / USB Joystick / Gamepad USB adapter for the classic Amiga | spidi | News | 191 | 21 February 2021 19:18 |
USB Mouse For Amiga | crazyegg | support.Hardware | 32 | 24 May 2010 06:07 |
|
|