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.

MSPM0G3507: i2c multibyte write without use of interrupt.

Part Number: MSPM0G3507

Tool/software:

I have eeprom and i want to write complete page(8 byte).  page size of eeprom is 8 byte. and i2c fifo is also 8 bytes. so in single transaction  I am not able to send page address along with 8 byte data. i dont want to use interrupt based method. what to do?

  • The notion is that you start a (TX) transaction giving the full size you want to send (address + data), then use the busy-wait time to put data in the TX FIFO (as space permits). The I2C unit provides flow-control, so it's not the end-of-the-world if the TX FIFO goes empty; on the other hand, you have plenty of spare time since your CPU is (presumably) running Much faster than the I2C.

    Unsolicited: Some time back I read that TI wasn't planning to update its AppNote SLAA208 for the MSPM0 series, so as an exercise I did it. Maybe you'll find something useful here:

    https://github.com/brucemckenney/i2c-eeprom-mspm0

  • Hey i have seen this code but have some doubt. Why so many busy wait? and not understood if you not enabling interupt then how will you check on that?

  • In the absence of interrupts, we're left with busy-waiting.

    The original SLAA208 used interrupts/LPM for the data transfer (but not for AckPolling, which is the long operation); it did that by hard-coding which I2C unit (USCI) it used, so it had to be modified for each MSP430 device variant. This code will (as far as I know) operate on any MSPM0.

    You're welcome to adapt this code to your needs (or ignore it).