Two Arduino Nanos accessing same module(W25Q64).

Thread Starter

DaveInNevada

Joined Apr 15, 2021
12
I have this small project where 2 Arduinos utilize the same Memory Module. My worry is the one Nano will fry the pins of the other. I need to use a buffer of some kind to make one Nano appear missing from the circuit. One Nano writes data to the module at 6:00am, then the other nano accesses that data after 6:00am for the rest of the day. But both are always powered on and both are connected to the memory module. Can a buffer be used here? Or maybe utilize the RESET on the first NANO somehow to make it appear High-Impedance to the other. Any help will be appreciated. Thanks.1.jpg
 

sagor

Joined Mar 10, 2019
909
One possibility is to use a data line between the two Nano to indicate which Nano wants to talk to the Module. The Nano that is "not talking" to the module could set their lines as input (high impedance) state as to not interfere with the other Nano.
How you hand-shake between the Nano would be up to you...
If the Di and DO and CLK lines have pull-ups, then the DO pins can be shared. The DI lines have to be set in a high state on the Nano that is NOT talking or listening.
Not trivial, you have to watch the state of the lines and control the pins on both Nanos
 

mckenney

Joined Nov 10, 2018
125
The SPI pins don't have separate alternate-function control, so when idle you should make sure SPE=0. That will keep /CS and MOSI from driving against the other Nano.

You'll probably want a GPIO pullup (internal or external) for /CS and MOSI (DI) so the slave doesn't get confused.

Be fairly sure about the schedule -- if the two Nanos happen to run at exactly the same time, the conflict over /CS will cause one to abruptly switch to slave mode.
 

Thread Starter

DaveInNevada

Joined Apr 15, 2021
12
One possibility is to use a data line between the two Nano to indicate which Nano wants to talk to the Module. The Nano that is "not talking" to the module could set their lines as input (high impedance) state as to not interfere with the other Nano.
How you hand-shake between the Nano would be up to you...
If the Di and DO and CLK lines have pull-ups, then the DO pins can be shared. The DI lines have to be set in a high state on the Nano that is NOT talking or listening.
Not trivial, you have to watch the state of the lines and control the pins on both Nanos
I appreciate your feed back. So I think I understand what you are saying. At 6:00am after the 'TOP' Nano transfers in the data to the Memory IC, then change the pin-states on the top Nano to Inputs, such as pinMode(pin#,INPUT_PULLUP); (I didn't realize you could change pinModes outside of the Setup Function, good to know).
I'll try it, but I was hoping that their was a way to disconnect the top Nano after 6:00a using some type of Isolation Buffer, something that I am trying to learn but havn't really got a handle on yet.
 

Thread Starter

DaveInNevada

Joined Apr 15, 2021
12
One possibility is to use a data line between the two Nano to indicate which Nano wants to talk to the Module. The Nano that is "not talking" to the module could set their lines as input (high impedance) state as to not interfere with the other Nano.
How you hand-shake between the Nano would be up to you...
If the Di and DO and CLK lines have pull-ups, then the DO pins can be shared. The DI lines have to be set in a high state on the Nano that is NOT talking or listening.
Not trivial, you have to watch the state of the lines and control the pins on both Nanos
Everything works. At 6:00am it writes it's data. Then sets its' 4 pins CS, CLK, DI, DO all to Inputs. The 2nd Nano(bottom) does it's thing all day. When it is done, it sets its' 4 pins to All Inputs to appear invisible to Nano-1, and the process starts all over again. Ran 2 wires between the two Nanos to communicate who is accessing the W25Q64 at that time. Thanks for your help. Love this forum :)
 
Top