u/skilfulsun

MSP430 I2C Debugging Questions

Hello!

BACKGROUND:

I'm working on an MSP430F2616 microcontroller and noticed some weird issues related to I2C. I was hoping I could get some clarification or thoughts on some things.

I have a self-test LED that lights up when everything is good, and blinks for errors. It checks a couple DAC outputs and whether the I2C display is connected and working. If there is no display, it continues working as normal. Display is not required.

I noticed an issue where after flashing the board some would light up just fine, but others would not light up at all which shouldn't happen in the code. I looked through and saw plenty of infinite loops in the i2c transmission method and it was getting stuck waiting for the NACK, since no display was connected.

I was wondering why that might occur on some boards but not all so I looked through the parts and everything on the board is fine.

QUESTIONS:

When debugging I see the data and clock pins go high when initializing, but as soon as I initialize the I2C on them they go low. I'm using pins 1+2 and port 5. I'm watching P5IN to see the level of the pins. I was wondering if I can't get an accurate view of those pins through the debugger when they are in I2C mode? Is that normal when setting the pins as I2C?

Also, is it possible if I don't properly perform an I2C reset that the bus can be put into an unstable state, and cause the NACK to not occur when testing to see if a display is attached?

Sorry for the long message, but thanks for any ideas!

reddit.com
u/skilfulsun — 12 hours ago