Jump to content

DCS-BIOS over RS485


Hansolo

Recommended Posts

I don't understand.  What "return wiring"?

I also don't understand how "train line" would be more wiring than "spider web". It's a "branch line". It goes one way.

Another name for train line would be "daisy chain".

The RS485 bus goes from one panel to the next, then you put a terminating resistance on the end farthest from the master.

Or, run a long bus with "tap point" connectors to plug in your panels.

Link to comment
Share on other sites

The 'return line' would be because the cockpit is essentially a 'U' shape, with the master behind the dash middle of the 'U'. That means the line would go all the way to the end of one console, then return back to the center of the 'U' before going to the other console

Does that make sense?

Cheers

Les 

Link to comment
Share on other sites

Have you already tried to use the second and/ or third RS485 bus of the Mega?

Naturally the master sketch has to enable that setup.

So one bus line could go to each side console and the third bus may be used for the Main panel.

Regards, Vinc


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

5 hours ago, lesthegrngo said:

So, if I understand what you are saying correctly, I can connect 3 MAX487 chips to the Mega on the TX/RX1, TX/RX2 and TX/RX3, and have one 'network' for each part of the rig?

Les

Yes, it is intented to do exactly this.

But I haven't done so yet.

Extract from the master sketch:

/*
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

 

Regards, Vinc


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Guys, looking at the DcsBiosNgRS485Master.h file in the library, it shows the following lines


#define UART1_TXEN_PORT PORTE
#define UART1_TXEN_DDR DDRE
#define UART1_TXEN_PIN 4

#define UART2_TXEN_PORT PORTE
#define UART2_TXEN_DDR DDRE
#define UART2_TXEN_PIN 5

#define UART3_TXEN_PORT PORTG
#define UART3_TXEN_DDR DDRG
#define UART3_TXEN_PIN 5

It is calling out pin 5 twice, but also it is in conflict with the sketch which also defines the TXEn pins

I will be setting up as follows

TX1 / RX1 will use pin 4 as TXEn

TX2 / RX2 will use pin 3 as TXEn

TX3 / RX3 will use pin 2 as TXEn

I assume that I do not have to make any more references that defining the TXEn pins in the sketch in the following bit of code

#define UART1_TXENABLE_PIN 4
#define UART2_TXENABLE_PIN 3
#define UART3_TXENABLE_PIN 2

and the UART1 will be allocated by the library sketch definitions with this part of the code, right? 

#define uart1_txen_setup() UART1_TXEN_DDR |= (1<<UART1_TXEN_PIN)
#define uart1_set_txen() UART1_TXEN_PORT |= (1<<UART1_TXEN_PIN)
#define uart1_clear_txen() UART1_TXEN_PORT &= (1<<UART1_TXEN_PIN)

#define uart2_txen_setup() UART2_TXEN_PORT |= (1<<UART2_TXEN_PIN)
#define uart2_set_txen() UART2_TXEN_PORT |= (1<<UART2_TXEN_PIN)
#define uart2_clear_txen() UART2_TXEN_PORT &= (1<<UART2_TXEN_PIN)

#define uart3_txen_setup() UART3_TXEN_PORT |= (1<<UART3_TXEN_PIN)
#define uart3_set_txen() UART3_TXEN_PORT |= (1<<UART3_TXEN_PIN)
#define uart3_clear_txen() UART3_TXEN_PORT &= (1<<UART3_TXEN_PIN)

Cheers

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

There should be a RS485Master.ino within the librarys' example folder to adjust your settings. Ofcourse the TX enable definition must harmonize with the above .h file.

Maybe you found the first issue to avoid further problems 😉

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Tried it out today, I must have something wrong as it didn't work. I can see the master lights flashing, but none of the slaves are showing any lights. All the gauges do the start up routine so it's at least partly OK.

Tomorrow I'll recheck it all out, see if there's  a stupid error in the setup.  I will probably start by going back to my old master and single bus setup to test out the wiring to rule that out

Les

Link to comment
Share on other sites

I have it working, one of the Nano's had the I2C scan sketch installed which apparently stopped everything else from being able to work with the RS485

However there is still something not right, as the gauges periodically flicker full scale as though there is a momentary power interruption.  I have a 5v supply connected directly to the RS485 mega on the RS485 bus so I know that that is not the cause of it. I also notice that the VHF radio panel only has three of the five OLEDs displaying at any one time

Nonetheless it is progress and I will keep niggling away at it

EDIT here's a video showing the behaviour I was describing

 

Les


Edited by lesthegrngo
Link to comment
Share on other sites

I'm disappointed to report that despite putting in a dedicated 5A 5v power supply the gauge twitching is still there. Interestingly it seems to manifest itself when a device is connected that has an OLED or LCD display attached. I also tried a single Mega Master rather than the three bus version and it is the same

However, when I used two Megas as masters, and ported the OLED and LCD connected devices to one and the non OLED / LCD devices to the other, it works fine

I have four Megas so can add a couple more if necessary, and if it works I'm not going to complain. However it would be good to know why it behaves like that

Les

Link to comment
Share on other sites

On 12/13/2022 at 2:57 PM, lesthegrngo said:

I also tried a single Mega Master rather than the three bus version and it is the same

As that was your configuration before going the 3 bus way, the behaviour is really strange!

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

it is strange, it's almost as if the OLED / LCD devices interfere with the signal somehow. I had previously noted that you can't run an OLED and a stepper motor successfully one one Nano as the stepper movement is massively impacted. My suspicion for that is that the stepper update  cadence is directly related to the OLED refresh rate, and the U8G2 driven OLEDs would slow it down to a point where it was useless.

However I can't imagine why there would be any effect on other Nanos that are just connected via RS485

Despite this, the multiple Mega master solution does seem to be a viable one so my intention is to use one dedicated Master for all the stepper motor driven devices, and one or two others for all the remaining OLEDs, LCD's and things like the CLP

One other thing I will try is some 5v bus bars so that the 5v supply to the devices are not just on the RS485 lines. I doubt it will make any difference but costs nothing to try

Les

Link to comment
Share on other sites

  • Recently Browsing   0 members

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