[SOLVED] Moving my project to independant atmega328p-pu and I2C not working

Hi folks,

First of all, thanks in advance!

I have a project running smothly on an Arduino UNO (smd) together with a motor-shield. The idea it's the following:

I have a Raspberry-PI connected with Flight Simulator X and then to Arduino UNO using I2C. The compass of the plane on the simulator moves the stepper motor connected to Arduino.

Everything is working perfectly and now I want to move the project to an stand-alone ATMEGA328p-pu (freq. 16Mhz) chip that I bought from internet with optibot preloaded. I transfered the sketch to the chip, the program works, the control of the stepper works but raspberry don't recognize the I2C device (so seems that I2C it's not working). I verified again and again the wiring and everything seems right.

NOTE: I'm not using any 3,3v to 5v level switcher between Arduino-UNO and Raspberry as Arduino it's working as a slave and only receiving data. (and anyway this it's not a problem when connected to UNO)

Why the project works on the Arduino board and not on the stand-alone ATMEGA?

Any ideas?

Thanks!!!
:stuck_out_tongue:

Please post a picture of your setup. My guess is a problem in the power supply, missing decoupling or missing I2C pullups, but as I wrote, that's just guessing.

This is my scheema, I didn't post it because it's the most simple configuration. I tried to activate & deactivate the internal pull-ups on I2C, but nothing happened. And again, the most strange thing is that when I'm using Arduino UNO board everything works fine. According the UNO scheema I didn't saw any external pull-ups on I2C line.

Thanks!

scheema.jpg

Sorry, In the scheema I didn't included the the connection itself

R  RX | ----------------------------- | TX     AT
P  TX | ----------------------------- | RX    MEGA
i  GND| ----------------------------- | GND   328

Ok, guys! I realized that I'm half idiot :blush: .

I used D1, D2 instead of A4 A5 to interface with I2C!

:sweat_smile:

So sorry!