What is the preferred or recommended method to get bidirectional leveling when communicating between Moteino (at 3.3v maximal output on pin) with devices expecting 5v (and visa versa). Will I damage the Moteino inputting 5vdc at the digital pins such as the Serial I/O?
jerry
I would recommend just using resistor dividers unless you use very high speed communication, but in most cases even 8mhz SPI for instance will work without issues. If you want to go fancy you can get bidirectional buffering modules, adafruit has them. Remember you ONLY have to buffer the lines going INTO the atmega (assuming the other side will pick up 3.3V levels as logic "1").
I don't think there will be any damage to atmega if you input 5V on data lines since the mega328 is 5V tolerant, EXCEPT if you do that on the pins that are connected to the RFM radios (they are not 5V tolerant!).
QuoteI don't think there will be any damage to atmega if you input 5V on data lines since the mega328 is 5V tolerant, EXCEPT if you do that on the pins that are connected to the RFM radios (they are not 5V tolerant!).
OK, i heard on EEVBlog forum that the Moteino's were not 5v tolerant. It would be much easier for me for my RS485 to use the 5v DIP chips I have rather than the 3.3v versions and adding line levelers.
I know they are 5V tolerant but I would not recommend doing that since it's so easy to forget about the RFM69 which only takes 3.3V. So what you heard on EEVBlog is partially true.
This is a problem that I've been discussing with someone else offline. I'm not sure what the answer is.
First, I could not find it in the Atmel datasheets where they "specifically" say the pins are 5V tolerant. Table 28.1 in the mega1284 d/s does say this however [which indicates "not" 5V tolerant]:
VIH Input High Voltage, Except XTAL1 and RESET pins
VCC = 1.8V - 2.4V, VCC = 2.4V - 5.5V
min: 0.7VCC, 0.6VCC
max: VCC + 0.5, VCC + 0.5
Secondly, if you do a google search, practically everyone who responded says when Vcc=3.3V, you should NOT put 5V on the I/O pins.
https://www.google.com/search?q=atmega+5V+tolerant
Thirdly, from my own experiences, apparently like Felix, I've not blown up any mega chips running at 3.3V when feeding in 5V, either.
However, here are two sets of comments I wrote to the other guy in the past couple of days:
>>>>>
The Vin pin on the FTDI header goes to the input of the
3.3V reg. Also, the Rx,Tx pins on the same header go straight to the
mega chips without series-Rs or anything.
Therefore, if you use a 5V FTDI adaptor, the v.reg will operate properly
but you'll be putting 5V on the mega chip I/O pins operating with Vcc=3.3V.
If you use a 3.3V FTDI adaptor, then you have the proper I/O pin levels,
but Vin is too low for proper v.reg operation.
>>>>>
>>>>>
I think what probably happens is, if you put a "hard" 5V on a
pin of a 3.3V chip, it will likely blow the chip.
However, if the 5V comes from a typical CMOS gate, like an
FTDI chip, then the output-resistance of the gate will likely
"safely" limit the current into the clamping diodes in the 3.3V
chip, and therefore NOT blow the chip.
Ie, roughly speaking Ro = Voc / Isc = 5V / 40mA = 125 ohms.
Then ( 5V - (3.3V + 0.7V) ) / 125 ohms = 8 mA into the clamping
diode = relatively safe.
That's my theory, as to why the mote cpus aren't being blown
up all over the place,
>>>>>
This also applies to the many jeenodes that are out there, and have exactly the same FTDI header wiring.
I could test this by applying a "hard" 5V, but don't want to blow up my boards.
BTW, I just received 2 Moteino-Mega boards this weekend, and am happy to say they work GR-E-A-A-A-TTT! so far. Good job with the library software, Felix - I had a really terrible time with jeelib in the past.