Arduino only-based adapter (no PC needed)

Discuss everything to do with GIMX here
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

This mini USB host module is like you said only 3.3V compatible. Therefore you need extra hardware to protect the input's of the MAX3421E. A 74HC245 will do, or perhaps a resistor divider on each CLK,MOSI,CS pin.

The Arduino pro micro's that i have are 5V/16MHz. When you run them at 3.3V, only 8MHz is allowed by ATMega32u4. You will need another bootloader that is aware of this 8MHz to have correct timings. I have no clue if 8MHz is enough to handle the USB packets fast enough (SPI Clock reduced/2, processing power reduced / 2)
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

well setting the correct freq, is pretty easily done in the ide. but yeah it might not be able to handle the usb speedwise.

As a sidenote i'd think that the black pill (same as blue pill but with working usb) would be better suited for a production of these gimx lite adapters as they run 3.3v native, with some ports being 5v tolerant.
they're also about half the cost. They run at 72 mhz out of the box and can handle interrupts pretty fast (made a button box with 3 rotary encoders which it handles perfectly)

I should have access to a 74hc245 or be able to make a level shifter somehow.

I just ordered 2 of those mini hosts.

Are you willing to share the code at some point? maybe Matlo, will give you his blessing to reuse his code?

btw im quite excited about this project as it would go hand in hand with my simeacer build :D
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

I've sent matlo a message with access to the code, so he can check it. I dont want any legal issues about re using code, so it is up to him ;)
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

yes ofcourse :D
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Well i have to check the sources a couple of time to make sure all the gpl,mit, etc licenses are not violating with each other (why did i thought using libraries make it simpler?!). I'll put it somewhere on a github. It will get a non-gimx related name, as its not using the gimx software on pc.

Link will follow
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

Well technically, could'nt you get around that by just referring to the libraries, without including the libraries themselves on git?
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

Of course,

Today i tested the hardware for some serious laps and noticed sometimes the forcefeedback doesnt reset (e.g. When restart timed lap) I'll check if all packets arrive for debug. Also want to do a latency test to obtain lowest time possible.

Currently iam passing the packets from the wheel directly to the PS4. This means i dont buffer them for a 250Hz framerate. Sometimes the with no or less movement, less packets.are needed. Otherwise, with heavy corners, packets are sent more often then 4ms appart.

Oh, and i like to add some G27/G29 RPM LED support. I am thinking of an WS2812 ledstrip. Its easy to interface, only require one I/O and only require about 30uS time to configure per LED. This way there wont be much latency added to the wheel reports itself.
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

Which game was that in? im thinking that it could be related to that?
A test like that would be nice, so that you can eliminate any unnecessary delays :D

4ms seems like a fair max limit, but ofc. lower is always better.

I was thinking the exact same thing... but many steps further.
What if you/we/whomever made all these juicy G29 FFB addresses available for people to connect to whichever pins they desire.
maybe offload them via i2c, spi or whatever) for another controller to handle. (i know it requires a lot more cpu power)
so that you could for example make a brake rumbler that actually uses the proper feedback.
Or a sim racing rig that tilts accordingly?

if/when (i do hope when) you release the code, i'd like to try to port it to one of my black pills
and see if that could do some funny stuff on my rig which im currently setting a controller up for, to control some actuators for seat tilt and leg lenght (moves the pedals, wheel and shifter to/from the seat)
ThijsNL
Posts: 24
Joined: Mon May 06, 2019 5:43 pm

Re: Arduino only-based adapter (no PC needed)

Post by ThijsNL »

I've put the sources here.

https://github.com/mathijsvandenberg/g29emu

Disclaimer: this has nothing to do with GIMX. It is using parts of GIMX sources, but is not and will not be compatible with GIMX.
Disclaimer2: This is a work in progress.
Mysli0210
Posts: 18
Joined: Thu Jul 06, 2017 7:10 pm

Re: Arduino only-based adapter (no PC needed)

Post by Mysli0210 »

Neat!

Thijs, i thought that you got the auth working without a controller? or was that just me daydreaming :D
Post Reply