Jump to content

Major Announcement: New software to to connect panels to DCS


Recommended Posts

Posted

@dirkr. When you say the accuracy decreases to a forth I'm not sure how I should interpret that in physical movement of the pot vs reported values. Can you expand on that statement as to what exactly you could expect after implementing the code.

 

Yes, sure. Maybe precision is the better term. The Arduino reads 1024 different analog values as 0,1,2,3,...1024. With the code above you would get 0,4,8,...1020 instead, which means that you effectively get 255 different values across the total physical movement. For me this doesn't matter as my pots anyway do not have this precision.

 

When reporting to DCS the value is multiplied with 64, so the final values are 0, 256, 512, 768 ... 65280.

 

Dirk

  • Replies 398
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)

Hey guys, I'm almost done with the code and circuit but I've stumbled on an issue. Remember the problems that were solved by lowering the baud rate to 115k? I'm encountering them again even with 115k baud. It seems as if I am overloading the transfer of output data. Changing the baud rate or in game speed or just the amount of data exported by turning avionics off in-game has a direct effect on my leds and 7segment displays. Physically turning off the displays or the leds also has an impact, as in the less stuff I have connected the better it works. For example just two MAX7219 (total of 12 digits) works fine. 3 chips (18 digits) does not. But the two MAX that worked fine by themselves will get all weird if I turn the individual leds on (gun ready, cockpit open etc etc).

 

Inputs seem unaffected.

 

I will post the code but it's big and clumsy if someone wants to take a look. I can break it down in smaller chunks tomorrow.

 

Here is code http://pastebin.com/FXgd5Kut

 

There's bound to be mistakes in the commenting, it's not done yet.

Edited by Felm
Posted
Hey guys, I'm almost done with the code and circuit but I've stumbled on an issue. Remember the problems that were solved by lowering the baud rate to 115k? I'm encountering them again even with 115k baud. It seems as if I am overloading the transfer of output data. Changing the baud rate or in game speed or just the amount of data exported by turning avionics off in-game has a direct effect on my leds and 7segment displays. Physically turning off the displays or the leds also has an impact, as in the less stuff I have connected the better it works. For example just two MAX7219 (total of 12 digits) works fine. 3 chips (18 digits) does not. But the two MAX that worked fine by themselves will get all weird if I turn the individual leds on (gun ready, cockpit open etc etc).

 

Inputs seem unaffected.

 

I will post the code but it's big and clumsy if someone wants to take a look. I can break it down in smaller chunks tomorrow.

 

Here is code http://pastebin.com/FXgd5Kut

 

There's bound to be mistakes in the commenting, it's not done yet.

 

Are you running several displays from one Arduino board? If you use several boards on different com ports would the same be happening?

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted
Hey guys, I'm almost done with the code and circuit but I've stumbled on an issue. Remember the problems that were solved by lowering the baud rate to 115k? I'm encountering them again even with 115k baud. It seems as if I am overloading the transfer of output data. Changing the baud rate or in game speed or just the amount of data exported by turning avionics off in-game has a direct effect on my leds and 7segment displays. Physically turning off the displays or the leds also has an impact, as in the less stuff I have connected the better it works. For example just two MAX7219 (total of 12 digits) works fine. 3 chips (18 digits) does not. But the two MAX that worked fine by themselves will get all weird if I turn the individual leds on (gun ready, cockpit open etc etc).

 

Inputs seem unaffected.

 

I will post the code but it's big and clumsy if someone wants to take a look. I can break it down in smaller chunks tomorrow.

 

Here is code http://pastebin.com/FXgd5Kut

 

There's bound to be mistakes in the commenting, it's not done yet.

 

 

You will probably have to wait for the planned overhaul of the Arduino library internals for something like that to work. When I wrote the current version of the Arduino library, I simply did not consider what would happen once people connected multiple things that take some time to update (like graphic LCDs or MAX7219 chips) as opposed to the near-instant toggling of a LED output pin. I just assumed that there would be one Arduino board per panel.

 

Now several people seem to try to connect as much stuff as possible to a single Mega 2560 to avoid having to deal with multiple Arduino boards (which I admit does not have an elegant solution either at the moment). There is nothing wrong with that, but it requires an Arduino library that is designed to deal with it.

 

Together with Gadroc, I have already come up with an architecture for the Arduino library that should solve these problems. Unfortunately, my programming time right now is severely limited so I probably won't be able to work on this for a few weeks.

Posted

Thanks for the replies guys. Yeah all of that is connected to a single UNO. I'll try using more arduinos in a bit to see if it solves the issue. I have two megas sitting around unused.

 

To be honest it was fun building the circuits and coding but I'm getting a bit burned out with the project right now. If I just need to use more boards I'll order some pro-minis from aliexpress and be done with it. It defies the point of working on all those shift registers and circuitry/code but hey, whatever works !

Posted (edited)

nope, no luck when using separate arduinos. Now I can't even get two dislays to work properly, only one !

 

Warhog I've seen that you are also using max7219 with 7segs for radios, how is that working out for you? same issues?

 

EDIT: did some more testing. one max7219 with 6 digits on a mega and 3 74hc595 with 24leds (not all of them in use, not even close) on the UNO seems to work fine. If I add the 74hc165 chain to the UNO then the leds lag and skip. the max7219 works fine and there's no delay between turning a rotary encoder (connected to the 74hc165) and seeing the output change on the 7 seg.

 

If I connect the max7219 (only one enabled, 6 digits) and 74hc595 leds to the mega and the 74hc165 to the uno, everything seems to work fine. I tried to see if the led I have set as master caution syncs with the one in game, it seems a tiny bit behind/off sync but that might just be me. Not an issue at all at this point.

 

 

Not so sure what to do now....

Edited by Felm
Posted
nope, no luck when using separate arduinos. Now I can't even get two dislays to work properly, only one !

 

Warhog I've seen that you are also using max7219 with 7segs for radios, how is that working out for you? same issues?

 

EDIT: did some more testing. one max7219 with 6 digits on a mega and 3 74hc595 with 24leds (not all of them in use, not even close) on the UNO seems to work fine. If I add the 74hc165 chain to the UNO then the leds lag and skip. the max7219 works fine and there's no delay between turning a rotary encoder (connected to the 74hc165) and seeing the output change on the 7 seg.

 

If I connect the max7219 (only one enabled, 6 digits) and 74hc595 leds to the mega and the 74hc165 to the uno, everything seems to work fine. I tried to see if the led I have set as master caution syncs with the one in game, it seems a tiny bit behind/off sync but that might just be me. Not an issue at all at this point.

 

 

Not so sure what to do now....

 

I haven't had a chance to get it running as I ran out of Pro Mini's:music_whistling:. Got 10 more on order though they're coming from China so I imagine it will be 2 weeks yet.

 

What I do have running is the ILS with a 7 seg display and a 7219 in it and the UHF repeater also uses 7 seg display with a 7219. They both seem to work fine. I haven't had all of my panels wired up yet as I'm getting the front dash put together. I did have one very odd situation which I haven't had a chance to explore yet. I was calibrating 2 servos for the r & L Fuel tanks/gauge and when one was running everything was good but I couldn't get both of them to work properly at the same time. Not sure why yet. I just seem to keep running out of time and nothing gets completely finished.

 

I won't be able to look at the 7219 issue for a little while but as soon as those Pro Mini's get here I will get them all up and running or be on here asking for help.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted

Hmm, interesting. Are the max7219 you are using for the ILS and UHF repeater chained together? Or each one goes to a separate pro mini? My 3 max7219 are chained together, maybe that has something to do with the issue?

Posted (edited)
Hmm, interesting. Are the max7219 you are using for the ILS and UHF repeater chained together? Or each one goes to a separate pro mini? My 3 max7219 are chained together, maybe that has something to do with the issue?

Separate.

 

Are you using the cheap chinese 7219 chips? I have had a couple of chips that didn't function properly. Have you tried a different set of 7219 chips? It the easiest thing to try first just in case. At least you eliminate one possibility without expending a great deal of effort.. I must admit that it bothers me that Chinese 7219 are less than a dollar a piece yet N.American and European sources are ten times that price. Why?

 

 

This might be a silly question but have you installed decoupling capacitors .1uF and 10uF at each chip?

Edited by Warhog

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted (edited)

yeah I got them from china. It says maxim on them but they are probably fakes. I'll try new ones but I dont have high hopes for that fix since they work fine when it's only one that is processing data from dcs.

 

Then I'll try unchaining them, maybe it's a signal propagation thing although it doesn't feel like one...hell it could even be the ledcontrol library that doesnt play nice with dcsbios.

 

once I have them unchained I'll also try one 7219 per arduino, it seems my best bet right now since you can run 2 of them on separate boards with no issue

 

I put decoupling caps on all the chips I use so it's not that unfortunately

 

Totally agree with the pricing thing, if I had to buy all my stuff from European retailers I'd probably never have gotten in to electronics in the first place. On the other hand some stuff is worth paying more for better quality, especially tools etc. Digikey and mouser do have good prices though, pity the shipping kills it if you are not in the US

Edited by Felm
Posted
yeah I got them from china. It says maxim on them but they are probably fakes. I'll try new ones but I dont have high hopes for that fix since they work fine when it's only one that is processing data from dcs.

 

Then I'll try unchaining them, maybe it's a signal propagation thing although it doesn't feel like one...hell it could even be the ledcontrol library that doesnt play nice with dcsbios.

 

once I have them unchained I'll also try one 7219 per arduino, it seems my best bet right now since you can run 2 of them on separate boards with no issue

 

I put decoupling caps on all the chips I use so it's not that unfortunately

 

Totally agree with the pricing thing, if I had to buy all my stuff from European retailers I'd probably never have gotten in to electronics in the first place. On the other hand some stuff is worth paying more for better quality, especially tools etc. Digikey and mouser do have good prices though, pity the shipping kills it if you are not in the US

 

I was also reading that a lot of the chinese 7219 required delays in the code to work properly. I'm talking 20ms or so especially on power up. It lets them stabilize before they start working with incoming data. That could be misinformation but they said it worked and I found that in several posts in other forums I was reading. Maybe as a last ditch effort. Nothing to loose trying it.

 

I also read that a majority of the chinese 7219 clones worked well although sometimes a little quirky so its a good idea to have a bunch on hand just in case you do need to swap out chips. When you look at prices, whats an extra $5 for 10 more. Its insurance. I just ordered another 10 for good luck.

 

How about the 20x2 LCD displays...any problems with those reading the same data?

 

you can run 2 of them on separate boards with no issue

 

Do you mean 2 - MAX7219's connected to one Arduino board or one MAX7219 per Arduino board running 2 boards, each on a separate com port displaying different sets of data?

 

 

 

 

 

 

.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted

Do not know if you already are, but always use decoupling capacitors connected to V+ and GND of any/all IC's you are using. Usual value is 0.1uf which is same as 100nf, cheap ceramic types are fine. Connect the capacitor as close as you can to the IC.

Posted

How about the 20x2 LCD displays...any problems with those reading the same data?

 

John I could not get mine to work at all on arduino and mega, they were not cheap lcd's, think I paid over 20 uk £ each and I could not make head nor tails out of the information pdf, I thought I was over-volting them until I spoke to Hans and he pointed me in the right direction, I was actually under-volting them, just for others information, dont give up. I have a DC generator box thingy 0-35 volts dc, auto amping, they actually take 10.1 volts before any information shows. Sorry if this is a tangent, just thought should let peeps know, says 5v, supposedly takes up to 7v safely, but realistically it takes 10.1v.

 

weeb

Windows 7 64 Home Premium, i5 3570K (3.4 @ 4.4GHz), Asus P8Z77-V LX, 16GB dual channel 1600 ram, EVGA Nvidia GTX980ti, 240 GB OCZ SSD, 3 TB Raptor, Thrustmaster Warthog Hotas and Throttle, Saitek Pro Combat Rudder pedals.

Posted
How about the 20x2 LCD displays...any problems with those reading the same data?

 

John I could not get mine to work at all on arduino and mega, they were not cheap lcd's, think I paid over 20 uk £ each and I could not make head nor tails out of the information pdf, I thought I was over-volting them until I spoke to Hans and he pointed me in the right direction, I was actually under-volting them, just for others information, dont give up. I have a DC generator box thingy 0-35 volts dc, auto amping, they actually take 10.1 volts before any information shows. Sorry if this is a tangent, just thought should let peeps know, says 5v, supposedly takes up to 7v safely, but realistically it takes 10.1v.

 

weeb

 

So even after all that they didn't work? Mine worked really well. Three different sizes and every one worked perfect.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Posted
So even after all that they didn't work? Mine worked really well. Three different sizes and every one worked perfect.

 

They work now John, I was kicking myself, what was I doing wrong? It must be me!. I was trying to work through the wiring diagram but as Janis says it's totally new to us, so i stumbled on until I asked Hans. I was scared to put 10 volts through an arduino, but now I know they are quite happy with that voltage. Don't heat up much, it was a learning process for me, totally, I had got 2 x 16 working no problems but I could not even get hello world out of the 2 x 20. You just got to cut us noobs some slack. We learn as we go along bro.

 

weeb

Windows 7 64 Home Premium, i5 3570K (3.4 @ 4.4GHz), Asus P8Z77-V LX, 16GB dual channel 1600 ram, EVGA Nvidia GTX980ti, 240 GB OCZ SSD, 3 TB Raptor, Thrustmaster Warthog Hotas and Throttle, Saitek Pro Combat Rudder pedals.

Posted

how to config several arduino boards with DCS-BIOS in DCS game ?

 

such as:

 

CDU - press key * 1 uno R3

 

CDU - display * 1 Mega2560

 

UFC * 1 Mega 2560

 

... other panel...

Posted (edited)

Ian,

 

Thanks very much for posting this great package.

I just got this to work with my Arduino and I'm very happy looking forward to all the great panels I'm going to build with this.

 

For your consideration, I plunged immediately ahead and did the following:

Since I don't particulary like having black CMD screens open while running DCS,

I turned the connect-serial-port.cmd into a background service.

 

And, surprisingly, this works very nicely. It now boots with Windows and the DCS- Arduino connection is just there all the time without any manual action.

 

I used some simple freeware tools only. Here's the recipe:

 

connect-serial-port.cmd -> (rename) -> connect-serial-port.bat -> (BAT2EXE) -> connect-serial-port.exe -> (RunAsService (run as admin) ) -> DCS-BIOS service.

 

Please try for yourself: to me this seems like quite a clean way of setting things up.

 

Thanks again for your great work.

 

Hollywood

Edited by Hollywood_315

There is no spoon.

 

Avatar_old_80x80.gif.0c105925ce4b9f5b87697ea37cbde317.gif

VAICOM PRO plugin for DCS World

www.vaicompro.com

Posted

After unplugging and replugging a simple stop/start cycle for the service brings the connection back. This can be done manually via Task manager but you could make batch files also that do the trick. Quite straightforward either way.

 

Ian;2348550']How does this setup handle unplugging and replugging the board?

There is no spoon.

 

Avatar_old_80x80.gif.0c105925ce4b9f5b87697ea37cbde317.gif

VAICOM PRO plugin for DCS World

www.vaicompro.com

Posted

I have a question, maybe someone here will know:

 

When I map MASTER CAUTION to a LED 9 connected to my Arduino Uno, it blinks when it's supposed to but irregularly. It seems to suffer from some kind of stutter, whereas in the sim this is a tight steady pulse.

 

PC performance is defo not the issue this is fully up to spec. I took the Arduino from behind a hub to plug directly in the PC but this makes no difference. I use standard example sketch.

Any ideas on what might be causing this are welcome. It would be helpful to see somewhere the number of updates per second that are sent to the Arduino, can I find this somewhere?

 

Inputs appreciated.

There is no spoon.

 

Avatar_old_80x80.gif.0c105925ce4b9f5b87697ea37cbde317.gif

VAICOM PRO plugin for DCS World

www.vaicompro.com

Posted (edited)
When I map MASTER CAUTION to a LED 9 connected to my Arduino Uno, it blinks when it's supposed to but irregularly. It seems to suffer from some kind of stutter, whereas in the sim this is a tight steady pulse.

 

The cause is probably that the data is buffered somewhere, either by the driver for your virtual COM port or by the USB-to-serial converter on the Uno.

 

If you look at the

, there is an "Update Counter" which increases with every export data update. DCS-BIOS aims for 30 updates per second.

 

Take a look at the Master Caution light data in the interactive control reference. It should also "blink" steady, confirming that the stutter is introduced on the way from the PC to the Arduino board.

Edited by [FSF]Ian
Posted

I have created a new thread where I will post announcements of new releases.

 

The first post will become a constantly updated overview of DCS-BIOS and related resources. Once I have fleshed that out a bit, I will ask a moderator to sticky that new thread instead of this one.

 

I would like to retire this thread, because too much useful information has become buried deep inside this 35-page monster. It does not help much to remember that the answer was "somewhere in the DCS-BIOS thread", especially when discussion of multiple different issues is interleaved from time to time.

 

Let's try to have one thread per separate issue or question from now on. To take over the general discussion and feedback from this thread, I have created the DCS-BIOS Discussion Thread.

Posted

I believe you're right - problem seems buffer related. The export frequency from DCS is just fine. When I reduce the buffer size in Windows settings for the Arduino device COM port the number of hickups seems to diminish drastically. I will try lowering baud rate also to see if it perhaps leads to less buffer congestion. Thanks for the useful feedback.

 

Ian;2356614']The cause is probably that the data is buffered somewhere' date=' either by the driver for your virtual COM port or by the USB-to-serial converter on the Uno.[/quote']

There is no spoon.

 

Avatar_old_80x80.gif.0c105925ce4b9f5b87697ea37cbde317.gif

VAICOM PRO plugin for DCS World

www.vaicompro.com

  • Recently Browsing   0 members

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