2

I want to communicate through I2C between a Raspberry Pi 4 and an ATMega4809 (Arduino Nano Every or Curiosity).

Since SDA/SCL pins in Raspi Pi are 3.3V and in ATMega4809 are 5V I thought I had to use a logical converter, for which reason I'm trying to use an 8-Bit Bidirectional (TXS0108E).

The problem is that the logical converter seems to be quite unstable because when I have everything connected I detect on and off signal quite randomly. I'm using i2cdetect and setting up 0x18 as address:

With signal:

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --    

Without signal:

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

If I wire directly SDA/SCL pins I have a stable connection. However, I'm afraid that using it directly I might damage RaspiPi pins that work at 3.3V.

EDIT: schematics:

enter image description here

17
  • You need to demonstrate to us that your wiring is correct.
    – joan
    Jul 24, 2020 at 19:31
  • @joan, added the schematics. Thanks.
    – Miguel
    Jul 24, 2020 at 21:05
  • 2
    The schematics show what you meant to do. We need photos of what you actually did.
    – joan
    Jul 24, 2020 at 21:41
  • 2
    Thanks for all the inputs! I want to use I2C because I want to leave UART free to program the AVR directly. I'm still a bit newbie in this field and I'm using TXS0108E just because it was one of the first I found from a google search. Do you think is ok to just don't use a logical converter? I'm using ATMega4809 as a slave and up to now, I get good results when I connect SDA/SCL directly.
    – Miguel
    Jul 25, 2020 at 10:18
  • 2
    @Miguel 14, (1) Well, Rpi4B has 5 UARTs on board, and you can always use USB to UART adapters/cables to get as many UARTs as you want. (2) I always recommend to use logical level shifter to convert Rpi 3V3 GPIO pin signal to 5V. If you directly connect Rpi I2C 3V3 signals to Aruino 5V I2C pins, there is 1% chance that "latching up" might occur and your Rpi might be fried, or has its life shortened. You might like to search "latching up" in this forum. Have a nice day. Cheers.
    – tlfong01
    Jul 26, 2020 at 0:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.