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 Master Controller Multiple Data (more the 8 bytes) Transfer Polling Example

Part Number: MSPM0G3507

Hi, I am quite new to TI's MSPM0G3 series MCU and abit confused about transmitting mutliple bytes (more the max number of 8 TXFIFO) data in I2C Master Controller mode with polling method. Is there any example that I can refer to for this case?

  • Hi, 

    1. i2c_controller_rw_multibyte_fifo_interrupts

        This code example handle 16 bytes and 8 TXFIFOs very well.

        You can have a look.

    2. i2c_controller_rw_multibyte_fifo_poll

        Base on this example, add some code to be compatible with multi-byte(> 8) sending function.

        Just add some code after SYSCFG_DL_init(); of i2c_controller_rw_multibyte_fifo_poll.c

        I didn't test this code, bug logic should be correct.

       

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    SYSCFG_DL_init();
    /* Set LED to indicate start of transfer */
    DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
    gTxLen = I2C_TX_PACKET_SIZE;
    /*
    * Fill the FIFO
    * The FIFO is 8-bytes deep, and this function will return number
    * of bytes written to FIFO */
    gTxCount = DL_I2C_fillControllerTXFIFO(I2C_INST, &gTxPacket[0], gTxLen);
    /* Wait for I2C to be Idle */
    while (!(
    DL_I2C_getControllerStatus(I2C_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
    ;
    /* Send the packet to the controller.
    * This function will send Start + Stop automatically.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Helic

  • Thanks so much Helic..