Jump to content
Sign in to follow this  
Guest

How to talk to FS with USB

Recommended Posts

Guest

Does anyone have a link to the specs for talking to FS via USB?? I want to build a yoke/throttle/pedal system and talk to the USB with a micro controller. I am looking for the specs as far as message formats, timming etc. Anyone happen to stumble onto this infor?? Thanks MIke B.

Share this post


Link to post
Share on other sites
Guest

You can go 2 ways:1) you rip a usb joystick an build your own controls based on the ripped joystick's electronics2) you study usb and vbasic/c++ and both make an electronic card and a software.I would go the 1st way.If you're really interested, i can try to find a link i forgot to a testing platform for usb, based on a 16F877 Microchip Microcontroller and a USB interface.Or you can wait till Microchip releases its new uC with usb on board.Regards

Share this post


Link to post
Share on other sites
Guest

Ok thanks. What I am looking for is the message format for telling FS what the current position of the controls, switches etc. I know how to do the electronics, just need the specs on how to yak with FS.. Thanks Mike B.

Share this post


Link to post
Share on other sites
Guest

That's not directly possible.Again you have two choices:1) build a joystick driver from scratch (a windows device driver, to make it clearer)2) as i said before: use a working usb joy, rip it apart and rearrange the pots.Are you telling me that you want to develop a custom device driver?If so i can't be of any help, i don't know anyting about it.Regards

Share this post


Link to post
Share on other sites
Guest

"That's not directly possible"... Of course its possible, otherwise how do you explain add on joysticks/yokes/rudder pedals/avionics etc, etc..??? Somewhere there has to be a spec for manufacturers to refer to in order to properly comminucate with Flight Sim. EPIC is a good example as they need to know what format to put the messages into before they send the serial data to FS.. The SPEC is what I am looking for, and yes I will likely write my own drivers. As long as you mentioned ripping apart a joystick do you happen to know if Windows/flight Sim would support 2 identical yoke/throttles (USB)and one rudder pedal assembly?? I'm looking for a second CH USB yoke to try that but as yet nobody I knnow around here has one to borrow?? If the above 2 yokes work in FS then that might indeed be a viable soultion as that would give 24 buttons, 2 throttles, 2 prop controls and 2 mixtures all without having to get out the soldering iron (Well, not really ). By the way, I have already taken the CH USB yoke and converted it to a column type control. I relocated the pitch "pot" to the base of the column. The roll stuff and yoke itself I mounted in an aluminum box on the top of the column. To center the column (fore and aft) and give some "feel" I got a couple of gas shocks that hold up the rear window on hatch back cars. It has a very nice feel now. Before the yoke column would flex when using only the left hand to fly and cause the yoke to feel sticky. That problem is now gone. Very easy stuff. Thanks. Mike B.

Share this post


Link to post
Share on other sites
Guest MikePowell

Mike,While I am not certain about this, I believe that EPIC is simply a keystoke emulator. I do not think that it communicates with FS other than by injecting keystroke messages into the windows messaging stream that FS interprets as regular keyboard activity. The USB EPIC version likely has a USB driver that communicates only with the EPIC card and, as the older version, sends windows messages emulating a keyboard. This makes EPIC and any keyboard emulator transparent to FS and indeed allows them to function with any OS or keyboard driven sim.Interfacing to FS through USB is probably more a question of how to write a joystick driver than one of how FS works. FS will accept a large number of joysticks, so there would seem to be many possibilities. On the Microchip site in the application notes section is a note titled "An Introduction to USB Descriptors - With a Gameport to USB Gamepad Translator Example" TB054. While I don't know if it will answer your questions, it looks like a possible starting point.http://www.microchip.com/1010/suppdoc/appn...alpha/index.htm Mikewww.mikesflightdeck.comInfo for simpit builders

Share this post


Link to post
Share on other sites
Guest

>"That's not directly possible"... >> Of course its possible, otherwise how do you explain add >on joysticks/yokes/rudder pedals/avionics etc, etc..??? Sorry but you are wrong.Add on joystick/yokes/rudder pedals are made exactly as your self-built column yoke.There is an electronic circuitry that communicates with a windows joystick driver.The information provided by the driver are generally accesible throughout the system, and FS does access those information.Add on like PCF controls, are custom made electronics, interfaced through COM or usb.Which than speak to a custom driver, which than speak to a FS interface like FSUIPC.I'm sorry but the only simple way to build controls is use standard joysticks, both joy-port or usb.The epic as far as i know, does inject the values detected via FSUIPC or EPIC.dllIt does not simulate a system-wide joystickRegards

Share this post


Link to post
Share on other sites
Guest

Ok, thanks. I guess I'll close my business up after 35 years cause it can't be done, oh well.. Mike B.

Share this post


Link to post
Share on other sites
Guest

Ok Mike !! Now were talking.. This web site (MicroChip) looks like the answer to my questions.. Thanks a million.. By the way, your web site is also VERY informitive, lots and lots of good stuff there. As a siide note, I was kicked out of "It can't be done school" ! Mike B.

Share this post


Link to post
Share on other sites
Guest MikePowell

Claudio,Thanks for the correction. I am made a tentative assumption about EPIC that was mistaken. Good to have the facts.Mikewww.mikesflightdeck.comInfo for simpit builders

Share this post


Link to post
Share on other sites
Guest

>Ok, thanks. I guess I'll close my business up after 35 >years cause it can't be done, oh well.. >> Mike B. We simply don't want to understand.What do you mean by "a simple way to tell fs the position of the yoke"?I mean:a simple way to implement a custom-made yoke.This then means:you take a joystick, rip it apart, and rearrange it in a custom-made yoke.This way you recycle both the electronics and the software.Other ways you can go:using a microcontroller (istated microchip well before, and i also stated than in a near future MC is going to release a microcontroller with on-board USB) AND a USB signal transducerThis however means that you know the format and the codes to have your custom device recognized by windows as a joystick.using the same electronics you find on joysticks: yet simple but most difficult, because those components are highly integrated and specialized devices, and are sold to big companies in big stocks... not like to be found at the corner shop...make your way through a deep, not very document programming work, to build your OWN driver for your OWN electronics.I keep telling it's very difficult, don't know your knowledge and skills, but it is anyway really difficult.Since you asked this question in order to build yoke,throttle and pedals, i answered with simplest,easiest,fastest and most reasonable way to achieve this goal: just collect some joystick and use the electronics in your setup.FS automatically recognizes windows joysticks, so it's the easiest way.Again you tell me i don't understand and you want to PUT VALUES IN FS.Why that?Why should you go the complex way of program and inject descreet values?Why should you bother yourself with A/D conversions,data transfer, and the likes when a simple joystick (both gameport ot usb) does all this by itself?You still want to do this even knowing that with a 5

Share this post


Link to post
Share on other sites
Guest

>Claudio, >>Thanks for the correction. I am made a tentative assumption >about EPIC that was mistaken. Good to have the facts. No Mike, those are not "the facts"It's an assumption on my side, done with the following considerations:Epic (i seem to remember) can control a number of analogic inputs in the tens (12? 16? don't remember).Simply getting the values, is a matter of an A/D (analogic to digital converter) chip.But simulating 16 analogic inputs in windows, is another fact.I don't have the necessary information to say how and if it can be done without requiring an absurd cpu power, thus reducing resources available for programs.But I know there is a way (since the old FS IPC which is the precursor of FSUIPC) to inject values in FS.Like you do for, say, comm1: you send via the provided (by Peter Dowson) Dll a value to an address, this address can also be what in normal use is an axis.This means you can send a value (say 12384 which is a 75% of the totale 16384) to a variable, which is interpreted as an axis.If you send this 12384 to the throttle axis, you will set the engines to a global 75%.But this is what i call a complex solution to a simple problem.Why should you do that when you can do what i said before?I think epic does exactly the above: send values to FS.I don't know exactly, but it seems to me the most resonable thing to do.I may well be in error.If this is the case, sorry.Anyway, our friend has, generally speaking, two ways to go:what I call SIMPLE: recycle a working joywhat HE call SIMPLE: building a joy with its driver completely from scratch.His choice.Best regardsClaudio

Share this post


Link to post
Share on other sites
Guest MikePowell

Your assumptions seem well founded, Claudio. Analog inputs other than simple mouse movement events do seem rather too complex to be injected through the Windows message system. I had been thinking only of switch events that map directly to key strokes, an oversight on my part.Mikewww.mikesflightdeck.comInfo for simpit builders

Share this post


Link to post
Share on other sites
Guest

You are making some invalid assumptions my friend, you assume all I am interested in is simple throttle interfaces. Perhaps I have something else in mind hence the need for the SPEC required to talk to FS, and by the way, I found the required info, thanks for your "help". Mike B.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...