Jump to content

MMjoy


Recommended Posts

Hi guys!

I'm building a controller using a Teensy 2 and some 74HC165 shift registers.

I have made a controller with a button matrix, but shift registers are new to me.

How should I connect switches to the shift register, and how should I connect it to the Teensy board? Anybody got a tutorial?

 

Also, I want to use both buttons and rotary encoders. Do they connect to the shift register in the same way..?

Link to comment
Share on other sites

Hi guys!

I'm building a controller using a Teensy 2 and some 74HC165 shift registers.

I have made a controller with a button matrix, but shift registers are new to me.

How should I connect switches to the shift register, and how should I connect it to the Teensy board?

 

The buttons connections depends on design of Shift Register PCB you choose.

 

Can have 2 pins for every button, or 1 pin for every button and 1 pin common for all 8 buttons permissible per 7HC165.

 

The shift register is connected to Arduino board through 5 wires (serial protocol):

 

SCK

MISO

CS

VCC

GND

 

Encoder just use 2 buttons positions.

 

Think the best "tuto" about is Debolestis topic: https://forums.eagle.ru/showpost.php?p=2780923&postcount=89


Edited by Sokol1_br
Link to comment
Share on other sites

Thanks Sokol1!

But I need a wiring diagram showing me which pin on the register that goes where.

This pic from the MMJoy2 wiki doesn't tell me everything... are those resistors between VCC and the pin? What resistance are they?

 

https://raw.githubusercontent.com/MMjoy/mmjoy_en/master/img/Hardware%20connection/Shift%20register%20project.jpg

 

You need to hold my hand in this project as well... ;)

Link to comment
Share on other sites

Yes, 10k resistors, between each pin and VCC.

 

For convenience you can use resistor NET instead individuals resistor (see Debolestis example).

 

This compact PCB - the linked one or Debolestis - with 1 common pin for every 8 buttons is good for place inside joystick grip due space restriction.

 

But for a throttle where space is not critical place 2 pins for each button, will be more practical plug buttons.

 

What you need is the electrical scheme only, but I don't see one for 7HC165, for CD4021B is easy to find on Web.

 

But based on this linked you can draw your own.

 

This picture is from one (of several) layouts in MMjoy2 package, names is more readable.

 

Pay attention for three R0 - resistors with 0 resistance - acting as bridge, you can remove then if use double layer PCB, make the respective connection in other side of board.

 

http://oi66.tinypic.com/2ld7xo4.jpg

 

The common pin for each 4 (per side) pins of each 74C165 is the one connected in pin 8 (GND), you can plan one pin from this common connection making pair with input pins, what make easy connect individual buttons.


Edited by Sokol1_br
Link to comment
Share on other sites

  • 3 weeks later...

Encoders

 

Re did my PCB to just 3 encoders per board and soldered 2 boards up for 6 encoders 12 buttons. Got it working. I have started my own shared projects in OshPark.

https://www.oshpark.com/profiles/Brewnix

 

 

 

 

 

3835357.jpg

 

3835360.jpg

Brewnix Like the look of PCB and may try it.

A couple of questions to understand.

You built it as 6 columns and 1 row?

Just wanted to clarify what the bottom outlet hole is for (unmarked pin hole that is below out to "BR" on board?

Bottom Pic seems to show using that outlet hole and not the 1 above marked BR?

Intel i7-7700@3.6GHz 16GB NVIDIA GeForce GTX1060 6GB

Link to comment
Share on other sites

 

Looks interesting - just one question:

Is it possible to use encoders with this board as well or is it only designed for buttons/switches?

 

TIA

RS

Link to comment
Share on other sites

Brewnix Like the look of PCB and may try it.

A couple of questions to understand.

You built it as 6 columns and 1 row?

Just wanted to clarify what the bottom outlet hole is for (unmarked pin hole that is below out to "BR" on board?

Bottom Pic seems to show using that outlet hole and not the 1 above marked BR?

 

Hi, Correct one board is 6 columns and 1 row. The through whole below the BR is vacant/not used in OshPark Pic. Ok so the PCB pic above was the first board I made. It works but i didn't like the pin setup it makes you have to use 8 pin dupont connector with a gap between the wires. So I flipped the last whole so you could use a 7pin dupont connector and keep all the wires tidy in one connector. I realized after i soldered board up my mistake.. Other problem, FYI these board was design with the non push button encoders. So if you get the encoders with the push buttons you have to wire them separate. I used Frizting to draw these and Frizting Library didn't have a part for push button rotary encoders. I am also new to PCB drawing so if there is a better upgrade to the board feel free to critique. Thanks!


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Looks interesting - just one question:

Is it possible to use encoders with this board as well or is it only designed for buttons/switches?

 

Encoder - for practical connection purpose - is just 2 buttons, seem one (with the knob) connected in the above Shift Register Board:

 

https://img.alicdn.com/imgextra/i4/441247242/TB2tcL7jVXXXXb9XpXXXXXXXXXX-441247242.jpg

 

If encoder has press button, just add more 1 wire for this button, can use the same common wire for other 2 buttons of encoder.

Link to comment
Share on other sites

  • 2 weeks later...
Theoretically 64, since MMjoy2 firmware support up to 128 buttons and each encoder use 2 buttons.

But depends on Arduino version pinout, use of Diode Matrix or Shift Register.

 

Thanks! Wondering on mmjoy how do program beyond the 12 buttons in the encoder section. Or do you not need this section?

picture.php?albumid=1169&pictureid=8790

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Why I say "theoretically". :)

 

In Bu0836/BBI32, DSD 32 you can use up to 16 encoders = 32 buttons.

 

Buts seem MMjoy2 firmware limit encoder to 6.

 

In MMjoy2 Q&A has this (GT from Russian):

 

"2) increased number of Buttons to 128. wherein SPECIAL (encoders, tumblers, timers, etc.) of them have only the first 32, remaining as it is."

 

Buttons 33 to 128 work only as single press button.


Edited by Sokol1_br
Link to comment
Share on other sites

  • 3 weeks later...

Hey everyone I started a thread asking about a project I am planning and the guy helping me directed me to this thread and told me I'd get help here.

 

My original thread is here:

https://forums.eagle.ru/showthread.php?p=3116323#post3116323

 

Now for another question on parts needed as talked about in link above.

 

For what I'm wanting to do, would anyone know of a parts list and what am I overlooking or missing here.

 

Recap:

Ch Products Combatstick and Throttle gameport to USB conversion+ adding 2 rotaries and possible a couple or so more buttons, plus not needing the throttle axis on stick but instead another axis added to the throttle on top of whats needed for the stock HOTAS setup plus the 2 rotaries.

 

If using only one board to wire both the stick and throttle,how would I connect both to pc with one usb cable?

 

I dont see any wiring diagrams or even what type of cable or connectors to link the 2 controls together for one board.

 

A double check for my needs here.

 

-I need say this board for both controllers...1 card or will I need 2, 1 for each controller?

https://www.amazon.com/Qunqi-Leonardo-R3-development-Microcontroller/dp/B014H52DT4/ref=sr_1_1?ie=UTF8&qid=1492770086&sr=8-1-spons&keywords=Arduino+%22Leonardo%22+atmega32u4&psc=1

 

or these if I need 2 cards or 2 would just be easier,simple and a smarter way of going about it.

 

https://www.amazon.com/dp/B01HCXMBOU/ref=wl_it_dp_o_pC_nS_ttl?_encoding=UTF8&colid=246EDI8PJ0XIH&coliid=I2ZU664A1UG0UN&psc=1

 

-Whatever is needed to connect the 2 controllers togther.I havent found anything on that yet on how to do unless its just 2 cards I need.??

 

-My 2 rotaries

-obviously the wires and such.

 

Making sure and getting a list before I make the order to get it all in one go.

 

Again this is for

8 axis

Minimum of 10 buttons plus a couple or so extras I want to add

4x's 4 way hats

2x's 8 way hats

 

Im also open to opinions on parts. And again Im new to using these boards so Im learning as I go but I dont think I'll have to much trouble doing it once I got a good handle on what I need.

 

Thanks everyone.


Edited by rabidscoobie
Link to comment
Share on other sites

If using only one board to wire both the stick and throttle,how would I connect both to pc with one usb cable?

 

Using one (or two) original DB-15 cables for connect throttle on joystick base, fit the Arduino* board inside joystick base - since X,Y axis is the more important, fit the controller in stick base make the cables for this axes more short possible - and use one ordinary USB cable for connect into computer.

 

You find DB-15 connectors male/female disassembled do mount in joy' base.

 

* BTW- Get a more compact Arduino board, like Micro or Teensy, this R3 is too big (2.7x2.1") for joystick conversion and has no advantage over compact models.

 

Probable you will need do like I did (10 years ago) in this conversion with BU0836, use two cables between throttle and joystick base because the number of needed wires exceeds the 14/15 wires available in DB-15 cables.

 

ch_94.jpg

http://simhq.com/forum/ubbthreads.php/topics/2951319/1.html

 

Why re-use DB-15 cables?

 

Because they have many wires inside - difficult you will find one cable with more, their connectors is "bullet proof" (and match parts is cheap), an these cables in gameport joy/throttle is free. :)

 

I dont see any wiring diagrams or even what type of cable or connectors to link the 2 controls together for one board.

 

In this kind of conversion everyone make their own diagram accord the needs, and generally don't take note of what did. :D

 

First is need identity what is the matrix used in CombatStick, I guess 7x2 = 10 buttons + 4 of POV HAT (in FighterStick is 4x5 matrix), this avoid make any change inside joystick grip.

 

Do the same in throttle connections

 

And then make your diagram on how will connect throttle on joy base.

 

Again this is for

8 axis

Minimum of 10 buttons plus a couple or so extras I want to add

4x's 4 way hats

2x's 8 way hats

 

In CombatStick you will use:

 

6 press buttons

2x 4 HAT (8 way POV HAT use only 4 buttons) = 8

Total = 14 buttons

2 axis (if erase that throttle wheel)

 

In PRO Throttle (if is this model) is:

4 press buttons

4x4 HAT = 16

Total= 20 buttons

1 axis

 

This leave you with 5 spare axis in controller and 2 buttons fit anywhere in throttle, since will use:

 

14+20 = 34, the USB controller allow, to stay in Windows limitation 32+POV HAT (4) =36.

 

What I suggest - depend on your DIY skill - is add a "pinky paddle" in joystick, this will use one more button, and although I don't find this useful, a second stage in trigger. I did this, just "to do". :)

 

https://s8.postimg.org/tgdfuynk5/Fighter_Stick_MOD.jpg

 

You make the things more simple/easy if use one Arduino board inside each controller:

 

- Arduino boards are cheap (PRO Micro is ~$6 - look in eBay, Aliexpress)

- Simplify connections

- Allow use more axis, buttons on throttle

- Make one controller independent of other, will allow you use this throttle with other joy, for example.

- Spare axis in joystick board can be used latter for connect a rudder pedal.


Edited by Sokol1_br
  • Like 1
Link to comment
Share on other sites

Thanks for the reply.

 

Ok advice taken on the board. So basically this is what I would and will work for my needs:

 

https://www.amazon.com/dp/B01HCXMBOU...4A1UG0UN&psc=1

 

Ok so the 8 way POV Hat on the stick will actually only be a 4 way plus the 2nd 4 way hat will be the other 4 to make up for the 8 way hat on the board.

Makes sense to me now.

 

As for the throttle, I have not received it yet and I honestly dont know how to tell the difference between the pro and some others they may have made in the past.

To me looks like the Pro thats listed on the web site, its not the quadrant throttle.

 

Yeah about connecting the 2 together, I thought about that and will use 2 boards to keep them independent of the 2.

 

My plans so far are to remove the 1 hat by itself on the throttle and either move it over to more the middle of the handle and add the rotary in the original hat position or possibly remove the hat altogether and replace it with a thumb style stick similar to a game pad to use with my index finger if its possible.

Or instead of moving the hat from throttle or deleting it just move it over to the big grey button on the Combat stick and not have that button,similar to the Fighterstick setup.

 

I play space sims also so that would be huge help for that with the 6dof movement plus combined with my TM rudder pedals would make a versatile setup.

 

Now I need to read up on this matrix wiring to get a better understanding of how it works.

 

Any thoughts or suggestions about what rotaries to use?

1 rotary will be in the front hat position and the 2nd Im thinking on the outer end of the throttle handle to use with pinkie.

 

And also any suggestions on a gamepad style thumbstick to add,would prefer it that way and not just a 4 way hat style, need to be like a joystick to control how much strafe side to side, forward/back etc.

Im disabled with leg issues and cant always use the rudder pedals so this setup would work for me in those times.

 

Thank you so much for replying so fast and helping.

:thumbup:

Im really new to this type of electronics but really wanting to learn this stuff.:book:

Just dont know all the lingo talk and names of stuff all that well.

Link to comment
Share on other sites

Somehow the first time I read your reply I completely missed this tid bit.

 

"What I suggest - depend on your DIY sill is add a "pinky paddle" in joystick, this will use one more button, and although I don't find this useful, a second stage in trigger. I did this, just "o do". smile.gif

 

https://s8.postimg.org/tgdfuynk5/Fighter_Stick_MOD.jpg

"

I was already planning that but couldnt figure out what to use for the lever.

Im really interested to know what you used there.

 

As for the 2 stage trigger, I cant remember ever using it on the x52 Im using now. Seems kinda pointless for me.

 

to be more clear on my last post about the gamepad style axis, I really dont need it to be 4 way directional, what I really would prefer is the lever/paddle style that the cheap TM FCS throttle uses, just side to side kinda like a rudder twist on some joysticks.

Link to comment
Share on other sites

Ok so the 8 way POV Hat on the stick will actually only be a 4 way plus the 2nd 4 way hat will be the other 4 to make up for the 8 way hat on the board.

Makes sense to me now.

 

Not exactly in this way, you connect the POV HAT 4 buttons in specific pins in board (reserved for POV HAT), then the firmware interpret two close buttons e.g. N+E as diagonal NE resulting in 8 directions.

 

The other HAT is just 4 buttons grouped, and take 4 common buttons connections.

 

In the throttle is used the same principle, the POV HAT (4 buttons, but +4 diagonals) and 3x4 buttons HATS.

 

This gameport throttles has two models, the PRO (the one in my conversion) with 4 HATS and a more simply model with one POV HAT and 4 press buttons instead 4 HAT's, plus a 2 positions HAT on index + that 3 press buttons common to both models.

 

You can place a thumbstick in throttle (like in PRO USB version), but will be laborious:

 

For remove HAT from top of throttle (or joystick) is difficult because their are all soldered in a common PCB and share trails, to do this you will need make a new PCB or erase trails and make connections in HAT buttons pins, like I did - at time I don't know how are the original matrix, but latter find that is easy to trace then, avoiding that "surgery".

 

For make that "pinky lever" I use aluminum sheets, steel wire for pivot and and the curved steel wire for press the tactile micro-switch.

 

This involve lot of trials, because this stick tilt much in Y axis and prevent use a pinky lever in Warthog style. The lever curves is need for avoid that lever hit the joy base when grip is inclined forward.

 

Some details of the lever I did:

 

Fighter_Stick_MOD2.jpg

 

This Epoxy putty is not need for the pinky lever, is a "MOD" that allow twist the grip ~15º for left, to became more ergonomic if used in central position.


Edited by Sokol1_br
Link to comment
Share on other sites

Ok Ive been reading a lot of your posts on the web Sokol and I seem to have a good understanding of how to wire the buttons in a matrix.

So I am planning that out.

 

But when it comes to adding the Rotaries and axis I not so sure I understand what I have read.

 

Do the axis also wire up in a matrix similar to the buttons or does each axis being used connect to its own pin on the board?

 

I guess same question goes for the rotaries.

 

Also will the hat switches connect to a certain pinout or are they just part of the button matrix?

Also need to note: The Ch throttle i got appears to be the non pro version. looks like it has 2 hats and the rest are buttons. I plan to add another 4 way hat and I have these 5 way tact switches, How would these connect to the pins.

 

I have the Pro Micro boards. I already loaded the firmware,was simple.Got both boards on my first try.

 

The Stick will use all its original buttons with a couple added.

But the throttle I play to do a bit of work on.

 

Got lucky, my local electronics store was closing the doors so I got most of what I needed for 80-90% off.

 

Thanks again for the help.

Link to comment
Share on other sites

But when it comes to adding the Rotaries and axis I not so sure I understand what I have read.

 

Do the axis also wire up in a matrix similar to the buttons or does each axis being used connect to its own pin on the board?

 

Axis is wired outside of matrix, take a +5V, a Gnd and Signal inputs.

 

Signal input is individual for each axis, +5V and GNd can be shared if convenient.

 

I guess same question goes for the rotaries.

 

Depends on what type is this "rotaries", can be a potentiomer, so need axis input.

 

Or a encoder, in this case need two buttons inputs and depends on controller board support encoder, MMjoy2 support up to 6.

 

Also will the hat switches connect to a certain pinout or are they just part of the button matrix?

 

HAT switches is just 4 buttons around a pole and is wired in matrix like ordinary buttons.

 

The POV HAT (for control in game camera POV) need be wired in specific positions of matrix because when this HAT has 2 near buttons pressed simultaneously, this press is interpreted in firmware as a diagonal (45, 135, 225, 315) angle, creating the called "8 way" POV HAT (that don't have 8 buttons, but 4).

 

Also need to note: The Ch throttle i got appears to be the non pro version. looks like it has 2 hats and the rest are buttons. I plan to add another 4 way hat and I have these 5 way tact switches, How would these connect to the pins.

 

The 4 or 5 way switch (e.g. Alps) is connected like any other button, generally they have a pin common to all buttons, wire this for a matrix column (the ones without diodes).

 

You need understand well how the matrix work before start, matrix allow use few wires, but create a "spider web" inside joystick. :)

 

For the top part of grip the ideal is "decode" the matrix already used there.

 

Decoding the matrix used on grip and adding here 1/2 buttons make the work simple.

 

But if you start add much new buttons will be interesting consider make a Shift Register board, that make connections more "PnP" - but TL/DR require make changes in PCB under HAT's. :)


Edited by Sokol1_br
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...