TPS2HCS10-Q1: CRC Implementation Details

Part Number: TPS2HCS10-Q1
Other Parts Discussed in Thread: HSS-2HCS10EVM

Tool/software:

Hi Team,

i have questions related to implementation of CRC on TPS2HCS

1) For CRC Enable Data Transmission is 24 -Bit, Correct?

2) after the CRC is enable. Does Frame is 28-Bit or 32-Bit? 

          Frame Format is  CRC ADDRESS DATA Correct?  It would be nice to add CRC Enabled SPI Frame Format to Data Sheet.

3)Was using the CRC calculation provided in the https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1412989/faq-tps2hcs10-q1-crc-calculation-function-example?tisearch=e2e-sitesearch&keymatch=CRC-4#

Do you have reference sheet to compare with it? was not getting anything from the Device after the CRC enabled.

  • Krishna,

    So this will be updated in the latest version of the datasheet that will be available for RTM, but after CRC is enabled it will be 32-bit. Find the diagram below:

    We don't have a reference sheet just yet, but can generate one if needed (it will take a few days).

    Best Regards,
    Tim 

  • Hello Tim,

    Thank you so much for the quick reply, Right Now I am using the HSS-2HCS10EVM, Does this support the CRC?

    would be nice to have the reference sheet,  For now what is the expected CRC if i have to read/write the following registers

    Command Format is

    To Read the Global Fault  0x040000  -> 

    To read PWM CH1    0x0E0000 ->

    To Write ILIM_CONFIG_CH1  -> 0x8F1638  ->

    To Write DIAG_CONFIG_CH1 -> 0x904002 ->

    With the updated information, Was using the CRC calculation provided in the https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1412989/faq-tps2hcs10-q1-crc-calculation-function-example?tisearch=e2e-sitesearch&keymatch=CRC-4#

    was not getting the device communicated properly 

    Thanks

    Krishna

  • Krishna,

    We are planning on updating to have the CRC implemented in the GUI by the end of the year. I will take a look at your requested format, test them out on the EVM (the EVM has a JTAG port where I can sandbox code), and get a response to you by the end of the week with the exact write sequence.

    Best Regards,
    Tim 

  • plemented in the GUI by the end of the year. I will take a look at y

    Timothy,

    Would you please let me know Any update on the requested?

    Thanks,

    Krishna

  • Krishna,

    I am working on this currently. Could you let me know what you want in the GUI, specifically? Right now I added a CRC button that, when enabled, will cause all writes to the high-side switch to have the extra CRC frame. It will also give you the CRC result when reading the the "Console" view. Would this be enough?

    For what it's worth, I updated the function slightly from what Patrick implemented:

    static uint8_t crcGetResult(uint8_t* dataBuffer, uint8_t len)
    {
        uint8_t crc_start = 0x0F;
        uint8_t crc_polynomial = 0x03;
        uint8_t crc_result = crc_start;
        uint8_t bitnum = 0;
        uint8_t bytenum = 0; 
    
        for(bytenum = 0; bytenum < len; bytenum++)
        {
            for(bitnum = 0; bitnum < 8; bitnum++)
            {
                if((((dataBuffer[bytenum] >> (7-bitnum)) & 0x01) ^ 
                       ((crc_result & 0x08) >> 3)) > 0)
                {
                    crc_result = crc_polynomial ^ ((crc_result << 1) & 0x0F);
                }
                else
                {
                    crc_result = (crc_result << 1) & 0x0F;
                }
            }
        }
    
        for(bitnum = 0; bitnum < 4; bitnum++)
        {
            if(((crc_result & 0x08) >> 3) > 0)
            {
                crc_result = crc_polynomial ^ ((crc_result << 1) & 0x0F);
            }
            else
            {
                crc_result = (crc_result << 1) & 0x0F;
            }
        }
      
        return (crc_result);
    }
    

    This is just plain C code and should be able to be compiled under any host (GCC, Windows, etc.). 

    Best Regards,
    Tim 

  • Hi Tim,

    Thanks For the response, Was able to communicate with the Chip, with CRC option is enabled, Trick is here, Micro we use is Little Endian Format, i have to swap the bytes

    Was looking for the reference sheet to match the CRC calculation done in the software is same as the reference sheet.

    Thanks,

    Krishna