EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: alexanderbrevig on August 30, 2016, 03:20:41 am

Title: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on August 30, 2016, 03:20:41 am
So, I just received my PSoC CY8CKIT-059 kits and wanted some excuse to use one them.
It's now 05:19 AM so I decided: Why not finally make something I've been pondering for a while! Namely my own (gaming) keypad.

I did a slight attempt with STM32 but since I use them for work I am kind of fed up with them. And I've got to say; Cypress has earned a fan in me.  :-+
Also, I started with Fusion 360 a few days back so be kind (or don't)  :box: Yet another awesome software package!

I've tested the firmware and it works.

Next up is to start a 3d print, make a breadboard test board with headers for debugging and lastly figure out what I'll do with my remaining IO :D
Title: Re: An attempt to make a DIY gaming keypad
Post by: lapm on August 30, 2016, 03:32:05 am
Do you really need to use all that extra IO?  Bloat is nasty decease that seems to eat all space ;) If it works well....
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on August 30, 2016, 05:18:27 am
Nice design !
Since I started playing TF2, I wanted a 3d-joystick thingy with some buttons, playing with the keyboard still seems totally awkward..., the question is can this chip act as a HID ?, most probably, doesn't it ?
Would you post some code ? :D. I'll order one, I wanted one since I read about these SoC on a thread on the microprocessor subforum :)
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on August 30, 2016, 08:53:12 pm
Hi there ale500!

Indeed it acts as a HID :)
Here's the source: https://github.com/AlexanderBrevig/DIYGamingPad (https://github.com/AlexanderBrevig/DIYGamingPad)

DM me if you need help getting it up and running!
I've verified the source with this:
(http://i.imgur.com/KL6geas.jpg)
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on August 31, 2016, 05:16:16 am
Great !

I ordered such a stick, thus I'll give it go !

Thanks !
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on September 01, 2016, 05:24:26 am
I tried to load the project from github in to PSoC Creator, and it gives some errors:

Errors found while loading "C:\02_Elektronik\095_DIYGamingPad-master\HIDKeyboard.cydsn\TopDesign\TopDesign_01.cymacro" file. This file would not be considered in the update process.

At least one file seems to be missing: TopDesign_01.cymacro

I tried with PSoC 3.1 and 3.3 probiert, the file is missing :)
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 01, 2016, 05:34:30 am
Ah. No worries. It's supposed to be deleted... thoughtI saved the change. Just click OK and save the workspace!

Let me know of you find some bugs :) if you submit a PR I'll merge or fix it.
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on September 01, 2016, 05:49:41 am
The file doesn't get generated, but I can compile the project anyways. If I go over the USBFS symbol I can generate a macro file, than a TopDesing_02.cymacro gets generated...  I renamed it to 01 and now seems to be happy :)... now I have to wait a few days till the stick arrives....
Thanks !
Title: Re: An attempt to make a DIY gaming keypad
Post by: bobaruni on September 01, 2016, 12:46:18 pm
I did a slight attempt with STM32 but since I use them for work I am kind of fed up with them. And I've got to say; Cypress has earned a fan in me.  :-+

This chip looks very interesting, tons of analog peripherals...shame no F4/F7 upgrade path (yet).
Just wondering what the USB stack is like compared to the STM32 Cube/HAL, Is it just as flexible, could you for example create your own feature reports / control transfers within HID using custom descriptors or is the source hidden in a pre-compiled module?
Title: Re: An attempt to make a DIY gaming keypad
Post by: wraper on September 01, 2016, 01:13:29 pm
Comment about functionality. I hope that you don't think that gaming keyboard can contain tact switches and work anywhere decently/reliably.
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 01, 2016, 02:17:33 pm
Just wondering what the USB stack is like compared to the STM32 Cube/HAL, Is it just as flexible, could you for example create your own feature reports / control transfers within HID using custom descriptors or is the source hidden in a pre-compiled module?
The source is not hidden, and usually the documentation is excellent. Here's the datasheet for USBFS (http://www.cypress.com/file/220366/download)

Comment about functionality. I hope that you don't think that gaming keyboard can contain tact switches and work anywhere decently/reliably.
Care to elaborate?
Title: Re: An attempt to make a DIY gaming keypad
Post by: wraper on September 01, 2016, 10:51:08 pm
Care to elaborate?
Have you ever seen tact switches in commercial keyboard product? Don't think so. There are two main reasons except the price. 1. With amount of presses keyboard experiences they will fail very fast. 2. Their tactile features suck for using in keyboard, too short travel and you always need to press them down to the bottom to make a contact. And unlike rubber dome which have the press to the bottom issue too, they also are very hard, no amortization at all. If you ever try typing on a tact switch keyboard, I guess your fingers would ask to stop doing so very soon.
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 01, 2016, 11:36:02 pm
Wait; I understand now. You're thinking I'm going to use those prototype tact switches? I'm using Cerry MX :)

If you look at my 3d render I'm sure you will recognize them if you too have looked inside a commercial mechanical keyboard ;)

EDIT: rephrased as I can see I came off a bit wrong replying too late last night.
Also, it's printing!
(http://i.imgur.com/hCN56P0.jpg)
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on September 03, 2016, 05:02:08 am
I got the stick ! it works a treat !

Thanks !
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 07, 2016, 08:25:48 am
Here it is, printed on an Ultimaker 2:
(http://i.imgur.com/eeenH75.jpg) (http://i.imgur.com/eeenH75.jpg)

Now some primer and color before I wire it all up!

EDIT: the firmware is updated (new pinout so if you've wired something up beware) https://github.com/AlexanderBrevig/DIYGamingPad (https://github.com/AlexanderBrevig/DIYGamingPad)
Title: Re: An attempt to make a DIY gaming keypad
Post by: dferyance on September 07, 2016, 04:52:39 pm
I'm really impressed with the look of the 3d print. That should turn out really cool.

One of the nice things about the PSoC is the programmable digital. I did a keypad myself using the same PSoC board but instead of using up all the IO lines, I used the UDB blocks with verilog to scan rows and columns and store the results in a register. Looks like you are fine on IO lines, but if you ever want to play around with PSoC features that is an idea you can try.
Title: Re: An attempt to make a DIY gaming keypad
Post by: ale500 on September 08, 2016, 05:51:10 am
Looking at that nice print, I wonder which games do you want to play ? :)

I want something else, a kind of joystick but with buttons, something I can operate with one hand: the fingers should be free to press buttons. I was thinking on something that looks like a gear lever, with one button per finger positioned in a way that I can press them without moving my fingers away...

Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 08, 2016, 01:46:02 pm
RE: Print quality; I've very happy with the Ultimaker 2, especially on PLA and of course care must be taken to get the print bed level. I've also found that it pays to check the slicing and to make sure proper supports are made.

I rarely play games these days, no time :( But I played LoL and CS:GO a lot before so those are the games I'll try to get back into. Not seriously this time though. Important to have some recreational activities too  :)

I don't quite picture what you had in mind ale500. Care to make a quick sketch? :) I'm intrigued.
Title: Re: An attempt to make a DIY gaming keypad
Post by: jonovid on September 08, 2016, 03:30:58 pm
If you are interested DIY joy-pads, in 2009 I had an idea, for a kind of Gun Like joy-pad but with more rumble & kick  for my PlayStation 3  But before I could have a working prototype, as no 3d printing back then, - in 2014 Sony changed the PlayStation 3 firmware with an update to block all aftermarket or non-Sony game-pads from working on their consoles. as my idea was to use  aftermarket PS3 game-pad electronics inside a two part plastic shell with end caps for the buttons. with added rumble kicker solenoid.  see the 2010 kind of Gun Like joy-pad art.  failed project.
(http://)
Title: Re: An attempt to make a DIY gaming keypad
Post by: jh15 on September 08, 2016, 03:39:55 pm
"in 2014 Sony changed the PlayStation 3 firmware with an update to block all aftermarket or non-Sony game-pads from working on their consoles"

Evil company.
Title: Re: An attempt to make a DIY gaming keypad
Post by: alexanderbrevig on September 08, 2016, 03:41:06 pm
It's painted now.
(http://i.imgur.com/N8itABBh.jpg)
Title: Re: An attempt to make a DIY gaming keypad
Post by: jonovid on September 08, 2016, 05:24:17 pm
do not have a 3D printer or ever used one, But i see that the your plastic casting can benefit from more under coat,  to full in the imperfections from the 3D printing process.  i Know a little about automotive body repair .    otherwise its looking good. :-+
Title: Re: An attempt to make a DIY gaming keypad
Post by: jh15 on September 10, 2016, 03:57:23 am
Keep note of making a Commander Keen friendly setup.
Title: Re: An attempt to make a DIY gaming keypad
Post by: DaJMasta on September 10, 2016, 04:10:17 am
The chassis is looking good, am I correct in assuming that the key caps, when depressed, will be entirely outside the pictured housing?  Typically I see keys butting up against each other on an interface, but for that the be the case here, the key caps would have to be wider and you have to be sure that the depression distance of the switch is short enough to keep the back of the key cap from hitting the chassis - this could also be helped by getting the board as close to the back of the housing as possible, which is then dependent on the size of the switch mechanism itself.

I'm also wondering if you've considered a reinforcing backplate for the keypad.  I don't think board flexing will be as much of a problem given the relatively short span compared to a normal keyboard, but it seems that a lot of people notice even a little play from the board flexing under the impact of a switch - some additional mounting points near the center of the board or a reinforcing plate or bar of some sort could clean up any spongyness you may run into in the assembled project.
Title: Re: An attempt to make a DIY gaming keypad
Post by: Monkeh on September 10, 2016, 04:11:27 am
"in 2014 Sony changed the PlayStation 3 firmware with an update to block all aftermarket or non-Sony game-pads from working on their consoles"

Evil company.

Evil false information.

They blocked unlicensed controllers, the quality of which is uh, variable, to say the least. There's a wide range of aftermarket, licensed, controllers available. Not quite as evil as made out.
Title: Re: An attempt to make a DIY gaming keypad
Post by: jh15 on September 10, 2016, 04:14:08 am
Yeah, sure, my homemade button must be licensed
Title: Re: An attempt to make a DIY gaming keypad
Post by: Monkeh on September 10, 2016, 04:14:53 am
Yeah, sure, my homemade button must be licensed

No, but your controller containing a lithium battery and bearing a Sony or Playstation logo must be.

They primarily targeted fake controllers pretending to be real Sony units, not 'all aftermarket or non-Sony' controllers.