Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

Just wanted to post a quick update because it has been quiet for a while.

 

I currently have master caution LEDs blinking on two Arduino boards that are connected over RS-485 to a USB-to-RS-485 adapter (only because I don't have one of those yet, I have programmed a TI Launchpad with a connected RS-485 transceiver to act like one instead).

 

The next step is to implement a protocol in the Arduino library and on the PC side that coordinates which board is allowed to transmit when, so I can get inputs working.

 

I am also reading up on the electrical design of RS-485 buses. So far, my test setup is working without termination (because my total bus length is maybe 10 cm) and without any biasing (which confuses me a little, maybe I am just lucky).

Link to comment
Share on other sites

  • 1 month later...

Hi Ian, how can i use DCS-BIOS to export CDU Display to my TFT.

 

My Android is UNO R3 and TFT is 3.6 ft,

 

I dont know to to use following code:

 

void onCduLine0Change(char* newValue) {

/* your code here */

}

DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change);

Link to comment
Share on other sites

Hi Ian, how can i use DCS-BIOS to export CDU Display to my TFT.

Depends on what device your TFT is connected to and the type of connection (component video, HDMI, I2C, SPI, some parallel data bus, ...).

 

My Android is UNO R3 and TFT is 3.6 ft,

That is conflicting information. Are you using an Android phone or an Arduino UNO R3 board? Also, what type of TFT display do you have, how is it connected and what controller chip does it use?

 

I dont know to to use following code:

 

void onCduLine0Change(char* newValue) {

/* your code here */

}

DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change);

 

If you are using the DCS-BIOS Arduino library, you would replace the "your code here" comment with code that puts the 24-character string in the "newValue" variable on the first line (line 0) of your TFT display.

 

I don't know if an ATMega controller running at 16 MHz would be fast enough to run a CDU display (I have my doubts, but I have never tried). You may also be interested in agrasyuk's CDU build using a Raspberry Pi running a script written in Python.

Link to comment
Share on other sites

RPM output to com port/arduino

Can someone shed some light on doing this, or point me to some info?

Thanks Yall..

 

Go to http://dcs-bios.a10c.de and read the User Guide. Then look up the gauge you want in the Control Reference.

 

If you want a more specific answer, we need more context. What have you read/tried before? Where did you get stuck? What specific gauge (in which aircraft) do you want?

Link to comment
Share on other sites

I have built a piece of hardware for simulating the engine RPM vibrations of the aircraft You are "flying" within the sim. Its made to shake your home cockpit, chair, or desk desk. I'm calling it the SimShaker or RPMulator. I have prototyped and tested it, and now I'm done with the physical fabrication and software all that I have left to do is solder the wires and it will be complete. Then I have to make it receive rpm data from the sim and I have no idea how I'm going to do this. LOL (maybe should have done this first).

Any suggestions or advice is welcomed!!

 

Whatever port the Ardiuno is on needs rpm info from the left and right A10c engine. don't know if I need to push or pull the data. but I think a piece of software needs to be in the middle, (read rpm from sim then write, send, or make available to arduino)


Edited by FatSlapper
Link to comment
Share on other sites

Follow the DCS-BIOS User Guide until you have the Master Caution Light example running (to set up DCS-BIOS and verify that it is working). Since you have programmed an Arduino board before (so the Arduino IDE is already set up), that will probably take less than half an hour.

 

Next, start with a fresh TemplateSketch and look up the A-10C's RPM gauges in the Control Reference (switch it to "Advanced" view). You want to copy the "generic" code examples to your onDcsBiosWrite() function so it looks like this:

 

void onDcsBiosWrite(unsigned int address, unsigned int value) {
 if (address == 0x10a2) {
   unsigned int lEngFanValue = (value & 0xffff) >> 0;
   /* your code here */
 }

 if (address == 0x10a4) {
   unsigned int rEngFanValue = (value & 0xffff) >> 0;
   /* your code here */
 }

}

 

Then replace the /* your code here */ comments with code that does something to the value (probably save it to a global variable to use in subsequent calculations).

Note that "(value & 0xffff) >> 0" is a no-op, you can also use "value" directly here. The control reference JavaScript is not smart enough to notice this yet.

 

To look at what values DCS-BIOS sends you (it remaps the numbers it gets out of DCS to a range of 0 to 65535 because 16-bit integers are easier to work with on microcontrollers than floating point numbers), you will want to set up the

Google Chrome extension.
Link to comment
Share on other sites

While trying to compile:....

 

Arduino: 1.6.4 (Windows XP), Board: "Arduino Uno"

 

dcsbiosarduinolibrarymaster\Protocol.cpp.o: In function `DcsBios::ProtocolParser::processChar(unsigned char)':

C:\Documents and Settings\JLenart.DELL09\My Documents\Arduino\libraries\dcsbiosarduinolibrarymaster/Protocol.cpp:64: undefined reference to `onDcsBiosFrameSync()'

collect2.exe: error: ld returned 1 exit status

Error compiling.

Link to comment
Share on other sites

Hi all,

 

I have re-designed my whole cockpit to DCSBIOS. (Gremlins A-10) and it works very well. I redesigned the arduino part of the software to use it with some I2C portexpanders (MCP23016). You can use 8 of these on your I2C bus, and each has 16 I/O pins. So one arduino can use up to 128 Inputs or Outputs on top.

For my cockpit I use 5 Arduino Megas with Ethernet Boards to connecting the hardware to the sim. Have finished this way all consoles with all supported functions.

If anyone is interested in connecting DCSBIOS to I2C devices, please contact me.

Will shortly send some pics in my building thread.

 

Thanks to the DCSBIOS developer, great work!

visit my build thread Gremlin's A-10 :thumbup:

http://forums.eagle.ru/showthread.php?t=86916

Link to comment
Share on other sites

Gremlin, congrats and thanks for sharing your solution. Not sure if you have been following this thread. I encountered lots of noise interference from pots to the extend they jam other switches. Warhog suggested that I stop using pots and change all dials to using encoders. Ragtop suggested using resistors with pots. There are dozens of volume and light dials that normally one would use potentiometers for them. I'm curious what's your solution and does it work well?

Link to comment
Share on other sites

While trying to compile:....

 

Arduino: 1.6.4 (Windows XP), Board: "Arduino Uno"

 

dcsbiosarduinolibrarymaster\Protocol.cpp.o: In function `DcsBios::ProtocolParser::processChar(unsigned char)':

C:\Documents and Settings\JLenart.DELL09\My Documents\Arduino\libraries\dcsbiosarduinolibrarymaster/Protocol.cpp:64: undefined reference to `onDcsBiosFrameSync()'

collect2.exe: error: ld returned 1 exit status

Error compiling.

 

What code were you trying to compile and what version of the Arduino library were you using?

 

I redesigned the arduino part of the software to use it with some I2C portexpanders (MCP23016). You can use 8 of these on your I2C bus, and each has 16 I/O pins. So one arduino can use up to 128 Inputs or Outputs on top.

For my cockpit I use 5 Arduino Megas with Ethernet Boards to connecting the hardware to the sim. Have finished this way all consoles with all supported functions.

It's great to see someone use the Arduino Library like it was originally intended: as an example to understand and adapt to your needs :thumbup:

Sometimes I get the impression that many people think if it can't be done by copying and pasting from the reference documentation, "it is not supported by DCS-BIOS". It's probably my own fault because the intro video is all about "look how quickly I can connect this button and LED" instead of "here's what can be done with copy and paste, but if you can find the data you need in the reference docs and you can make your Arduino talk to something, you can make it work with DCS-BIOS".

Link to comment
Share on other sites

Ian;2401589']

Sometimes I get the impression that many people think if it can't be done by copying and pasting from the reference documentation, "it is not supported by DCS-BIOS". It's probably my own fault because the intro video is all about "look how quickly I can connect this button and LED" instead of "here's what can be done with copy and paste, but if you can find the data you need in the reference docs and you can make your Arduino talk to something, you can make it work with DCS-BIOS".

 

I think it also has something to do with that many people are not programmers by trade and thus library's and using them are not a native concept to them. On the otherhand, if that is true then it's a massive compliment to your work!

Link to comment
Share on other sites

I just came across this.

http://www.aliexpress.com/item/Free-Shipping-4-Bits-Digital-Tube-LED-Display-Module-With-Clock-Display-Board-For-Arduino-DIY/1749694071.html?spm=2114.30010108.4.37.mwycGc

 

Looks like it can be used for displays for VHF, UHF, TACAN, and ILS panels. I see only four wires to connect to an arduino board. I see on google people using individual pieces of 7 segment displays, then connect it to a breadboard and some chip and bunch of resistors. So complicated. This one with chip, resistors etc build in seems much easier for a novice like me.

 

If I get individual pieces like this, I wouldn't know how to wire it to make it work with arduino.

http://www.aliexpress.com/item/Free-Shipping-CPS05611BR-Common-Anode-1Bit-Digital-Tube-7-segment-0-56-Red-LED-Display-10PCS/1768490862.html?s=p

 

And I assume the board above, stated as arduino DIY, will work with dcs bios?

Link to comment
Share on other sites

I just came across this.

http://www.aliexpress.com/item/Free-Shipping-4-Bits-Digital-Tube-LED-Display-Module-With-Clock-Display-Board-For-Arduino-DIY/1749694071.html?spm=2114.30010108.4.37.mwycGc

 

Looks like it can be used for displays for VHF, UHF, TACAN, and ILS panels. I see only four wires to connect to an arduino board. I see on google people using individual pieces of 7 segment displays, then connect it to a breadboard and some chip and bunch of resistors. So complicated. This one with chip, resistors etc build in seems much easier for a novice like me.

 

If I get individual pieces like this, I wouldn't know how to wire it to make it work with arduino.

http://www.aliexpress.com/item/Free-Shipping-CPS05611BR-Common-Anode-1Bit-Digital-Tube-7-segment-0-56-Red-LED-Display-10PCS/1768490862.html?s=p

 

And I assume the board above, stated as arduino DIY, will work with dcs bios?

 

I have been using the MAX7219 with the 7 seg displays. Its quite easy to use and to program. The IC's can be purchased from China for under a dollar a chip. There are also PCB's ready made to use them with the MAX7219 and 7 seg displays.

 

The display your looking at uses the TM1637 IC to drive them which probably does the same thing as the 7219. The Arduino sketch looks similar as well although I think the 7219 might be easier and more versatile to use in that you can daisy chain them for additional displays. I'm not really familiar with the TM1637.

 

Another consideration is that the display your looking at is only 4 digits so that won't be satisfactory for anything we have in the cockpit ...ILS -5 digits, Tacan 3 digits plus an x/y character display, VHF and UHF 6 digits. And there is the size...its 12 foot??? and its red where everything in the cockpit is green.

 

What I might suggest is you do some investigation into the MAX7219 and prefab PCBs. I understand there are prefab PCB''s for 7 seg displays as well. You can get the correct color, size and number of digits but you need to use individual digits to do it. The code is also readily available and it's much easier to go with what many people are using so you can get help when you need it.

 

Six months ago all of this was unbelievably foreign to me. I had know idea what any of this was or how to do it. With help from people here and a lot of reading on the various threads, forums, and data sheets (really important) I learned how to do this. That's kind of what it takes to build a cockpit that resembles the real thing. And if I can do it...you can, anyone can.

 

This is what all that research and learning has allowed me to accomplish in 6 months and its also an example of what can be done with inexpensive components and the motivation to make it look good.

 

This is my VHF under construction using all of the correct displays, size, color, placement etc.

 

IMG_0419.jpg

 

IMG_0400.jpg

 

My TACAN:

 

IMG_0268.jpg

 

 

My ILS

 

IMG_0441.jpg

 

 

Don't consider this as complicated. Look at it as a challenge for you to overcome. It's really just a matter of reading and doing research and talking with the rest of us when there is something you can't figure out on your own. You can learn how to do this even if you consider yourself a novice. I was a novice last year. I still am in many ways but I keep learning how to do stuff and then I apply it to this project.

 

Consider how far you've already come. You just need to go a bit further...and then a bit further ...and then a bit further... and you're there!

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

Link to comment
Share on other sites

John, thanks for sharing your solution. I had the same idea in mind, using 3 digits of 7 segment display and one 16 segment display combined for the TACAN. But don't know how to execute! LOL.

 

I gave this link

http://www.aliexpress.com/item/Free-Shipping-4-Bits-Digital-Tube-LED-Display-Module-With-Clock-Display-Board-For-Arduino-DIY/1749694071.html?spm=2114.30010108.4.37.mwycGc

just as an example to see what you guys think. I knew the number of digits and color are not ideal, but again, just as an example as the 4 digit product seems the most common at that site. I like that the digits are already on an arduino ready board to interface to. If there is a PCB ready board for you to put 3-6 digits that would be ideal but I don't find such boards.

 

I can't just buy the MAX whatever chip as I don't know what other components to get and how to wire them together. I need a board that has all the need stuff already added and wired, like the one above. What you did is really cool but I don't know you did it. I don't need to get a PCB printed if I can find a circuit diagram and I buy the components and wire them on a blank breadboard. Can you share your pcb design or the circuit diagram that shows/explains how all required components are connected with the 7/16 segment displays? Only figuring out this part then I can do the same thing like you did for the VHF, ILS, TACAN etc. put the required number of digits and wire them. Next how do I make them arduino compatible? Pardon my ignorance with all these questions.

Link to comment
Share on other sites

I can't just buy the MAX whatever chip as I don't know what other components to get and how to wire them together.

I don't need to get a PCB printed if I can find a circuit diagram and I buy the components and wire them on a blank breadboard.

 

That information is found in a component's datasheet.

Here's the MAX7219 datasheet available at maximintegrated.com. Look at the schematic labelled "typical application circuit" on the first page. Note how they simplified the drawing by using only one line for the digit and the segment lines. All "segment A" lines get connected to SEG A, all "segment B" lines to SEG B, etc. The common cathode line of the first digit goes to the DIG 0 pin, the common cathode line of the next one to DIG 1, etc.

 

Also look at Table 11 in the datasheet to determine the I_set resistor value (in kiloohms) depending on the forward voltage and current rating of your 7-segment LED modules.

 

Datasheets may look confusing and it can be easier to find a build log on someone's blog that you only have to exactly replicate, but I recommend you always try to understand what you can from the datasheet before looking for more information elsewhere. This way, after a while, you will have learned how to read a datasheet. It's a very useful skill to have, as it allows you to figure out how to use almost any arbitrary component.

 

When WarHog ordered a small OLED display for his altimeter, he was able to get it running all by himself using the supplied datasheets (all I told him was which parts he could entirely ignore because they applied to modes of operation that we weren't going to use, such as the 8-bit parallel or the I2C interface :music_whistling: ).

 

 

Next how do I make them arduino compatible?

You use the LedControl library.

 

If you wanted to write your own library (i.e. for a chip or module where nobody has written a library for yet), the datasheet contains all the information you need. If you ever find yourself writing library code to talk to a new chip and it's not working, get a logic analyzer. Having a convenient way to actually look what is happening on the communication lines between the microcontroller and the chip is an invaluable debugging tool in these situations.

 

Pardon my ignorance with all these questions.

 

Ignorance is no problem at all. We all start out totally ignorant about everything. I enjoy answering questions from people who actually want to learn, because after a while, they come back with new questions (which they arrived at after gaining a better understanding of their problem or making progress with their build) and eventually, they succeed.

 

What I can't stand are questions that are so broad and offer so little context that the only way to answer them would be to write a whole book on the subject. Trying to answer those anyway (with a broad overview and lots of requests for more information) is an exercise in frustration. You also tend to get useless complaints of "I don't understand!" instead of specific follow-up questions like "Can you explain X again?", "Where can I find out more about Y" or "Would this also work if I did Z" which result in actual progress.

Link to comment
Share on other sites

I agree with Ian about the need to learn HOW to do this stuff. Its one thing to just copy an existing project but then when something goes wrong, you have no idea how to trouble shoot the problem unless you at least understand the basics of what you did.

 

As Ian pointed out, start with the data sheet. Read it and see what you don't need. Whats left is what you will use to build it. The data sheet has all of the basic info you need to understand what to do in terms of schematics and pin connections. You should also go to the Arduino site and explore the MAX7219 Library and the LedControl Library to see what they do. Then search for typical examples and you will find lots of images of PCB's that you can use as a reference.

 

When I have my cockpit finished I intend to publish photos, schematics, PCB layouts, Arduino code and whatever else may be pertinent to my cockpit build. All of my sketches will be in a library for future reference. But that will be months away (Only Months?? :music_whistling:). It would not be a good idea to use my code and circuits as they presently exist only because I need to thoroughly test everything working together to ensure there are no issues before before the data is made available to anyone wishing to use it.

 

Here's a site you will probably want to make use of. They have PCB's for the 7 seg displays. If you can't make PCB's yourself you will want to order some of these boards based on how many digits you need. Scroll to the end of the page to find them. Their prices are generally ridiculous but what can you do?

 

http://www.flightsimparts.eu/Shop_7Segment.html

 

For the MAX7219 you can use this. You will still need to read up on all this stuff or else you may see blue smoke coming from things. At least you will be able to use PCBs for your build which is always desirable.

 

http://www.ebay.com/itm/1PC-NEW-MAX7219-lattice-contol-panel-PCB-printed-circuit-board-for-arduino-Good-/171462457882

 

These are the 7 seg digits you need.

 

http://www.ebay.com/itm/10-PCS-1-Digits-0-36-GREEN-7-SEGMENT-LED-DISPLAY-COMMON-CATHODE-Digit-/121369474283?pt=LH_DefaultDomain_0&hash=item1c422f34eb

 

You still need to get the components which you will find once you go through the data sheet for the 7219. Between Google and eBay, I have found all sorts of invaluable info on building these kinds of things so spend some time doing research and you will be amazed at whats out there for you to use and learn from.

 

In the mean time, read up on this stuff as we suggest and learn about using the MAX7219 and 7 seg displays. We will help you when or if you get stuck on something. This stuff is not as difficult as it may appear. As I said earlier, six months ago all I knew about electronics was ...nothing:cry: and when it came to programming I knew even less. Persevere and you will be surprised at what you will be able to accomplish.


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

Link to comment
Share on other sites

Hi,

 

I've been following the simpit building threads for over a year now, and months ago I have decided to give it a try myself.

 

First I want to thank all guys for the time and effort they contributed to create these great peaces of software, be it DCSBios, Helios or whatever else ...

 

For me I feel that DCS Bios is the perfect tool for my purpose. I have even started to write something quite similar, just a few weeks before Ian introduced DCSBios to the community. As soon as I saw DCSBios, i ditched my own implementation.

 

 

One thing I still wonder is how you DCSBios-Users implement the instruments that are really hard to recreate in hardware. I'am talking about HSI, ADI, RWR and the likes. Do you guys use Helios to export them? Or do you prefer exporting them as viewports?

 

I feel like using helios alongside with dcsbios is not optimal, as both tools have their own export.lua. Is it even possible?

Link to comment
Share on other sites

Hi,

 

I've been following the simpit building threads for over a year now, and months ago I have decided to give it a try myself.

 

First I want to thank all guys for the time and effort they contributed to create these great peaces of software, be it DCSBios, Helios or whatever else ...

 

For me I feel that DCS Bios is the perfect tool for my purpose. I have even started to write something quite similar, just a few weeks before Ian introduced DCSBios to the community. As soon as I saw DCSBios, i ditched my own implementation.

 

 

One thing I still wonder is how you DCSBios-Users implement the instruments that are really hard to recreate in hardware. I'am talking about HSI, ADI, RWR and the likes. Do you guys use Helios to export them? Or do you prefer exporting them as viewports?

 

I feel like using helios alongside with dcsbios is not optimal, as both tools have their own export.lua. Is it even possible?

 

 

I'm planning on using a real HSI and ADI interfaced with DCS-BOIS and Arduino. I already have an HSI from a 737. Ian and I are working on it together to see if we can get it up and running using stepper motors to replace the synchros. The ADI is a lot easier to make functional. See my standby ADI below. My problem is locating one at a reasonable price. That just leaves the RWR which I will export to a small screen.

 

IMG_0531.jpg

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

Link to comment
Share on other sites

  • 3 weeks later...

Help with FM/AM radios display

 

Hi, i am Adrian, i need help with the AM/FM radios, I have a dude, i am trying to get on a lcd the AM/FM status frequency,,,but i have feel that i only have in the bios.documentation for both radios the code lua for the 1º and 4º frequency selector:

 

 

 

 

void onVhfamFreq1Change(char* newValue) {

/* your code here */

}

DcsBios::StringBuffer<2> vhfamFreq1StrBuffer(0x1190, onVhfamFreq1Change);

 

 

 

void onVhfamFreq4Change(char* newValue) {

/* your code here */

}

DcsBios::StringBuffer<2> vhfamFreq4StrBuffer(0x1192, onVhfamFreq4Change);

 

 

My question is the next, where are the lua code for the 2º and 3º frequency selectors?

Thanks for your time!!!


Edited by Adrian_gc
Link to comment
Share on other sites

  • Recently Browsing   0 members

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