Mega TX2 outputs 5v that powers other Mega - is this correct?

Hello,

So I've got a problem to solve involving serial communications between two arduinos and there are many weird and intermittent symptoms at the moment. However at least one of the weird things is constant, I'd like to know more about it and maybe rule it out.

So if I've set up Serial2 on two megas and connect:

mega1_TX2 -> mega2_RX2

...but not power mega2 by any means, it'll power up :-\

I see 2.8v on the 5v rail of the receiver (weird?) and the TX pin is sitting at the rail voltage of the transmitter (normal?). The pwr LED on the receiver is dimmer, and/but the program on the receiver (mega2) appears to be running (I have a kind of watchdog toggling the pin13 LED).

Although one is a 1280 and the other 2560 I can do the same trick the other way round so with mega2_TX2 -> mega1_RX2 I get the same carry on.

Once I plug in USB or DC power the units will power up properly.

(although when giving it 6V, which is according to spec within range, I'll only see 4.3v out of the regulator, but I think that is another story).

The original problems happen when powered properly, so it might be unrelated - but I do wonder, the code seems solid to my eyes or at least consistent, and 'intermittently intermittent' problems indicate maybe something electronic instead.

The code on mega1 takes input serial data via USB then passes approx half of it to mega2, which simply receives. The breakdown in comms (mega2 works, mega2 does nothing, mega2 is sketchy as hell) appears to be between the two megas, USB to mega1 is working fine...

Any tips/thoughts appreciated - pity I don't have an LCD with me which would greatly help in problem solving on mega2 ::slight_smile:

I see 2.8v on the 5v rail of the receiver (weird?) and the TX pin is sitting at the rail voltage of the transmitter (normal?).

Normal state for arduino TTL serial tx/rx pins is that both will be at +5v while no communication is going on.

ok, thanks for that info - but:

So if I've set up Serial2 on two megas and connect:

mega1_TX2 -> mega2_RX2

...but not power mega2 by any means, it'll power up

I see 2.8v on the 5v rail of the receiver (weird?)

?

So if I've set up Serial2 on two megas and connect:

mega1_TX2 -> mega2_RX2

...but not power mega2 by any means, it'll power up

You are probably back feeding the mega2 5v from the mega1 tx thru the mega2 rx. The mega2 rx is probably held high thru a high value resistor between the mega2 rx and mega2 5v. If you have a ground connected between the two megas, then a complete circuit is made.

Yip, that is as described.

So, the question is... Does that cause issues with serial comms?

If the TX pin is supplying as much current as it can to the receiving mega - I suggest this is the case as the receiving mega isn't fully powered - isn't that going to cause issues?

Trying to rule it out. I need to share ground as I'm running servos off a 6v external supply, they need to share ground with the arduino, and I only have one supply, hence the arduinos also share the same ground.

So, the question is... Does that cause issues with serial comms?

Under the given conditions I don't really understand this question. You say you measured 2.8v on the slave mega. Can this mega actually run on 2.8v?

If the TX pin is supplying as much current as it can to the receiving mega - I suggest this is the case as the receiving mega isn't fully powered - isn't that going to cause issues?

Where do you get "as much current as it can"? The tx is most likely held high by a high value resistor much as the rx pin. Put your multimeter on a current setting and measure the amount of current the pin can supply to ground. Probably not much. Not sure just what your real concern is.

when using serial communication, always connect ground (gnd) between the two

the processor will 'steal' any power it can get, even the power on the connected tx/rx lines. this will give lots of problems, as it will most probably reset if it can not get enough power. what you see is the processor managing to run off the small current it manages to draw through the connected rx/tx lines

in essence, make sure both boards are sufficiently powered, from the same or seperate power supply
if the voltage level between the two is different, run the tx/rx signals through a voltage buffer, to avoid problems. connect the gnd lines on both megas

if the signal cables are too long, use simple rs232 converters. (anything more than 10 cm, imho) find these on ebay, they are very cheap. Or use a MAX232 (or alike) to build your own.

You should not power the 2nd Mega by means of the IO pins. You will damage the clamp diodes that protect against overvoltage/undervoltage on the IO pins, and eventually to logic of the IO pin and then you screwed with the 100 pin Atmega2560, and its a $17 part plus shipping if you have the tools to replace it.

IO signals should not exceed Vcc by more than 0.5V, or go below GND by more than 0.5V.
2.8V to 5V on IO pins with VCC unpowered is very much not good.

"Voltage on any Pin except RESET with respect to Ground .............-0.5V to VCC+0.5V"

zoomkat:
Under the given conditions I don't really understand this question.

Read it as 'is this normal behavior?'

zoomkat:
You say you measured 2.8v on the slave mega. Can this mega actually run on 2.8v?

The LED on pin 13 that I use to get an idea of the loop frequency is operating yes (13kHz) - it and the pwr LED are dimmer however.

zoomkat:
Where do you get "as much current as it can"?

I made it up in my head, I figured if the receiving arduino is powering itself but wants 5v - and was given 5v, but upon being given 5v, that voltage drops to 2.8v then the transmitter is probably struggling to give it the required current, and hence maybe the resultant voltage drop, is what results.

Maybe I'm wrong?

The part about the TX pin not having enough current to power an arduino we both agree as true.

zoomkat:
Not sure just what your real concern is.

Maybe we operate on different communication channels :blush: I still feel like the original post outlined that.

I am having serial comms issues, I want to understand and rule out factors. This seemed weird to me, I wondered if it was indicative of something I had done wrong conceptually or electronically.

FigZ:
when using serial communication, always connect ground (gnd) between the two

Makes sense, yes, and to be clear it was, an continues to be this way

FigZ:
the processor will 'steal' any power it can get, even the power on the connected tx/rx lines. this will give lots of problems, as it will most probably reset if it can not get enough power. what you see is the processor managing to run off the small current it manages to draw through the connected rx/tx lines

This is what I didn't know about :slight_smile:

FigZ:
in essence, make sure both boards are sufficiently powered, from the same or seperate power supply
if the voltage level between the two is different, run the tx/rx signals through a voltage buffer, to avoid problems. connect the gnd lines on both megas

if the signal cables are too long, use simple rs232 converters. (anything more than 10 cm, imho) find these on ebay, they are very cheap. Or use a MAX232 (or alike) to build your own.

The board are sufficiently powered, I've tried 3 different setups, all of which should give enough current.

ah ha! the leads are however around 10cm - I'll try shortening them

CrossRoads:
You should not power the 2nd Mega by means of the IO pins. You will damage the clamp diodes that protect against overvoltage/undervoltage on the IO pins, and eventually to logic of the IO pin and then you screwed with the 100 pin Atmega2560, and its a $17 part plus shipping if you have the tools to replace it.

IO signals should not exceed Vcc by more than 0.5V, or go below GND by more than 0.5V.
2.8V to 5V on IO pins with VCC unpowered is very much not good.

"Voltage on any Pin except RESET with respect to Ground .............-0.5V to VCC+0.5V"

Well, it's nice to know that plugging in a serial TX line to a board in an off state could cook it :fearful:

I wasn't trying to do it - it just happened in the process of setting things up and I happened to notice.

$17 huh? ouch (luckily I have access to SMD rework stations at work and university)

Read it as 'is this normal behavior?'

In electronics, things usually work the way they are wired. So I woud say yes.

The LED on pin 13 that I use to get an idea of the loop frequency is operating yes (13kHz) - it and the pwr LED are dimmer however.

That green LED may have a 2.8v voltage drop across it, resulting in some illumination from being supplied a low current from the tx pin, and the reason you measure 2.8v on the board.

Maybe we operate on different communication channels

Probably.

I am having serial comms issues, I want to understand and rule out factors.

Probably best explain what the com issues are if that is what you want to solve.