Pavespawn Posted February 25, 2018 Share Posted February 25, 2018 I’ve reached the point of frustration and now I have to ask for assistance. Here is where I am at: I have hooked up my RS485 bus using Hans method https://forums.eagle.ru/showpost.php?p=3247704&postcount=171 I could not make anything work. I went back to the workbench and hooked up a new nano and new max487 chip and now I get the RX light on the nano and when I start DCS BIOS and DCS World I get the flickering light on the mega and scrolling data on the cmd window. I still can’t get a switch to work. What could I be doing wrong? Sorry if I’m not being clear I’m just pretty frustrated at the moment. Link to comment Share on other sites More sharing options...
Hansolo Posted February 25, 2018 Share Posted February 25, 2018 Hmm Alburg has the same problem. I've 14 panels running this way so I don't think it's DCS-BIOS issue. Can you do me a favour of posting the codes for both Master and Slave, please. Does your slave code works when you insert the functions into a non RS485 sketch and run it of USB? Also you need to post some pictures showing the wires in order to trace them remotely. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Pavespawn Posted February 26, 2018 Author Share Posted February 26, 2018 Hans, Thanks for the reply. That was a total frustration post. I think I just need your magic touch! The sketches run flawlessly when run as serial (thanks to you). I’ll get you the code and the wires when I get on the computer where the code is located. Are you using any thing other than the max487 chips? I know it has been mentioned in older posts that additional components may be required. I most likely have a mistake somewhere I assume. I bought some adifruit power distribution blocks to allow me to tie the four lines into a central location. I will eventually create disconnects at the panel so I can easily remove them if required. Link to comment Share on other sites More sharing options...
Hansolo Posted February 26, 2018 Share Posted February 26, 2018 (edited) Are you using any thing other than the max487 chips? I know it has been mentioned in older posts that additional components may be required. I haven't used any additional components so far for the RS485 bus. I know Rocketeer got confirmation from Ian that a 100pF capacitor should be used for all MAX487 chips for stabillity, but I don't know where to put it so haven't. In the datasheet for MAX487 a 100pF capacitor is mentioned for C1 & C2 but that is for a driver/receiver timing test circuit. I just did a small test pcb for Alburg; In this picture the following colors apply Power for MAX487 chips: WHITE +5V from Mega BROWN GND Power for Nano is via a USB charger Commumincation between the two MAX487 chips: GREY A-line PINK B-line Communication between MAX487 and Arduino's: GREY DI PINK R0 BLUE DE&RE A few more shots; Master (Mega) code; /* 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" void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Slave (Nano) code; /* The following #define tells DCS-BIOS that this is a RS-485 slave device. It also sets the address of this slave device. The slave address should be between 1 and 126 and must be unique among all devices on the same bus. */ #define DCSBIOS_RS485_SLAVE 100 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ //Master Caution Light DcsBios::LED masterCaution(0x1012, 0x0800, 13); //Master caution reste DcsBios::Switch2Pos ufcMasterCaution("UFC_MASTER_CAUTION", 12); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I am running dcs-bios-v0.7.1. Cheers Hans Edited February 27, 2018 by Hansolo Listed original size pictures 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Pavespawn Posted February 27, 2018 Author Share Posted February 27, 2018 (edited) Ok here are some pics of my setup with descriptions. Edited February 27, 2018 by Pavespawn Replaced photobucket pics. Link to comment Share on other sites More sharing options...
Pavespawn Posted February 27, 2018 Author Share Posted February 27, 2018 Here is my code: Master /* 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" void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Slave /* The following #define tells DCS-BIOS that this is a RS-485 slave device. It also sets the address of this slave device. The slave address should be between 1 and 126 and must be unique among all devices on the same bus. */ #define DCSBIOS_RS485_SLAVE 3 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos eppAcGenPwrL("EPP_AC_GEN_PWR_L", 10); DcsBios::Switch2Pos eppAcGenPwrR("EPP_AC_GEN_PWR_R", 9); DcsBios::Switch2Pos eppApuGenPwr("EPP_APU_GEN_PWR", 7); DcsBios::Switch2Pos eppBatteryPwr("EPP_BATTERY_PWR", A0); DcsBios::Switch2Pos eppEmerFlood("EPP_EMER_FLOOD", 5); DcsBios::Switch3Pos eppInverter("EPP_INVERTER", 6, 8); DcsBios::Switch3Pos canopyOpen("CANOPY_OPEN", A1, A2); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Link to comment Share on other sites More sharing options...
Hansolo Posted February 27, 2018 Share Posted February 27, 2018 Hmm I can't see anything out of the ordinary :cry: Have you tried to include the master caution light to see if it recieves communication correctly; //Master Caution Light DcsBios::LED masterCaution(0x1012, 0x0800, 13); I would suggest that for future installs that you use a 8-pin IC socket for your MAX487. In case a MAX487 chip fails it can be replaced without soldering. Secondly you avoid the risk of damaging the IC with the heat during soldering. Your toggle switches have the common connected to ground, right? So that you pull down the inputs when activating a toggle switch. I found the post with the 100nF capacitor for the MAX487. Ian says it's between ground and Vcc on the MAX487, but since I am running directly from the voltage supply on the Nano/Mega it already has a 100nF capacitor on the Arduino side. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Pavespawn Posted February 27, 2018 Author Share Posted February 27, 2018 (edited) Hans, I’ll have to get some of those sockets. I was concerned about the heat from my soldering. I’ll also start from scratch and try to get a master caution to work. The ground for my switches work when I have the Arduino in serial. Is there a different ground requirement when in RS485 mode? I would love for this to be the problem because I can fix that easy!!! Edited February 27, 2018 by Pavespawn Link to comment Share on other sites More sharing options...
Pavespawn Posted February 27, 2018 Author Share Posted February 27, 2018 Also it seems I need a different photo hosting site since photobucket is ransoming my pictures. Link to comment Share on other sites More sharing options...
Hansolo Posted February 28, 2018 Share Posted February 28, 2018 Another forum member found this (forgot who unfortunately) and I tried it out an can see your photos; https://chrome.google.com/webstore/detail/photobucket-hotlink-fix/kegnjbncdcliihbemealioapbifiaedg?hl=en Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Mr_Burns Posted March 19, 2019 Share Posted March 19, 2019 Any chance a kind member would visit ebay.com.au and point me at a MAX487 - they seem to be $15 for a single chip when the bloody nano is only $8. Link to comment Share on other sites More sharing options...
Blue73 Posted March 19, 2019 Share Posted March 19, 2019 Hi, As Hans has said placing a decoupling cap right up close to the 487 will help filter off any high frequency supply noise from reaching the 487. All my 487 bus transceivers have one. https://forums.eagle.ru/showthread.php?t=219982&page=22 cheers John Link to comment Share on other sites More sharing options...
Blue73 Posted March 19, 2019 Share Posted March 19, 2019 Hi Mr Burns, Not quite ebay but much cheaper. I used to have a small amount fail but since pulling down the rx'/tx pin they've been okay. I think the pin floating high when connected to the bus was the issue. They're also so cheap you can swap them out if you have any issues. What's running now on my slaves have not failed. https://www.aliexpress.com/item/10PCS-lot-MAX487CPA-DIP8-MAX487-RS-422-RS-485-Interface-IC-RS-485-RS-422-Transceiver/32807108224.html?spm=a2g0s.9042311.0.0.2d564c4dbs1eUK Any chance a kind member would visit ebay.com.au and point me at a MAX487 - they seem to be $15 for a single chip when the bloody nano is only $8. Link to comment Share on other sites More sharing options...
Mr_Burns Posted March 20, 2019 Share Posted March 20, 2019 Hi Mr Burns, Not quite ebay but much cheaper. I used to have a small amount fail but since pulling down the rx'/tx pin they've been okay. I think the pin floating high when connected to the bus was the issue. They're also so cheap you can swap them out if you have any issues. What's running now on my slaves have not failed. https://www.aliexpress.com/item/10PCS-lot-MAX487CPA-DIP8-MAX487-RS-422-RS-485-Interface-IC-RS-485-RS-422-Transceiver/32807108224.html?spm=a2g0s.9042311.0.0.2d564c4dbs1eUK Thanks Blue, just ordered some, will give me something to try when they rock up! Link to comment Share on other sites More sharing options...
outbaxx Posted August 29, 2019 Share Posted August 29, 2019 Late answer but this is just a small beware: As we all know all electric components run on blue smoke, I just let the smoke out on four max487’s due to what I think was a Voltage regulator malfunction on the Arduino Mega. I put 12V on the Vin pins on all Arduinos but it took me 4 487’s to figure out that I couldn’t do that on my Mega. The Nano worked though. But googling the issue told me that 12V is on the high side on the Vin even though it should be able to cope due to heat in the regulator. The common answer was to use 9V on the Vin instead to be safe. Well, I finally got it working after I disconnected the Vin on the Mega and just used the USB to power it, but when you’re blue smoking SMD 487’s it’s easy not to laugh :) Cheers Link to comment Share on other sites More sharing options...
Hansolo Posted August 29, 2019 Share Posted August 29, 2019 Hmm slightly odd. I have 5x Arduino Mega’s running on 12VDC on the Vin pin. How did you connect the Vcc on the Max487? According to spec it looks like the AtMega 2560 is less voltage tolerant than the MAX487’s. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
Fusedspine33 Posted August 30, 2019 Share Posted August 30, 2019 Are these MAX485 modules interchangeable with the MAX487 chips that are being used? The data sheets I found seem to have several MAX48x chips listed as RS485 transceivers. The modules seem to have the mentioned capacitor included on the board and could speed builds up if they are interchangeable. Thanks for any insight. https://www.ebay.com/itm/5PCS-MAX485-RS-485-Module-TTL-to-RS-485-module-for-Arduino-Raspberry-pi-JKHB9/193026204529?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D40719%26meid%3Dba1aff641af3465f8c6075975243099a%26pid%3D100675%26rk%3D1%26rkt%3D15%26sd%3D193026204529%26itm%3D193026204529%26pmt%3D1%26noa%3D1%26pg%3D2481888&_trksid=p2481888.c100675.m4236&_trkparms=pageci%3Afbeb7849-cacd-11e9-a627-74dbd180e451%7Cparentrq%3Ae05b254a16c0a4b7b6c212c4ffd91cc5%7Ciid%3A1 Sent from my iPad using Tapatalk Link to comment Share on other sites More sharing options...
Hansolo Posted August 30, 2019 Share Posted August 30, 2019 I seem to recall Ian advised against those boards as you have to de-solder the resistors and the chip is a MAX485 which should be less suitable than the MAX487. Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
outbaxx Posted August 30, 2019 Share Posted August 30, 2019 Hmm slightly odd. I have 5x Arduino Mega’s running on 12VDC on the Vin pin. How did you connect the Vcc on the Max487? According to spec it looks like the AtMega 2560 is less voltage tolerant than the MAX487’s. Cheers Hans Yes, the datasheet for the 487 states max12V too so I don’t really know why this happened. I connected the 487 Vcc to one 5V pin on the mega. And powering the mega from USB worked with the same connection except from the 12V Vin. I’ve measured on the mega and can’t find why it burned my chips, I’ll just leave the 12V Vin for now and let it be powered by the USB. Link to comment Share on other sites More sharing options...
Recommended Posts