Jump to content

Thinking to quit, but it deserves one more (or more...) chanche on RS485


Jocman

Recommended Posts

Hi all.
After several years, I was pretty sure to see "the end of the tunnel": I realized almost the 90% of the physical cockpit (panels with leds, switches, displays, etc), and almost lost my right thumb while working on the metal body of the cockpit.
Following the HanSolo RS485 tutorial, I realized the first working prototypes of RS485 network, then developed my "point of view" of PCB for the Nanos and Megas to use (about 30 in total).
But things aren't going in the right way: most of the switches (7 nanos + 1 mega connected until now) seem working properly, but also strange behaviour:
- delay in responding: even 1,5 sec between the press of a btn and the "virtual" answer, hoping it doesn't get "virtually" stucked (the physical btn is released, but the virtual keep being pressed); it happens even with the switches sometimes...
- the mega giving no sign of life; until I physically unplug the TX/RX connectors and re-plug them....
- I tried to test some leds by the lamp test button (by pressing the virtual one): all the nanos got reset and restarted; I tried again a couple of times, and I had to reload all the sketches because they stopped giving any sign of life..... After reload the sketches, they started to work again (but with the above problems.....)

Well, the solutions: trash everything and switch my mind to get a consolle and play only with platform games (horror and abomination!), or give it a chance (or more...) by changing something or all (and my right thumb thanks...)
So, I will ask you for some info because of my raised doubts:

- Can I power arduino with both 12 and 5 volts at the same time (one direct to Vin, the other on +5)? Until now I used only 5V (for everything), but maybe arduino could work better by using 12V and let him manage his internal power. But in case I'll have even the 5v option

- Still about power: is fine to use a single PSU (my intent is to use an old PC PSU to power all the system-now I'm using a bench PSU)?

- RS485 A-B signal: the 2 wires have to be twisted/shielded/both or 2 straight wires are enough? I see lot of you using a 5-6 wires flat cable, but on some electronic forum they talk about twisted/shielded wires....

- Still A-B signal. I've an alarm shielded cable coil (red/black 1,5 mm and 4 wires 1 mm): may I use the black and red for +12 and +5, and one of the small wires for GND (having so other 3 wires for A, B and 1 jolly)?

- The master can manage 3 lines: is it better to divide the workload among the 3 lines, or even just one line shouldn't have any problem to manage tens of slaves?

- I've seen that Blue73 (https://forum.dcs.world/topic/187748-modular-panel-wip/?do=findComment&comment=3775559) use the RS485 bus even to wire all the arduinos reset pin over the bus network. There's some reason to?

- For my PCBs I'm using MAX487 chips; normally, for MAX486 chips I've read to put a 120ohm resistor between every A-B terminals. But if I'm right, it doesn't need with MAX487, is it?

I'm sorry to annoy you with all those questions, but....

Thanks in advance for your help

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

Link to comment
Share on other sites

First quick answer: do not power the boards by 12V and 5 V at the same time. The 5V will bridge the internal regulator but the pin can be used as stabilized output if using the 12V supply (e.g. for the MAX487 chips).

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

Ok,i won't do it.

So i think i'll separate and use the 12v only to feed the arduinos and the 5v to feed the max487 chips and all the other stuff (leds,max7219,and so)

I'm going on with re-design my PCBs,so i keep waiting for your advices.

 


Edited by 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

Link to comment
Share on other sites

Not sure to understand (sorry, my poor english); currently I'm not feeding anything from the arduino 5V out. All 5V to the various stuff are provided by the PSU (5V 30A), wich, currently, feed arduino too via 5V pin. so Arduino is not overloaded with current

In my plans for new PCB design, I'll use the 12V to feed Arduino via Vin pin, thus the 5V pin will be not connected to anything else.

Aside this, anything about the need / not need to use twisted/shielded/both wires for AB signal?

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

Link to comment
Share on other sites

That's OK then.  It's common to run some devices from the 5V out of the Arduino which comes from the onboard regulator.
They have limited current supply, but if you're already running everything from an external power supply, that's not an issue for you.

WRT the twisted and/or shielded cable:  I've not had problems with my very short test runs using jumper wires.  I guess it depends on how far you need the cables to run, and how much interference there is on the lines.
I will say twisting the wires will mean the interference on both wires will be the same, and because RS485 is a differential transmission system, the same interference on each wire will basically cancel out any effect it might have.


Edited by No1sonuk
Link to comment
Share on other sites

I'm currently using the 12V input and the stabilized 5V as output from the Nano.

Have a look at the layout below for inspiration.

12V is also used to power panel backlight LED strips, dimmed by a MOSFET connected to pin D3 (PWM).

The pullup resistors for the I2C bus at A4 and A5 are optional, same for the pulldown at the MAX487 chip.

If you like the respective fritzing file of the breakout board, just PM me.

 

Regards, Vinc

 

DCS-BIOS-Nano_V12_Schaltplan.jpg


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Thanks for your sharing, Vinc.

Here's my possible new version of PCB (i use kicad). Is intended to be used with Nano (onboard) or,alternatively, Mega (wired). More, there is a rs485 through (from blue73 design).

Possibility to feed Nano with 12 or 5 V (using a jumper)

Jumper to power on/off the Max847

Jumper to enter in "onboard program mode" (i read on italian forum you need just to break the wiring RO→Rx  to do it - hope is right). Btw,is it not enough to unpower the Max487?

Max487 power led

rx/tx led (with plugs to wire external led)

12V rail

5V rails

Now I should make a prototype and test it.

and someway fix my doubt on shielded/twisted wires (well, the distances could be important)....

IMG_20230323_152502.jpg

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

Link to comment
Share on other sites

1 hour ago, Jocman said:

Jumper to enter in "onboard program mode" (i read on italian forum you need just to break the wiring RO→Rx  to do it - hope is right). Btw,is it not enough to unpower the Max487?

 

Hi Jocman,

your design looks good 👍

 

I didn't try to de-power the Max chip for onboard programming.

As you can see, for that purpose I used two jumpers to de-connect the Rx/Tx lines from the Nano (J2/J3).

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

Slave proto made. Not all the components are present, but just to test if everything works.

Btw, for the final version i'll change something:

- Max487 feeded directly by arduino's +5V (keeping the possibility to select if feed arduino by 12 or 5V)

- same thing for the 2 led Tx/Rx

- added 2 leds to indicate the presence of 5V and 12V 

Next step, a new master pcb (but i'm waiting for the components from China) and a RS485 hub

 

16801043850688315780429436684752.jpg

  • Like 1

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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