News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CPC464 Wireless Controller/Gamepad

Started by dannyh, 15:17, 13 August 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dannyh

Hi All,

Just wanted to share a little something I put together last night. I'm sure it's been done by others many times before. I've been struggling to find a gamepad for my 464. I unscrewed a few of the aftermarket "Mega Drive" style pads, but they contained chips for the rapid-fire etc., meaning rewiring them internally wasn't as straightforward as I'd hoped. After digging through some boxes, I grabbed an EPS32 and a ULN2803A, and knocked together a very crude bluetooth host/joystick interface. Surprisingly (considering my soldering skills) it worked flawlessly the first time and I can now use my Xbox controller (or any other Bluetooth controller) with my 464!  :)

You cannot view this attachment.You cannot view this attachment.

This weekend I might try to make a PCB/boxed version and see if I can power it from the +5v of the joystick port. Also, because there's plenty of spare buttons not in use on the controller, I'm going to try and implement rapid-fire, macros etc. in the ESP code. Should keep me busy for a few days.

I used the BluePad32 library on the ESP32...
https://github.com/ricardoquesada/bluepad32




arnoldemu

How many fire buttons on the amstrad side are supported?
Also does this have the equivalent of diodes to prevent keyboard/joystick clash?

dannyh

Hi Arnold,

Currently I've wired up the two fire buttons. Apparently there's a third (undocumented) FIRE button pin for a mouse or something like that? I didn't bother with that. The joystick port allows connection of 2 joysticks using the COM/COM2 pins, so technically you could connect two controllers to the same ESP for 2 player games etc.

I'm not 100% on the diodes, but the ULN2803A does have internal suppression diodes, so I don't think external are needed. I didn't notice any keyboard noise during use.

Brocky

#3
i dont think you even need the ULN2803A... should be able to connect the esp32 directly

this has given me an idea to upgrade my DIY arcade style joystick i built for my CPC, to wireless, by hooking up an esp32 and battery inside it.. and an ESP32 on the cpc side....
and the benefit, i could then use a ESP32 on my PC and use the joystick for things like mame!

dannyh

Hi Brocky,

The ESP32 is 3.3v and the port is 5v active low. I didn't want to risk feeding 5v into a 3.3v chip hence using the ULN2803A. It might work direct, I wouldn't like to try. I'd be too scared about frying something in my 464  :laugh:




arnoldemu

Quote from: dannyh on 16:48, 13 August 25Hi Arnold,

Currently I've wired up the two fire buttons. Apparently there's a third (undocumented) FIRE button pin for a mouse or something like that? I didn't bother with that. The joystick port allows connection of 2 joysticks using the COM/COM2 pins, so technically you could connect two controllers to the same ESP for 2 player games etc.

I'm not 100% on the diodes, but the ULN2803A does have internal suppression diodes, so I don't think external are needed. I didn't notice any keyboard noise during use.
Two button support: nice. I was thinking 2 buttons is ideal for games. 

I'd definitely agree with supporting a 2nd pad.

You can check for keyboard/joystick  clash in the following way.

On a CPC:

Run Gauntlet: https://www.cpc-power.com/index.php?page=detail&num=960
Choose 2 player with one using keyboard and the other using joystick.

Press two of the keyboard controls for one player  (e.g. down and left might do it), and at the same time press up on the joystick for other player and if you then see this other character move to the side or fire then this is the issue the use of diodes can resolve. It definitely happens with this game on CPC and it's frustrating.



Brocky

#6
Quote from: dannyh on 23:03, 13 August 25Hi Brocky,
The ESP32 is 3.3v and the port is 5v active low. I didn't want to risk feeding 5v into a 3.3v chip hence using the ULN2803A. It might work direct, I wouldn't like to try. I'd be too scared about frying something in my 464  :laugh:
https://www.voodoo.business/blog/2021/05/19/are-the-esp32-and-esp8266-5v-tolerant-yes-they-officially-are/

they sink the current fine on the digital IO... the board in your photo has a 5v power input pin too by the looks of it..hence the voltage reg (derp USB is 5v! but theres usually a pin ya can use to power, or take 5v from if using usb..)

they just wont output 5v..stuck at 3.3v...but 3.3v is often enough to trigger 5v logic..

GUNHED

Cool thing! If it ever gets released Fire 3 would be a gem, for AMX Pagemaker / Stop Press for example amog other software.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod