different logic levels...

Hello Fellas

if I want to connect two boards via serial and they have two different logic levels (3.3V(5Vtolerant) and 5V)...

The 5V board will be able to send messages, the 3.3V-board can receive, but not the other way round, right?
The 5V-board cant read 3.3V-serial messages, can it?

This is about my ArduinoMEGA2560 and a XbeePro-module. So what do you think?

The 5V-board cant read 3.3V-serial messages, can it?

It should be able to.

Assuming the 3.3V board sends 3.3V for high, and 0V for low, that would be over the threshold of where the 5V board would consider low-to-high to be.

In particular, for the Atmega2560 the datasheet says that a high voltage would be 0.6V upwards when operating at 2.4V to 5.5V.

ok, yes i thought so...

so most of 5v-logic circuits are 3.3v-tolerant!?

Sure, a 5V circuit, as an input, will tolerate lower voltages.

JkbS:
so most of 5v-logic circuits are 3.3v-tolerant!?

Well, in the sense that 3.3<5 yes, but might not be guaranteed that the 3.3 is over the threshold for high and might be read as no-mans-land.

On the other hand, what you say here:

The 5V board will be able to send messages, the 3.3V-board can receive

.... doesn't seem right, since if a board can only handle 3.3 then it won't be tolerant of 5v. It will be "high" yes, but will be too high....

Oh wait, cancel that... I see you said your 3.3v board is 5v tolerant.... sorry.

Well, in the sense that 3.3<5 yes, but might not be guaranteed that the 3.3 is over the threshold for high and might be read as no-mans-land.

It is, according to the spec I quoted. Well over.

if a board can only handle 3.3 then it won't be tolerant of 5v.

He says he has a 5V tolerant board.

It is, according to the spec I quoted. Well over.

Yep, I was talking more generally.

And I was correcting my post about the 5v tolerant board as you posted.... I had just noticed he had said that.

JimboZA:
Well, in the sense that 3.3<5 yes, but might not be guaranteed that the 3.3 is over the threshold for high and might be read as no-mans-land.

ok that was what i was asking for. Thank you. Since the arduino should be able to read 3.3V as high, this should work.

No, it says 0.6 x Vcc, which is 3.0V at a 5V supply. Important not to confuse.

Ach, I thought it sounded low.

OK, 3V, which is still below what the 3.3V device would put out (hopefully) when driving a pin high.

You might need to check the specs for the XbeePro to see what the guaranteed minimum output high voltage was, running at 3.3V, at the loads imposed by the serial port (probably not much).

Hmm, judging by a datasheet I found, it will be a minimum of 0.82 * Vcc, namely 2.7V at a Vcc of 3.3V, so that would be a bit low.

You might want to test how they work in practice, or get a cheap logic-level converter. You could make one with a MOSFET and a couple of resistors. See the Arduino Basic Connections book, page 6.

@jkbS:
Good overview: Logic Levels - SparkFun Learn

Ray

for our applications max ratings are rarely important, typical ratings are a better guideline. for 3.3v/5v interfacing a simple 1k resistor will almost always suffice. depending on direction even that may not be needed.

Adjacent to the input pin, I would think a 10k would suffice, limiting the clamp current to 170µA.

yes. unless you go beyond 100khz where, depending on wiring, stray capacitance can distort the signal. i use 1k or 2k which is still below the (unofficial) 2ma max clamp current. tests show the minimum to be around 200ohms but getting down there would be a bad idea.