AtMega32u4 I2c not working properly

haha thanks for the tips =)

The first image is my first setup(the blue breadboard) i added lots of decoupling capacitors
The Second image is of my next setup (white board) is the one where i ensured all of the connections are good. I tried a larger 330uF capacitor and it works well for my mac. But not for my windows PC.

If anyone cant see the image clearly, i have 3 black capacitors , one for UCap, one for reset to GND ( i followed a tutorial on how to prevent auto reset on the website) and the one on the rails is my test decoupling capacitor.

From my experiences with bread boards, theres always some parasitic capacitance so i tried removing it with a large capacitor , it might not be the solution , this is just for testing.

again, i based my layout on

http://murchlabs.com/monday-experiment-bootloading-an-atmega32u4-with-arduino/

with the modification of the UVCC on pin 7 connected to VCC and the capacitor on Reset.

Btw, if you are wondering why dont i have pullup resistors on the I2C rails, its because with it, i dont get any results on the serial monitor. On the oscilloscope, the pulses are significantly lower in amplitude . I have read up on proper values of the pullup resistor for both SDA and SCl lines and i have used resistors ranging from 100R all the way to 10K and the best results is that without the resistors.

The decoupling capacitor for the oscillator is 22pF as recommended
Ucap is 1uF
and the one from reset to GND is 10uF

i have also tried the setup where there is a pullup resistor from reset to VCC. Same results.

Thank you all again so much for your time.

Hello again, i bring updates. So i added a trimmer pot to the SCL line and tuned it until i get something. and it started working on my windows without the presence of the oscilloscope . So i took out the trimmer pot, measure the resistance , and it came out as 132 R. i am still trying to find a resistor combination that suits this, but it appears to be my pullup resistor values has to be in some specific range to work.

Has anyone faced this problem before?

You must have a pretty hefty capacitive load on the SCL line if you need 132 ohm to pull it from low to high. 4.7K for 5V and 3.3K for 3.3V are usually plenty.
With 132 ohm, that's 25mA to bring the line low if pulled to 3.3V
And 38mA for 5V?
Doesn't sound to me that things are wired correctly.

hi, could it be that it has an internal pullup? thats the next thing that i will be checking. Also i have not included a resistor on SDA, im about to run more tests. Should i monitor current draw as well?

edit: i have added a resistor combination to make up that value, and now i can get consistent results, however, as crossroads mentioned, i think something doesnt sound right.. Normally it would be in the thousands of ohms.. unless there is an internal pullup? is there a way i can test this?

The crystal should not connect via wires, but directly to the pins.
The 22pF should be as close as possible to the crystal and to a GND pin of the ATmega32U4.

I see a Adafruit logo on that pcb, but I can't find that breakout board at Adafruit.com

You need a good oscilloscope to see what is going on.
What about the power ? Is it too high or too low, or very noisy ?

With all your tests, what was the same all the time ?

I stick to my advice : Buy an Arduino Leonardo board, and make that work. If that works well, you can try to copy it to this. You might have damaged the I2C chip, or the ATmega32U4 chip. The ATmega32U4 can be damaged for only a part while other parts inside the ATmega32U4 still work. If you are really stuck, start all over again.

hi, Its an adafruit TQFP 44 breakout board .

Do you mean power of the I2C lines or power consumption of the board?

In all my test, the only thing that i have changed is the pullup resistor values, decoupling capacitors and playing around with the reset pins.

And i will take your advice if i cant solve this by next week. it is probably more reliable to buy a ready board. But i will try a little bit more..until i am fairly certain that i have no other option or time. you could be right with me damaging the I2C with all the testings, something was bound to go wrong.

but for now, the RTC seems to work fine, i will try with other i2c devices and see what happens

edit: i have tested with an I2C display and it works perfectly, No lags, no noise, like how it would work on a normal arduino, and the thing that fixed it is the 132 ohm resistor?

what peter said could be right, that i have damaged the I2C chip internally and have somehow manage to find a Resistance that hits the sweet spot of the line. Its all just my theory anyway.

I will continue to do more testing and see if this setup can do what i need it to do. I will report what i find.

With power, I mean the 5V power. Is that from the USB ?

With what was always the same (when it did not work), I mean: perhaps always the same location, for example next to a wifi router, or your neighbour has a radio transmitter, or always the same computer, or always the same power supply, or your mains power wires have something weird, or the table top is conductive.
I assume that the wires and bad contacts of the breadboard are most likely the cause, but look a little broader then just the project in front of you.

Yes Sir, Im about to call it a day, got it to work for now, ill be at a camp helping kids with electronics over the weekend so i will continue debugging when i get back.

Thank you all for your help

but look a little broader then just the project in front of you.

will do, i mean it was strange when the serial monitor only worked on my mac and not my windows.. thats still something i will find out after the camp.

Anyways , gotta pack, Good night for now
Cheers