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.

MCT8329A: Is there a difference between 8329 and 8316 checksum?

Part Number: MCT8329A
Other Parts Discussed in Thread: MCT8316A,

It works well until you register, send and check the register. We also modified it to chip id 0x60. However, an error appears in the checksum syntax. It seems that the programming is optimized for other chips. Can you check if the data delivery statement or the EEPROM access register is correct?

  • Hi Yongma, 

    Thanks for posting to e2e forum - our team is currently OOO due to US holiday but will respond back to your question next week when they're back in office

    Best Regards, 
    Andrew 

  • I hope you have a good time. I am writing to supplement the questions additionally.

    https://e2e.ti.com/support/motor-drivers-group/motor-drivers/f/motor-drivers-forum/1246892/faq-program-mcx-bldc-motor-driver-through-i2c-using-msp430-launchpad?tisearch=e2e-sitesearch&keymatch=program%20mcx

    1. I would like to ask you to confirm that the 0xE6 register in the I2C_write syntax is correct.

    if (!I2C_write(0xE6, 0x8A500000, I2C_TIMEOUT))
    prog_error = true;
    
    __delay_cycles(2000000); // delay at least 100ms for copy operation from Shadow-register to EEPROM to complete
    __no_operation(); // For setting breakpoint while debugging
    
    /* Set the EEPROM_READ bit in the DEV_CTRL register (0xEA located in RAM
    * This copies the content of the EEPROM memory back into the shadow registers
    */
    if (!I2C_write(0xE6, 0x40000000, I2C_TIMEOUT))
    prog_error = true;
    
    __delay_cycles(2000000); // delay at least 100ms for copy operation from EEPROM to Shadow-register to complete
    __no_operation(); // For setting breakpoint while debugging

    2. I've checked that the data is written and read. However, there is an error in the checksum part. Can you help me correct this part?

    for (i = 0; i < eeprom_array_size; i++)
    {
    if(!I2C_read(eeprom_regmap[i][0], &(post_eeprom_write_regs[i]), I2C_TIMEOUT))
    {
    prog_error = true;
    break;
    }
    
    if (post_eeprom_write_regs[i] != eeprom_regmap[i][1])
    {
    prog_error = true;
    //GPIO_setOutputHighOnPin(GPIO_PORT_P6, GPIO_PIN6);
    //GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
    break;
    }

  • Hi Yongma,

    1. I would like to ask you to confirm that the 0xE6 register in the I2C_write syntax is correct.

    The syntax in the code provided looks correct.

    2. I've checked that the data is written and read. However, there is an error in the checksum part. Can you help me correct this part?

    Before line 9 in the provided code, can you check the content of the arrays, by printing both the arrays out or through another method, and check where the difference in the arrays is?

    Regards,

    Joshua

  • 1. I can't check it. Can you tell me how to check it through uart or other methods?


    2. Looking at the data sheet, it seems that MCT8316A and MCT8329A and Write Operation Packet are different. How should I change this part?

    bool I2C_write(unsigned long addr, unsigned long writedata, uint32_t timeout) {
    
        EUSCI_B_I2C_initMasterParam param = {0};
    
        param.selectClockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK;
    
        param.i2cClk = CS_getSMCLK();
    
        param.dataRate = EUSCI_B_I2C_SET_DATA_RATE_400KBPS;
    
        param.byteCounterThreshold = 0;
    
        param.autoSTOPGeneration = UCASTP_0;
    
        EUSCI_B_I2C_initMaster(EUSCI_B1_BASE, &param);
    
    
    
        //Enable I2C Module to start operations
    
        EUSCI_B_I2C_enable(EUSCI_B1_BASE);
    
    
    
        // Construct the 24 bit control word (refer to datasheet section 7.6.2.1)
    
        char control_word[3] = {0x10, (addr&0x00000F00)>>8, addr&0x000000FF};
    
    
    
        /* Set slave Address */
    
        EUSCI_B_I2C_setSlaveAddress(EUSCI_B1_BASE,
    
                                    I2C_TARGET_ADDR
    
                                    );
    
    
    
        /* Set master to transmit mode */
    
        EUSCI_B_I2C_setMode(EUSCI_B1_BASE,
    
            EUSCI_B_I2C_TRANSMIT_MODE);
    
    
    
        EUSCI_B_I2C_masterSendStart(EUSCI_B1_BASE);
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send bits CW23-CW16 of the control word */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, control_word[0], timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send bits CW15-CW8 of the control word */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, control_word[1], timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send bits CW7-CW0 of the control word */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, control_word[2], timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send D7-D0 of the 32-bit data */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, writedata & 0x000000FF, timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send D15-D8 of the 32-bit data */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, (writedata & 0x0000FF00)>>8, timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send D23-D16 of the 32-bit data */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, (writedata & 0x00FF0000)>>16, timeout))
    
            return 0;
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        /* Send D31-D23 of the 32-bit data */
    
        if (!EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(EUSCI_B1_BASE, (writedata & 0xFF000000)>>24, timeout))
    
            return 0;0000000
    
    
    
        __delay_cycles(INTER_BYTE_DELAY);
    
    
    
        EUSCI_B_I2C_masterSendMultiByteStop(EUSCI_B1_BASE);
    
    
    
        return 1;
    
    }

  • Hi Yongma,

    I will look for a solution to check the contents of the array and the changes that need to be made to the code you sent. I will get back to you by Friday.

    Regards,

    Joshua

  • I solved it, the code didn't have a problem, thank you for answering.

    First of all, I would like you to change the target ID so that it remains at 0x60.
    The first time you write it, the target ID is 0x60, and the second time, it is 0x00. (Data sheet 7.6.1.1, Table 7-7)

    I will leave an article for those who will be new to me.
    1. Change the Target ID (0x60 or 0x00, main.c-51line)
    2. Change the shadow register value (0xE6, main.c - 153, 162 line)
    3. Only 24 items that are written on the data sheet are put in the register map. (There are 39 GUIs for 8329A.)