I2C doesn't work

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello there,

is it possible, that I2C does not work properly on the XMC4500?

I tried it on several boards (Infineon Hexagon and self developed boards) and I always end up in the same situation. I reduced my project to just an I2C001 app in Dave3 and connected nothing on the pins but an oscilloscope. When I configure the I2C pins to be push pull, I can see the clock signal as expected when I use I2C001_WriteData(). So far everything is fine, except from the fact, that it makes no sense to combine I2C and push pull.

So I configure the pins to be open drain via the UIModelEditor and connect a wired 4.7k pullup resistor between the desired pin and VDD3. This setup makes sense from the electronical point of view. Unfortunately it doesn't work for the most cases and I see only a constant high level on the oscilloscope. In some rare cases open drain works, but I can't tell you, how to achive this. When I reconfigure the I2C signals to another pin and later switch back to the old configuration it doesn't work anymore. Until now I was not able to figure out the pattern behind this behaviour. I'm very sure that I use the scope and Dave3 in the right way, since I use these tools every day and keep myself busy with this problem since a full week.

I am using Dave 3.1.10 with the latest app store installed. Therefore my I2C001 app is of the version 1.0.28. I observe the same behaviour on boards with the AB and AC stepping of the XMC4500. Since it seems to work in some cases, my guess is that Dave generates faulty code. On the other hand I can't find anything suspicious in the generated code. When I look in the port pin registers with the debugger, everything looks fine (at least for me). This supports the theory that the controller itself has a problem.

I can't find anything in the errata sheets. So I'm open for any suggestions.

Cheers, Felix
0 Likes
2 Replies
Not applicable
I forgot to mention: When I configure the same pins in the same hardware setup to be open drain but use IO004 instead of I2C001 the pins work exacly as expected. So it seems unlikely to me, that the problem lies in the way I validate this issue.

Cheers, Felix
0 Likes
Not applicable
As always, the moment you ask some people for help you realize your own stupidity. I always measured only the clock signal and therefore connected a pullup resistor only to that line. This left the SDA signal line open and therefore I received sometimes a busy bus and sometimes not. What a greenhorn mistake ...
0 Likes