Jump to content

Recommended Posts

Posted
Hi all,
I guess, I've figured it out by reading some of Vinc_Vega's posts. This is my first-ever schematic.
Please let me know if it's not right. Thank you.
I've also noticed that many PCBs have large copper ground fills - is this necessary and what is the benefit? Can it not be just nets with the rest of the copper being etched away?
RS485schematic-JF2024-03-28.thumb.png.6ce7d35f82e92490bfcba239a486f44b.png
Why the resistor and the condensator?

Gesendet von meinem SM-G988B mit Tapatalk

Posted
33 minutes ago, Rapti said:

Why the resistor and the condensator?

Gesendet von meinem SM-G988B mit Tapatalk
 

Looks to me like the resistor pulls the enable lines low in case the Arduino doesn't.
The Capacitor (the English name for it) smooths and reduces noise on the power supply.

  • Like 1
Posted

The pulldown resistor is not required. It has been recommended somewhere here in the forum in case you have problems to receive data (RE low = receiver enabled).

As No1sonuk already wrote, the capacity is to reduce noise in the power supply. It is optional too.

Regards, Vinc

  • Like 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

  • 4 weeks later...
Posted

I have now made a diagram of the wiring. Can anyone confirm that this is correct?
I think I have read that there can be problems using an Arduino MEGA as a slave? Is this correct?

RS485_wiring.png

Posted
6 hours ago, Rapti said:

I have now made a diagram of the wiring. Can anyone confirm that this is correct?
I think I have read that there can be problems using an Arduino MEGA as a slave? Is this correct?

RS485_wiring.png

There have been some issues with a Mega as a slave, and yours might be wired incorrectly anyway.
I think you need to use TX0 and RX0 if you're using the Mega as a slave.
You use TX1 and RX1 for the RS485 network on the master because TX0 and RX0 are used for the USB comms.  All the other Arduinos are disconnected from the USB, so TX0 and RX0 are used on those.

Posted
10 hours ago, No1sonuk said:

I think you need to use TX0 and RX0 if you're using the Mega as a slave.

you are right. I will try it. Thanks.

Posted (edited)
23 hours ago, Rapti said:

I have now made a diagram of the wiring. Can anyone confirm that this is correct?
I think I have read that there can be problems using an Arduino MEGA as a slave? Is this correct?

RS485_wiring.png

 

 

Here you can find the discussion on how a slave Mega should be connected

https://forum.dcs.world/topic/310930-maximising-the-use-of-arduino-nanos-max-switch-connections-possible/#comment-5083746

 

You also may have a look into previous RS485 related discussions. I recommend the second layout from that posting

https://forum.dcs.world/topic/208455-dcs-bios-over-rs485/?do=findComment&comment=3926198

 

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
Il 29/4/2023 at 12:37, Vinc_Vega ha scritto:

Hi Les,

first impression from here

https://store.arduino.cc/products/arduino-nano-every

They say: pin compatible and code will still work.

I try to get one or two for experiments.

 

Regards, Vinc

 

Hi Vinc,
one year from this post, did you have the chance to try those every ? 
I'm having problems with them, same code of a clone nano, uploaded, connected directly to USB
i see the code and also the change of code when i press one switch but in the virtual cockpit it doesn't happen anything ! 
Really weird as they say it's compatible with nano.
Thanks for any suggestion.

 

Posted (edited)

@Strale Hi

I decided not to try the Nano Every as I had enough of the "regular" Nanos available and ESP32 modules in several form factors. Anyway, other members reported of unsolved problems. Sorry!

Maybe @lesthegrngo or @outbaxx have more experience with that kind of chips.

 

Best regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted (edited)

Thanks VInc,
i was thinking that upgrading to original Arduino was the right choice but hell
i can upload the sketch but even if i see the code changing when pressed a switch
it doesn't do anything in the virtual cockpit.
That's a shame 🙂

Thanks 

UPDATE
I know the rule but sometimes i loose myself ! Think twice .. buy Once ! Indeed NANO EVERY, against the statements on Arduino web store, 
are not compatible with Nano Sketches at least while using DCSBIOS ! I returned the board to Arduino and waiting for a full refund.
Next time i'll write the rule on a post-it and place it on my monitor. 🙂 

 

Edited by Strale
Posted
On 4/26/2024 at 3:13 PM, Vinc_Vega said:

 

 

Here you can find the discussion on how a slave Mega should be connected

https://forum.dcs.world/topic/310930-maximising-the-use-of-arduino-nanos-max-switch-connections-possible/#comment-5083746

 

You also may have a look into previous RS485 related discussions. I recommend the second layout from that posting

https://forum.dcs.world/topic/208455-dcs-bios-over-rs485/?do=findComment&comment=3926198

 

Regards, Vinc

 

So i tried it with 1 MEGA as the Master, a MEGA as slave 1 and a Arduino UNO as slave 2.

--> it worked! But I had to change the RX/TX on the clone mega's. I wired it exactly as in my picture above exept the slave mega uses TX0 and RX0, as No1sonuk mentioned.

rs485.jpg

  • Like 1
  • 2 weeks later...
Posted

After the succesful test, I designed the PCB's for th RS485 modules.
I will connect each board with these micro latch connectors. The screw terminals are for connecting the arduinothe the board. The Red ans blue jumper is for deconnecting the RX ans TX when loading New arduino sketch. da5de4c4848cde89d328a9a6798ec6b0.jpg68b7741b116507b6b428e44d594a0ce0.jpg08f1cb30772ec9ed97f6451d90b11b7d.jpg

Gesendet von meinem SM-S928B mit Tapatalk

  • Like 1
  • 2 weeks later...
Posted

It works!!! I tested 3 slaves. 1 Uno and 2 Megas. Just the Master connected to the PC. The slaves are communicating via the RS485 modules.0746f9b3a4ff3a095ad1d122e934f81f.jpg

Gesendet von meinem SM-S928B mit Tapatalk

  • 1 month later...
Posted

Hi. Does anyone have a link for max 487s that are not very expensive, but functional. My last order on Aliexpress I ended up with chips they were all degraded with random operation and they are currently 5 dollars on Mouse

  • 1 month later...
  • 4 months later...
Posted

Hi,

I am in the process of doing a RS485 Network.

Right now i have a Mega as a Master and three Unos as Slaves, all working as it should.

If i connect a 4th Uno Slave to the Network then there is no Communication .

Or do i have to define more Pins in the Master Sketch ?

#define UART1_TXENABLE_PIN 2  // for 3 Slaves

#define UART2_TXENABLE_PIN 3 // for the next 3 Slaves ??

#define UART3_TXENABLE_PIN 4 // for the next 3 Slaves ??

Thanks 

Wishing you all the best 🙂

 

 

20241223_001111-912x426.jpg

Posted

@JohnnyChicago

No, you can hook up to 128 slaves to one bus. But nobody has experience with that amount. Just remember to give a slave it's unique number within the net.

You enable the other pins at the Mega to have two more buses.

Regards, Vinc 

  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

  • 3 weeks later...
Posted

Hi, i still need some help here.

My RS485 Network is based on image below. Difference is , i have one Mega as a Master and the rest are all Nanos.

On the image below  there are only two Slaves.. I plan to have have 5 or more  Slaves !

I made a test with breadboards with one Mega Master and two Uno Slaves.. all worked as it should !

But when i add a 3th or more Slaves (like in the image below) then there is no more communication on RX / TX..(RX / TX Led is going off on Slaves)

So how i can i connect 128 slaves in theory when the maximum is 3 ??  (I know the Mega has multiple TX / RX Lines)

 

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

 

 

RS485.jpg.a3018209e21efecf7b26756cc6892c69.jpg

Posted (edited)

@JohnnyChicago

The images from the first page of this post show similar graphics, but maybe a little bit clearer.

The Slaves must be connected via the RS485 bus only and not to the USB port at the same time.

It also may help to use a common power supply for all Arduinos.

 

As I had difficulties to directly link the pictures, here they are again.

cnJVSvKh.jpeg

LlDsLIVh.jpeg

 

For the software, you have to use the sketch from Arduino\libraries\DcsBios\examples\RS485Master\RS485Master.ino for the Master ONLY (Mega).

Have a look at line 5 of the sketch RS485Master.ino

#define DCSBIOS_RS485_MASTER

If using a single RS485 bus, you may comment out the UART definitions as follows

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

 

The sketches from Arduino\libraries\DcsBios\examples\RS485Slave\RS485Slave.ino are for all your Slaves and therefore, have to be adjusted in line 6, so that each Slave has a unique identifier.

The example in RS485Slave.ino is for Slave No. 1

#define DCSBIOS_RS485_SLAVE 1

For a second Slave you have to use another Slave number, like

#define DCSBIOS_RS485_SLAVE 2

and so on ...

 

Regards, Vinc

Edited by Vinc_Vega
spell correction

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

  • Recently Browsing   0 members

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