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.

MSPM33C321A: Does UC13_X I2C Support Multi-Byte Write on MSPM33C321A?

Part Number: MSPM33C321A
Other Parts Discussed in Thread: SYSCONFIG

We would like to confirm the following:

Is it possible for the MSPM33C321A to use UC13_X as the I2C controller and transmit data in the following format?

    [Start] + [Addr + Write] + [Data0] + [Data1] + [Stop]

Currently, we are using the example:
“i2c_controller_rw_multibyte_fifo_poll_LP_MSPM33C321A_nortos_ticlang”

We have configured the settings as follows:

  • Standard Bus Speed: Standard (100 kHz)
  • Write length: 16
  • I2C Peripheral: UC15_0
  • I2C Serial Data line (SDA): PA0
  • I2C Serial Clock line (SCL): PA1

The logic analyzer waveform under this configuration is correct.

 

However, when using the same code but changing the configuration in SysConfig to:

  • I2C Peripheral: UC13_0
  • I2C Serial Data line (SDA): PB8
  • I2C Serial Clock line (SCL): PB9

The logic analyzer waveform shows that only the first data byte is transmitted, followed immediately by a STOP condition.

Could you help confirm whether UC13_X supports this transmission format, or if there are any additional settings required?

  • Hi team,

    May I have your support here? Thanks.

    Regards,

    Ben

  • Hi Ben,

    This is a general feature and UC13 should support it. The configuration should be same as UC15.

    I think you just set up a wrong data length. Could you double check it?

        gTxCount = DL_I2CC_fillTXFIFO(I2C_INST, &gTxPacket[0], I2C_TX_PACKET_SIZE);
  • Hi Yuhao,

     

    Thanks for your reply.

    I modified the example to transmit 16 bytes of data. My SysConfig settings are:

            Standard Bus Speed: 100 kHz

            I2C Peripheral: UC13_0

            SDA: PB8

            SCL: PB9

    Below is my current code:

     

    #include "ti_msp_dl_config.h"

     

    /*

    * Number of bytes to send from  to target.

    *  This example uses FIFO with polling, and the maximum FIFO size is 8.

    *  Refer to interrupt examples to handle larger packets

    */

     

    #define I2C_TX_PACKET_SIZE (16)

     

    uint8_t gTxPacket[I2C_TX_PACKET_SIZE] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05,

            0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};

     

    uint8_t gTxCount = 0;

    /* I2C Target address */

    #define I2C_TARGET_ADDRESS (0x50)

    #ifdef __SLATE_INTERNAL__

    volatile bool gDUTConfigured   = false;

    volatile bool TXPacketSent     = false;

    volatile bool RXPacketReceived = false;

    #endif

     

    int main(void)

    {

            SYSCFG_DL_init();

    #ifdef __SLATE_INTERNAL__

            /* Wait until target is configured before packet is sent */

            gDUTConfigured = true;

            __BKPT(0);

    #endif

     

            /*

            * Fill FIFO with data. This example will send a MAX of 8 bytes since it

            * doesn't handle the case where FIFO is full

            */

            gTxCount = DL_I2CC_fillTXFIFO(I2C_INST, &gTxPacket[0], I2C_TX_PACKET_SIZE);

     

            /* Send the packet to the controller.

            * This function will send Start + Stop automatically.

            */

            DL_I2CC_startTransfer(I2C_INST, I2C_TARGET_ADDRESS, DL_I2CC_DIRECTION_TX,

                    I2C_TX_PACKET_SIZE);

     

     

            while (gTxCount < I2C_TX_PACKET_SIZE) {

                    while (DL_I2CC_isTXFIFOEmpty(I2C_INST) == 0 &&

                               DL_I2CC_getStatus(I2C_INST) != DL_I2CC_STATUS_ERROR) {

                    };

     

                    if (DL_I2CC_getStatus(I2C_INST) == DL_I2CC_STATUS_ERROR) {

                            __BKPT(0);

                    }

                    gTxCount += DL_I2CC_fillTXFIFO(

                            I2C_INST, gTxPacket + gTxCount, I2C_TX_PACKET_SIZE - gTxCount);

            }

     

            /* Trap if there was an error */

            if (DL_I2CC_getStatus(I2C_INST) & DL_I2CC_STATUS_ERROR) {

                    /* LED will remain high if there is an error */

                    __BKPT(0);

            }

    #ifdef __SLATE_INTERNAL__

            /* Wait here so we know packet received */

            TXPacketSent = true;

            __BKPT(0);

     

    #endif

     

            /* Wait for I2C to be Idle */

            while (!(DL_I2CC_getStatus(I2C_INST) & DL_I2CC_STATUS_IDLE))

                    ;

           

            __BKPT(0);

    }

  • Hi 

    Anything update.

    Thx

    Will

  • Hi Yuhao,

    Customer show his code. 

    However, we check the waveform by Logic analyzer, I can see that only the first byte is transmitted, and then the communication stops.

    Any comments about the issue?

    Regards,

    Ben

  • Hi Ben,

    Sorry I am OOO this week. If possible, I can test UC13_0 tomorrow and feedback then,

  • I think this has to do with Burst (I2CC-BURST) mode. Datasheet (SLASFB6) Table 8-14 mentions that UC13_0 lacks this feature.

    TRM (SLAU962) Sec 23.2.3.12 describes Burst mode, in that it allows setting MBLEN > 1 and provides RXDONE/TXDONE indicators. It doesn't seem to have much to say about non-Burst mode. It may be that you can construct a sequence of DL_I2CC_startTransferAdvanced() calls (start/.../stop) to meter the data out one byte at a time, or maybe it's just incapable of sending more than one byte per transaction.

    So it seems this example won't work properly on UC13_0. If you really need to use UC13_0, it may be worth some experimentation, but if you don't you should probably choose a different I2C unit.