Go Down

Topic: Switching betwenn arduinos (Read 488 times) previous topic - next topic

jetraid

I have 2 arduinos running different codes (no my codes) the input and output devices managed from these codes are the same and with the same pinout. There's a way to switch betwenn arduinos, may crazy idea is to switch off one arduino and switch the other on, but I don't know the state of the arduino pins when are without power.

jremington

#1
Aug 26, 2019, 10:57 pm Last Edit: Aug 26, 2019, 11:34 pm by jremington
In general, it is a bad idea to directly combine output pins. Use a multiplexer instead.

Especially, never connect an unpowered device to a powered device through input/output pins. Doing so can damage one or both devices.

Grumpy_Mike

#2
Aug 26, 2019, 11:23 pm Last Edit: Aug 27, 2019, 12:09 am by Grumpy_Mike
You don't need two Arduinos, you just need to learn how to program. We can help with that if you give more details.

raschemmel

It can be done with multi-pole doublethrow relays.
The switching itself can be done with an Lm555 driving transistors or mosfets which drive the relays.

Paul__B

You don't need two Arduinos, you just need to learn how to program. We can help with that if you give proper details.  :smiley-roll:

raschemmel

Quote
There's a way to switch betwenn arduinos, may crazy idea is to switch off one arduino and switch the other on, but I don't know the state of the arduino pins when are without power.
The responses you are getting are the result of you not explaining your reason for wanting to do this.
Without that, it makes no sense.

MarkT

xyproblem.info

Explain what you want to do, not how you imagine it should be done.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

jetraid

I have inputs  (swithcs, buttons, encoders,etc) and outputs (mostly leds and some servos) on a flight sim panel (the pinout is the same) if I want to use one  simulator I need  to use one arduino with a programmed code (I don't have the code) if I want to use other simulator software i have to switch the arduino with other with other code inside, now I use 2 arduinos with a homemade shield, disconnect one arduino and connect the other. I need to solve the problem of changing arduinos.
Thanks in advance.

Grumpy_Mike

So is your code so big that it won't fit into the flash memory of one Arduino? If so you can use an Arduino with bigger flash memory.

You just need to read a switch on start up to switch the code into one routine or the other. No need to use two processors.

CrossRoads

#9
Sep 04, 2019, 11:56 pm Last Edit: Sep 04, 2019, 11:57 pm by CrossRoads
The Arduino has a Reset input pin. When it is Low, the IO pins all go to Input state.
Hold it Low for the Arduino that is not running, let it go High for the Arduino that is running.
Can get by with just a toggle switch with COM connected to Gnd. NC to one reset, NO to the other.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

#10
Sep 04, 2019, 11:59 pm Last Edit: Sep 05, 2019, 12:20 am by CrossRoads
Or, change to a Atmega1284P with 128K of memory and 16K SRAM, plenty of room for the two sketches.
Code: [Select]

void loop(){
    if (digitalRead(selectPin) == LOW){
    // running sketch 0
    }
    else {
    // running sketch 1
    }
}
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paul__B

So is your code so big that it won't fit into the flash memory of one Arduino? If so you can use an Arduino with bigger flash memory.
No, he didn't say that!

He said:
I don't have the code

raschemmel

#12
Sep 05, 2019, 12:25 am Last Edit: Sep 05, 2019, 12:27 am by raschemmel
Quote
I have inputs  (swithcs, buttons, encoders,etc) and outputs (mostly leds and some servos) on a flight sim panel (the pinout is the same) if I want to use one  simulator I need  to use one arduino with a programmed code (I don't have the code) if I want to use other simulator software i have to switch the arduino with other with other code inside, now I use 2 arduinos with a homemade shield, disconnect one arduino and connect the other. I need to solve the problem of changing arduinos.  
This is still not clear.
You have not explained what you project is or what the arduinos are doing and why you need two
arduinos.

You talk about arduinos and code you have not said one word about what all this is for or why you are doing it.

Put simply, you haven't really said anything that makes any sense.

Go Up