AlenC Posted July 6, 2020 Posted July 6, 2020 Hi, I'm building a button box based on Pro Micro board. I already had it assembled with switches and potentiometer and it worked fine. I wanted to also add encoders, but I can't get them to work, so I'm hoping someone here with experience might be able to help me. I have connected a single incremental rotary encoder, middle pin to D3 column and outer pins to D0 and D4 rows (I've tried other combinations with the same result). In MMJoy2 setup, both directions trigger the same button (1 in this case), but not with every step. If I invert rowns in setup (first D4, then D0), button 2 will register. Also, it seems that if I hold down the push button of the encoder, likelyhood of registering step in either direction increases drastically. As I really don't understand how encoder interacts with Pro Micro and how MMJoy2 interprets the signal, I'm clueless as to what is the problem in my build. Maybe I should mention that I didn't use diodes. Would you expect this kind of behavior when diodes are omitted? Many thanks in advance!!
Sokol1 Posted July 6, 2020 Posted July 6, 2020 If you are not using Shift Register, what require an extra PCB, are using Button matrix and diodes are mandatory. What MMjoy2 firmware version your are using? Should use one of two last, from MegaMOZG page: https://sites.google.com/site/mmjoyproject/ Post pictures of your MMjoySetup buttons tab configuration.
AlenC Posted July 6, 2020 Author Posted July 6, 2020 Thanks for replying! I've just ordered the diodes. I wasn't sure if they are mandatory because one tutorial I've seen didn't include them. But I'll add them to entire matrix as I have ghosting occuring on switches. Is the behaviour I'm experiencing what you'd expect from build without diodes? I'm using firmware that came with v20161101 MMJoy2 (Firmware_lufa_[MMJOY2_ATMEGA32U4].hex). I've anexed my button tab screenshot and crudely drawn matrix diagram. I didn't set buttons or decoders yet in mmjoy2 setup, but all buttons and switches work properly. And in my button matrix, last row is push button function of decoder...
Sokol1 Posted July 7, 2020 Posted July 7, 2020 7 hours ago, AlenC said: But I'll add them to entire matrix as I have ghosting occuring on switches. Is the behaviour I'm experiencing what you'd expect from build without diodes? Exactly, the diodes force the current flow just in one direction avoiding the "keyboard ghost". Here is explained what happens in matrix that cause ghost. https://www.dribin.org/dave/keyboard/one_html/ Before do any test, you need set in MMJoySetup the Encoder and their Timer options and the logical buttons. For example you need define in button/switch # 1 connected in Arduino (Joystick) will press the logical button (H/W Button) #1 or any other.
AlenC Posted July 7, 2020 Author Posted July 7, 2020 (edited) So, my diodes arrived, I tested them with one encoder and I can't get any signal out of it. I tried soldering diodes both ways but it didn't work. Here's a foto of encoder connected to Pro Micro and a screenshot of MMJoy2. Am I doing something wrong? Thanks! Edit: I changed pins I use on Pro Micro to rows E6, B4 and column B5 (outer pins with diodes connected to rows and middle one to column) and now I have exactly the same situation as before. Turning encoder in any direction registers occasionally signal on hardware button 2. If I press down encoder's push button, signals are more regular, but are still both on button 2. And if I understood correctly, they should be on 1 and 2, right? Edit2: I noticed one more thing. If I set pins to which A and B terminals on encoder are connected to as columns, and middle terminar to row, I get no signal. Shouldn't it be possible to invert rows and columns? Edited July 7, 2020 by AlenC
Sokol1 Posted July 8, 2020 Posted July 8, 2020 You have set this 2 parts, the numbers that Encoder will press, and their correspondent logical buttons? Number of buttons, delay are suggestions, in right side when you select, eg. Joystick button 29 and in H/W.Button set their logical button - is need type the number, Mode and Time is automatically filled. For buttons with special functions, like encoder, toggle switches... use buttons from 1 to 32, from 33 to 128 use only for press buttons, of ON/OFF switches.
AlenC Posted July 8, 2020 Author Posted July 8, 2020 (edited) I wish I could get to this part. I'm not sure if I'm explaining my situation well... The way I have it connected now, when I turn the encoder left, number 2 lights up. If I turn it right, number 2 also lights up (although not with every step of encoder...). Should I set encoder as 2 / 2? I doubt that would work... From what I read, I'm expecting 1 and 2 to light up. I tried setting encoder number to 29 / 30 as in your example, but still no success (tested with VKB button tester). If I have connected everything correctly, I'll have to conclude that encoders are faulty... Is there some way to test them without oscilloscope? Would disassembling them help? EDIT: Encoders are faulty. I ended up testing them one by one and some work, some don't. Those that do work, light up two numbers at once in MMJoy2 setup, but once I set up encoders and save settings, they are working as expected. Although, not every click of encoder produces "button press". Is that due to low quality of encoders? I know that encoder on my GT driving force wheel also doesn't work perfectly. Is there a reliable model you would recommend? Can I do something to increase reliability? I was thinking about maybe disassembling them and applying contact spray. Anyway, the vendor will send me replacement encoders, and I still have to test them in button matrix (maybe I'll do that tonight), but I'm optimistic to be able to take this build soon to the skies! Edited July 8, 2020 by AlenC
AlenC Posted July 9, 2020 Author Posted July 9, 2020 On 7/7/2020 at 10:40 PM, Sokol1 said: For buttons with special functions, like encoder, toggle switches... use buttons from 1 to 32, from 33 to 128 use only for press buttons, of ON/OFF switches. If I may bother you a bit more, I tested the working encoders in matrix and ther're working! Yay! But when I assign push buttons to controller buttons higher than 32, I can't set shift nor timer option (I'm using a shift switch to get more functions out of my hardware), nor do they work properly in VKB Button Tester. Is this normal? Should I stick to 32 buttons? Thanks!
Sokol1 Posted July 9, 2020 Posted July 9, 2020 (edited) Yes, Encoder, toggle switches (ON-OFF-ON), timer and shift are "special buttons" - need be bellow than #33. #33 and above could be just momentary press or ON-OFF toggle switch. BTW - In the obsolete Windows Control Panel > Games Controller (joy.cpl ) you see only 32 buttons. But IL-2 Bo'X" series recognize up to 64 buttons, DCS World, X-Plane, up to 128 buttons. Instead use the (obsolete) Game Controllers for test, use VKB Button tester and VKB JoyTester. Edited July 9, 2020 by Sokol1
AlenC Posted July 9, 2020 Author Posted July 9, 2020 Yes, I used VKB Button tester, but not all buttons worked (il-2 BoX also didn't register button press). Out of 5 buttons from 33 to 37, only 2 work... It's unfortunate that this 32 button limit exists. I was hoping to double all functions with shift switch, but I'll have to limit it to most important ones. Thank you again for help!
Seethereu8047 Posted November 28, 2022 Posted November 28, 2022 May I know where can down load the MMjoy2 "Device list and configuration "Program ? Thanks for yor help .
Sokol1 Posted November 29, 2022 Posted November 29, 2022 MMJoySetup (the above screen) is included in MMJoy2 package, available there: https://sites-google-com.translate.goog/site/mmjoyproject/fajly-dla-skacivania?_x_tr_sl=ru&_x_tr_tl=en&_x_tr_hl=en
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now