Jocman Posted May 3, 2024 Posted May 3, 2024 Hi all. I'm going on with testing my panels. Couple of days ago, I downloaded and updated to last version: DCSBIOS (program and arduino library) and BoRT. Actually, in my panels I still have the arduino coded with "old" version of DCSBIOS (at that time I was still using the Chrome reference). In particular, I'm testing the left consolle (radio, engines and weapons), but I'm getting some problem. FIRST ISSUE All the buttons and switches work fine (until now, hopefully...), but the SPU9 intercom selector and the Cannon mode selector don't ( I'm using rotary switches, they work fine for the APU ENGINE selector instead of a 4 way switch I don't have..))..... they don't give any sign of life. Both of them are connected to pin 13, 14, 15, 16 (I use arduino nano), of course 2 different nano, with these snippet: //RADIO SELECTOR const byte radioSelectorPins[4] = {13, A0, A1, A2}; DcsBios::SwitchMultiPos radioSelector("RADIO_SELECTOR", radioSelectorPins, 4); and on the second nano: //CANNON WEAPON SYSTEM SELECTOR const byte weaponsModePins[5] = {13, 14, 15, 16, 17}; DcsBios::SwitchMultiPos weaponsMode("WEAPONS_MODE", weaponsModePins, 5); As you can see, I tried with both pin notation (number or letter), but nothing to do. I tried with a brand new nano with only a rotary connected on pins 4, 5, 6, 7, but same issue: no life.... SECOND ISSUE As I'm using some 7 segment diplays with Max7219, I can't display the VHF frequencies. With the PVI800 (while doing some test time ago) everything worked fine, so I think the PCB is correctly working. But I noticed some differences (and having some error in compiling) with the new BoRT snippets. With the old reference, this was the snippet (i.e. for the frequency 1): void onR800Freq1RotChange(char* newValue) { /* your code here */ } DcsBios::IntegerBuffer r800Freq1RotBuffer(0x1910, 0x0ff0, 4, onR800Freq1RotChange); The new reference on BoRT is: void onR800Freq1Change(char* newValue) { /* your code here */ } DcsBios::StringBuffer<2> r800Freq1StrBuffer(Ka_50_R800_FREQ1_A, onR800Freq1Change); There are some differences, in the last line, where the old snippet reports (0x1910, 0x0ff0, 4, onR800Freq1RotChange) while the new one: (Ka_50_R800_FREQ1_A, onR800Freq1Change) when compiling with the new snippet, I get the error message: "Ka_50_R800_FREQ1_A was not declared in this scope" Compiling with the old one gives no error, but I can't read anything about the frequencies.... THIRD ISSUE Is a problem related to the encoder I use to select the frequency (and, generally speaking, I use the same type of encoder in all my panels.....). Turning back and forth, every click is not a single change in frequency, but 2 or even 3 jumps.... I'm afraid to get tha same behaviour for the other panels too. What's wrong? I know I wrote a lot about issues, but there are 4 days I'm dealing with that with no good results.... Thanks in advance for your help. Jocman Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Jocman Posted May 4, 2024 Author Posted May 4, 2024 Solution to 3rd issue (Encoder) Found the solution in an old ED Forum post, related to this link: https://github.com/DCS-Skunkworks/dcs-bios-arduino-library/wiki/RotaryEncoder Now it seems fixed and working. 1st and 2nd issues still remain.... I'm going on with some test, but can't fix them. Anyone has some idea? Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Vinc_Vega Posted May 4, 2024 Posted May 4, 2024 (edited) Edited: For your second issue, you may use the option to tell Bort not to use Address Constants. While in the first example you call an integer of r800Freq1Rot, you are better with the Frequency String statement of the second example for displays. Regards, Vinc Edited May 4, 2024 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Jocman Posted May 4, 2024 Author Posted May 4, 2024 Thanks for your support Vinc_Vega. BTW, I fixed the 2nd issue too. I found an error in BoRT: when the IDE reports me the message "Ka_50_R800_FREQ1_A was not declared in this scope" it's due an error in the snippet, as (searching in Addresses.h library) is NOT Ka_50_R800_FREQ1_A but Ka_50_R800_FREQ1_ADDR (BoRT misses DDR) Same issue for frequency 4, where BoRT reports Ka_50_R800_FREQ4_A instead of Ka_50_R800_FREQ4_ADDR Now I can display correctly both VHF frequencies. Unfortunately, I started with an issue with the encoders: even if I fixed them for the click-jump, as I connected more arduinos (3 panels) to check with some "load", the frequencies are fine, but turning the encoders doesn't work in the right way, as it seems there's a huge delay between the click and the PC response (if I get response....) Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Vinc_Vega Posted May 4, 2024 Posted May 4, 2024 (edited) Since a few days I'm seeing those delays in the response too, even with a single USB connection when changing the frequency in the Sim cockpit (A-10C II). Sometimes it helps to reconnect the COM port. No idea what has been changed in the programme. Regards, Vinc Edited May 4, 2024 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Jocman Posted May 9, 2024 Author Posted May 9, 2024 (edited) I think I fixed the 1st issue too. Instead of using a normal Multipositionswitch, I built a voltage divider and used the AnalogMultiPos The thing now works; or at least it seems working, but: - There's a short delay (ok, little less than 1 second) between the physical action and the simulated action. And I have only 2 boards at this testing time: the RS485Master and 1 slave; and on this slave there's only 1 snippet (the AnalogMultiPos) - Until I load and test just 1 snippet, beside the delay, everything works. - But I if I try to load and test both the snippets (on the same board), this is what happens: moving the switch, the one which I expect to move, is correctly moving; but even the second one moves..... For the sake of honesty, i say that i made only one voltage divider, switching it from A0 to A1 to test both snippets. I soldered 4 1k resistors, and a crocodile to connect the +5V to the 4th (3 resistors) or on the 5th (4 resistors) switch pin (depending if I'm testing a 4 or 5 steps Analog device) I dont'know if this behaviour it's because if I program 2 AnalogMultiPos, the system WANT to see 2 devices conneccted (and not only 1); but in case not, why this happens??? the 2 snippets: DcsBios::AnalogMultiPos radioSelector("RADIO_SELECTOR", A0, 4); DcsBios::AnalogMultiPos weaponsMode("WEAPONS_MODE", A1, 5); UPDATE I decided to build a second voltage divider, so to have one well configurated for both selector. Everything works fine, no issue at all. I learned another lesson: YES, THE BOARD EXPECTS 2 DEVICES IF YOU PROGRAM 2 DEVICES! Only one curiosity: why the multiposition switch doesn't work? I mean, the standard multiposition..... At this point it doesn't really matter, 'cause I think I'll switch to AnaloMultiPos for all the selectors of my cockpit (and save pins)...... Anyway, thanks all for your patience and support Edited May 9, 2024 by Jocman Fixed issue Jocman "For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci) Prev. Projects: https://forums.eagle.ru/showthread.php?t=50071
Recommended Posts