This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432E401Y: randomly drops register bytes on I2C (master write to LM49450)

Part Number: MSP432E401Y
Other Parts Discussed in Thread: LM49450,

Tool/software: Code Composer Studio

Hi,

I am using an MSP432E401Y microcontroller with an LM49450 I²S amplifier. The MSP432 is I²C master and writes config data via I²C to the LM49450. Each I²C transmission follows (or should follow) the scheme: Master sends Start condition and Slave address, reads an ACK from the slave, sends a register address, reads an ACK again and then writes a data byte onto the I²C bus. Those transmissions are repeated for registers 00 through 08. I tested our circuit using an MSP432 Launchpad and a breadboard accessible to a logic analyzer.

But the MSP432 randomly drops register addresses, i.e. in some half of the instances sends only the slave address directly followed by the data byte.

I adopted the code from "i2c_mastermode_simple_transfer.c" from TI's examples to our C++ project, I had problems getting the Interrupt working and worked around it by polling the Interrupt Flags. Writing one register did work, but writing all registers produced the above-mentioned issue. I simplified the code to an implementation of the flow chart from datasheet chapter 19.3.6.1 but the issue remained. I tried another Launchpad and external I²C pullups in parallel to the internal ones but nothing worked.

Please see attached a logic analyzer screenshot and my code.

Can you please help me solve the issue?i2c-issue-dropped-register-bytes.zip

Best regards,

Christian Mallas

  • Hi Christian,

    Have you taken a look at the MSP432E4 SDK examples for I2C master operation?

  • Hi Dennis,

    yes, I did take the i2c_mastermode_repeatedstart_transfer.c from there. I have changed the code from I2C1 to I2C3, added the LM49450 slave address, register and data values, ran it and got the above-mentioned issue. First, I suspected a swallowed IRQ handler and re-arranged the code from using interrupts to polling - the issue remained. Then, I suspected some side-effect increasing the variable "dataIndex" so I simplified the code into a C/C++ representation of the flow chart given in the MSP432 User Guide (chapter 19.3.6.1) without using a count variable - it didn't work either. I shrank my project to the necessary code to make it easily readable to TI (and hopefully, thereby removing the disturbing code line); I do use 100nF || 10µF bypass caps; I tried different I²C pullup resistor values; pulled up the NMI pin; I even added a ferrite bead into the 3.3V rail. Nothing worked thus far. In some random four of the ten I²C transmissions, all three bytes are sent correctly, so I don't think I have missed one command. I have already successfully run the LM49450 together with a Raspberry Pi and a different, simpler microcontroller as I²C master. In our current project, we have to use the MSP432 instead because of its high performance and feature-richness. I suspect some pitfall yet unknown to me in the MSP432's complex I²C peripheral registers or driverlib or some pitfall like a floating NMI pin. So I asked TI for help...

    Best regards,

    Christian

**Attention** This is a public forum