Hello Jerry, What actual slave device are you connecting to? At what line does the code get stuck? Can you provide logic analyzer or oscilloscope screenshots that show a break in communication (NACK, clock stretch, or otherwise)? The code examples you've merged together are not completely congruent, for example you set the UCASTP_2 bit in UCB0CTLW1 from the receive example yet you also manually send a stop condition after finished transmitting. The slave address and interrupt enable bits are re-initialized inside of every read function unnecessarily. You also never write the register number that you want to read from after initialization, on some slave devices it will continue to increment the register address until an overflow or invalid address occurs. You also never use while loops to make sure that the buffer is clear before filling it with new data. This all to say that there are several changes and debugging steps that need to be made to the current code. e2e.ti.com/.../msp-i2c-getting-started-guide Regards, Ryan
↧