Jump to content

DCS-Bios RS485 connect switches to master


Hogtie
 Share

Recommended Posts

Hi All

 

I have a arduino mega, which are going to act a master on RS485 network with 4 slaves, which are also megas.

 

Now I want to connect switches (2, 3 and multi postion), potentiometer and rotary encoders, to the mega that acts as master on the network.

 

When I try to compile my code it comes up with the following error:

 

sketch\Controlbox_master_code_v1.ino.cpp.o: In function `DcsBios::Switch2Pos::pollInput()':

 

C:\Users\Stev\Documents\Arduino\libraries\dcs-bios-arduino-library-0.2.11\src/internal/Switches.h:26: undefined reference to `tryToSendDcsBiosMessage(char const*, char const*)'

 

collect2.exe: error: ld returned 1 exit status

 

exit status 1

Error compiling.

 

Is there a way to connect components to the master ?

 

Here is the code I have tried to compile.

 

/*

Tell DCS-BIOS this is a RS-485 Master.

You will need to flash this to a Mega 2560.

*/

#define DCSBIOS_RS485_MASTER

 

/*

Define where the TX_ENABLE signals are connected.

You can connect up to three half-duplex RS-485 transceivers.

 

Arduino Pin RS-485 Transceiver Pin

TXn ------------------- DI (driver input)

RXn ------------------- RO (Receiver Output)

UARTn_TXENABLE_PIN ---- /RE, DE (active low receiver enable, driver enable)

 

If you have less than three transceivers connected, comment out the corresponding

#define UARTn_TEXENABLE_PIN lines for receivers that are not present.

*/

#define UART1_TXENABLE_PIN 2

//#define UART2_TXENABLE_PIN 3

//#define UART3_TXENABLE_PIN 4

 

#include "DcsBios.h"

 

DcsBios::Switch2Pos batSw("BAT_SW", 50);

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

Link to comment
Share on other sites

Hans is 100% correct. The mega, when used as a master, cannot be used for anything else. One other note, make sure you use the most current version of DCS BIOS.

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

Please can someone post the schematic for a Mega Nano RS485 connection, I have 3 nanos and want to get a master and RS485 to test out linking them.

 

 

Is a Mega just a Mega or are there types of Mega?

 

 

 

Sorry for thread hijack but the title is the title!

 

 

NM found it:

 

 

https://forums.eagle.ru/showpost.php?p=3247704&postcount=171

 

 

 

 

Are 4 of these all that is needed to run 3 nanos from one Mega?

 

 

https://www.ebay.com.au/itm/Maxim-MAX487CPA-Line-Transceiver-RS-422-RS-485-5-V-8-Pin-PDIP/401626040868?hash=item5d82c70a24:g:7KEAAOSwaYVbNlOM:rk:26:pf:0


Edited by Mr_Burns
Link to comment
Share on other sites

Please can someone post the schematic for a Mega Nano RS485 connection, I have 3 nanos and want to get a master and RS485 to test out linking them.

 

 

Is a Mega just a Mega or are there types of Mega?

 

 

 

Sorry for thread hijack but the title is the title!

 

 

NM found it:

 

 

https://forums.eagle.ru/showpost.php?p=3247704&postcount=171

 

 

 

 

Are 4 of these all that is needed to run 3 nanos from one Mega?

 

 

https://www.ebay.com.au/itm/Maxim-MAX487CPA-Line-Transceiver-RS-422-RS-485-5-V-8-Pin-PDIP/401626040868?hash=item5d82c70a24:g:7KEAAOSwaYVbNlOM:rk:26:pf:0

 

Hi Mr Burns,

 

This video does it for me.

 

 

Mole

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

Please can someone post the schematic for a Mega Nano RS485 connection, I have 3 nanos and want to get a master and RS485 to test out linking them.

 

 

Is a Mega just a Mega or are there types of Mega?

 

 

 

Sorry for thread hijack but the title is the title!

 

 

NM found it:

 

 

https://forums.eagle.ru/showpost.php?p=3247704&postcount=171

 

 

 

 

Are 4 of these all that is needed to run 3 nanos from one Mega?

 

 

https://www.ebay.com.au/itm/Maxim-MAX487CPA-Line-Transceiver-RS-422-RS-485-5-V-8-Pin-PDIP/401626040868?hash=item5d82c70a24:g:7KEAAOSwaYVbNlOM:rk:26:pf:0

 

I got these MAX487 chips last time; https://www.mouser.dk/ProductDetail/700-MAX487CPA

 

They are more expensive than off Ebay but I got a batch of bad chips which turned really hot. Decided that the fault tracing time vs 2 Euro was in favour of the 2 Euro's.

 

To the best of my knowledge a Mega 2560 which is the newer model. They do run different communications chips for the USB connections ATmega vs CH340 but either works. I had at one point suspected that there was an issue with the CH340 but couldn't replicate issues; https://forums.eagle.ru/showpost.php?p=3397367&postcount=41

 

Cheers

Hans

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...