Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work on ATmega32u4 on Arduino pro micro Leonardo Board #20

Open
denisn73 opened this issue Mar 20, 2019 · 27 comments
Open

Not work on ATmega32u4 on Arduino pro micro Leonardo Board #20

denisn73 opened this issue Mar 20, 2019 · 27 comments

Comments

@denisn73
Copy link

I flash chip with "adaptffbjoy-r54.hex" and it not work! Device not recognized, no device in device manager.
But arduino bootloader work perfectly, this means that the board is working.

@edcastanha
Copy link

How many reset drives are running?

@denisn73
Copy link
Author

How many reset drives are running?

what is meant?

@Dobie007
Copy link

Dobie007 commented Jan 4, 2020

The device will not be recognized if line 3 to PB5 is not connected correctly. If only the FFB does not work (sometimes) try to invert the X1 line 11 to PB4 - that solved the issue for me. I changed the Hex code accordingly. Adding capacitors did not help, i even removed the one the Joystick mainboard.

@lucaceriani
Copy link

lucaceriani commented May 17, 2020

The device will not be recognized

Do you mean that if i connect only the board without the joystick it doesn't even show up on windows?

Edit (for future reference): I built the circuit and I can confirm the joystick it's not recognized by windows until the joystick itself is connected.

@Dobie007
Copy link

Dobie007 commented May 17, 2020

Its a while ago... If I remember correctly that is the case.

@HotteX
Copy link

HotteX commented Jun 25, 2020

If only the FFB does not work (sometimes) try to invert the X1 line 11 to PB4 - that solved the issue for me

Help me out please. What do you mean by invert? Swap PB4 and 5 ? I seem to have that issue but I am a total noob when it comes to coding.

@Dobie007
Copy link

Dobie007 commented Jun 26, 2020

adaptffbjoy-r54_inverted.zip

Invert means turn a high level to a low level and vice versa. You can either change the Hex-code or use a transistor to do so.
I have added the Hex-Code - good luck!

@HotteX
Copy link

HotteX commented Jun 26, 2020

ah ok, that was the other option :D I'll give it a try right away, thanks!
Do you know where in the code the setting is hidden? I have started to make some other changes in the code that I would like to combine

@HotteX
Copy link

HotteX commented Jun 26, 2020

tried the hex....could you check if that was the right one? It behaves like a sample-hex. its not detected as Lufa JoystickwFFB and gives a periodic push upwards on the stick every second.

@Dobie007
Copy link

Dobie007 commented Jun 26, 2020

That sounds wrong - i will need to search...
Answer: Sorry, no other version on my PC and i even found the batch file for programming - it should work
I suspect your CPU is simply resseting when the stick reacts...

I am running it on the "SideWinder Force-Feedback Pro" and it works well.
The bigger problem is that the most games dont support it - best till now was Seriuos Sam HD. Steam is a pain regarding joysticks.

Here is what i did:

  • Convert Hex file to binary
  • disassemble binary with AVR tools

Then you find two sections where the port B4 is used:

at adress:
590: 9824 - CBI DDRB,4 (Clear bit 4 of port B)
595: 9A24 - SBI DDRB,4 (Means set bit 4 of port B)

and at B6D and B77 accordingly.

I simply exchanged the commands - 98 to 9A and vice versa. If you understand the Intel Hex format you can see that in the file compare...

then convert to Intel Hex again and you should get the uploaded file.

If you find the sources to the 54 version file you could do it directly in the code - but i didn't find that.

@HotteX
Copy link

HotteX commented Jun 27, 2020

I didn't even notice that the Version 54 is different from the Git-sources. I didn't find any Version besides Lufa & 3DP-Vert...where did you find the code version?

One thing I notice is, that your hex is a bit bigger than the non-inverted one.

r54 39.348 Bytes
r54_inverted 40.243 Bytes

Interesting thing: The guys over at decentbb took the code a bit farther it seems, integrating the Shift and more buttons. But they worked with the sources provided.

Hexes & Text here https://dbb.d3k.org/viewtopic.php?f=8&p=386319
Sources here https://github.com/r8dhex/adapt-ffb-joy

@Dobie007
Copy link

Dobie007 commented Jun 27, 2020

The original 54 file is in the download section of this repository: https://github.com/tloimu/adapt-ffb-joy/tree/master/downloads
If i re download and unpack my inverted version it has exactly the same size - the packed version is a little bigger ..
Use 7zip or Winzip for unpacking - the win 10 packer is not 100% compatible.
MD5 checksum: f00608d30d447aa5be53e45d08246afd

As far as i see it In ffb.c it is this section that needs to be changed: (clr <--> set for TRGX1BIT)

//------------------------------------------------------------------------------
// Trigger the stick

#define X1_pull() WRAP( {
clr_bit( TRGDDR, TRGX1BIT ) ;
clr_bit( TRGDDR, TRGY2BIT ) ;
} )
#define X1_rel() WRAP( {
set_bit( TRGDDR, TRGX1BIT ) ;
set_bit( TRGDDR, TRGY2BIT ) ;
} )

@HotteX
Copy link

HotteX commented Jun 29, 2020

I used 7Zip, thanks for the md5, I'll check my file.
Thats where I got the v54 from, I just could not find any Version number in the GIT-Sources, thats why I thought that the v54-File is the result of the sources.

Thanks for the help with finding the line in code. I'll give it a try in the evening.

Edit:
MD5 checksum matches.

Editedit:

#define X1_pull() WRAP( {
set_bit( TRGDDR, TRGX1BIT ) ;
clr_bit( TRGDDR, TRGY2BIT ) ;
} )
#define X1_rel() WRAP ( {
clr_bit( TRGDDR, TRGX1BIT ) ;
set_bit( TRGDDR, TRGY2BIT ) ;

results in a working hex (no pulsing like when I use your hex. But no FF. The stick centers and FF-Tester does not complain, but no force is applied (and spring effect is not removed when starting the app like usually.

@HotteX
Copy link

HotteX commented Aug 30, 2020

I am a bit embarrassed to tell you (but also very happy).

I found the issue with my stick loosing force feedback while playing. Inside the joystick, a pin of the power connector was broken. So usually the stick had power and worked, but the vibrations of the motors made it loose it's power for FF. Replugging usually worked, because it pushed the pin back in place.
I could beat myself with the stick for not even considering that the vibrations might have caused a physical problem. ARGH!

After 30 seconds of soldering the beast is working.

@drepou
Copy link

drepou commented Mar 8, 2021

same kind of isssue for me on arduino micro stick is well recognised all axis ok on joystick conf i feel some motor resitance but not effect works with dcs game or force test programe any advice ? i tried the inverted Hex joystick is not reconized at all with this one

How did you manage the "PD0 PB0" connection on the micro pro ??? by default the pin PB0 is not exposed to soldering pad... it's connected to a to TX led via small SMD resistor i unsolder the resitor to make the connection but still not work midi is send but ignored by FFB1 i m not sure of but it look that the X1_pull is used to init the midi protocol before effect sending. this pulse bifore midi protocol may be my issue... i will try to recompile the source code instead of using the hex provided to see if it help to solve pb with Arduino pro micro

@Hedda
Copy link

Hedda commented Apr 17, 2023

Anyone managed to port/patch latest adapt-ffb-joy to run on standard "Arduino Pro Micro" and/or "Arduino Leonardo" boards?

Related question also posted here -> #43 (and also in #38)

According to the wiki at https://github.com/tloimu/adapt-ffb-joy/wiki there was an old project making it into an Arduino library:

https://code.google.com/archive/p/sidewinder-arduino/

@ej113
Copy link
Collaborator

ej113 commented Apr 27, 2023

Yes!

I was going to try changing the pinouts to make it compatible myself but I instead stumbled across this fork by @juchong which swaps PB0 for PB6.

It also has a PCB design, flashing instructions and is forked from the JayBee-git version with the shift button function and no extra axes.
This one worked for me first time yesterday on the Arduino Micro (not Pro Micro) and I would expect it to also work on the Arduino Leonardo (although using the ICSP header pins) and Adafruit Itsy Bitsy 32u4 5V 16MHz variant based on broken out pins. LEDs are still assigned to Teensy pins so don't turn on but this is a minor change if required.

Also the original Teensy 2.0 .hex files using the PB0 pin should work with the Arduino Micro with no modification and with the Pro Micro if you solder to the LED pad.

  • See here for the Arduino Micro. I was not able to get the FFB to work but it was most likely my dodgy breadboard wiring. Note the board RX LED is still connected to the PB0 pin. I wasn't sure if this might affect the function.
  • and here for the Pro Micro Need help for arduino pro micro solution found !!! #35

@MacGH23
Copy link

MacGH23 commented Mar 3, 2024

I just tried to get the Micro Pro working.
In general is is working.
The joystick is connected and all Axis and Buttons working, but it is initialized with
FFB effects on and center it. The FFBtest program don't work.
Like #20 (comment)
The teensy 2.0 I also have is working without problems.

@ej113
Copy link
Collaborator

ej113 commented Apr 6, 2024

Sounds similar to #56. Maybe capacitors?
I've just added a troubleshooting guide to the Wiki. Have a look and see if anything there works for you.

@MacGH23
Copy link

MacGH23 commented Apr 13, 2024

I try 1nF upto 10nF in small steps.
Nothing worked.

@Zyzyme
Copy link

Zyzyme commented Apr 17, 2024

Report: I have two joysticks #96755 device (no fan) and 96755 device (with fan),
#96755 Device (no fan) Force feedback works on 1NF
#96755 Device (with fan) Force feedback works on 2.2NF

@MacGH23
Copy link

MacGH23 commented Apr 17, 2024

Is this the right schematics for it ?
https://github.com/juchong/adapt-ffb-joy/tree/master/pcb

@Zyzyme
Copy link

Zyzyme commented Apr 17, 2024

Is this the right schematics for it ? https://github.com/juchong/adapt-ffb-joy/tree/master/pcb

I have Teensy 2.0 and Pro Micro working fine on v0.5.0beta1
I made a picture, you can check it out
pro_micro_pinout

@MacGH23
Copy link

MacGH23 commented Apr 17, 2024

Thanks.
PD0 and PB6 are connected - right (Pin 3 and 10) ?

@Zyzyme
Copy link

Zyzyme commented Apr 17, 2024

Thanks. PD0 and PB6 are connected - right (Pin 3 and 10) ?

Yes (PIN3 and PIN10)
https://golem.hu/article/pro-micro-pinout/

@MacGH23
Copy link

MacGH23 commented Apr 17, 2024

Thanks, Then I check all again

@MacGH23
Copy link

MacGH23 commented May 23, 2024

I found the problem.
The model of the arduino in my CAD program was wrong and it mixed the wires to the wrong pins.
I made a new PCB and now it is working, but only 20%.
Need to replug many times before it is working.
I try different capacitors the next weeks
Edit1:
Made some test during the weekend.
2,2nF is too small, with 2x 1,5nF = 3,0nF for each pin it is working very good.
Edit2:
3,3nF is working perfectly with the MicroPro-USB-C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants