another pull up and output pin question

Hello,
If I have two Arduinos, and I want one pin on Arduino A (output) to be a signal to Arduino B (Input). Can I configure Arduino A's output pin as output, and configure Arduino B's input pin as INPUT_PULLUP? That way, Arduino B will digitalRead a TRUE if ArduinoA Output HIGH, and digitalRead FALSE if ArduinoA Output is low? And if the output is not connected, Arduino B will be sure to read a HIGH signal because of the pullup instead of float?

The thing I'm not sure about is that Arduino A's Vdd could be slightly different than Arduino B's Vdd. Is that OK?

On the flip side, when the Arduino A's output is set to low, will there be current flowing, basically from B's Vdd, across the 20k internal pullup resistor, to ground on Arduino A?

The two Arduino have their ground pin tied together.

You are essentially describing an open collector.

Going one step further would complete the model…

For the idle / HIGH state both Arduinos should have their pins configured as INPUT_PULLUP.

For the signal / LOW state either Arduino should first change the pin to INPUT then OUTPUT.

Idle / HIGH…

  pinMode( SignalPin, INPUT_PULLUP );

Signal / LOW…

  pinMode( SignalPin, INPUT );
  pinMode( SignalPin, OUTPUT );

That small change allows any number of Arduinos to signal the others.

arusr:
The thing I'm not sure about is that Arduino A's Vdd could be slightly different than Arduino B's Vdd. Is that OK?

Yes. But do not directly connect the VDDs in that situation.

No, its not safe at all. If the receiving Arduino is powered down the signal will phantom-power it and
perhaps pop either of the Arduino pins or do worse damage.

You need to use an open-collector bus connection.

On the driving side set the output permanently LOW, and toggle pinMode between OUTPUT and INPUT
to send data.
On the receiving side set the input INPUT_PULLUP.

Whenever the transmitting side is powered up and set to INPUT, the receiving side will see HIGH.
All other conditions the receiving side will see LOW. By never driving the output high only the pull-up
in the receiving side is available to pull the signal high, and that is not powerful enough to
phantom-power anything.

Perhaps a simpler approach is to put a 10k resistor between the two Arduinos in the signal path,
which will reduce the maximum signalling rate a little, but prevent phantom-powering damage
through hardware.

@"Coding Badly", thanks for the info. I'm curious why the Arduino that wants to signal has to do a pinMode to input first, then assert 0 as output? Does first pinmode turn off the pullup resistor? So the Arduino that wants to signal is actually removing the pullup, and then asserting GND on that pin? That would pull the other Arduino's input from 1 to 0, because it's basically grounding the pulled up pin?

I think that makes sense. Just double checking, thank you.

arusr:
@"Coding Badly", thanks for the info. I'm curious why the Arduino that wants to signal has to do a pinMode to input first, then assert 0 as output? Does first pinmode turn off the pullup resistor? So the Arduino that wants to signal is actually removing the pullup, and then asserting GND on that pin? That would pull the other Arduino's input from 1 to 0, because it's basically grounding the pulled up pin?

I think that makes sense. Just double checking, thank you.

Yes, you understand it right. As alternative you may use digitalWrite(LOW) to disable pullup an digitalWrite(HIGH) to enable it on a pin configured as INPUT.

arusr:
@"Coding Badly", thanks for the info.

You are welcome.

arusr:
I'm curious why the Arduino that wants to signal has to do a pinMode to input first, then assert 0 as output?

This is the alternative...

  pinMode( SignalPin, OUTPUT );
  pinMode( SignalPin, INPUT );

...which drives the pin HIGH then LOW. If another processor has already driven the line LOW then, for a brief moment, there is a short-circuit between the processors.