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.

BOOSTXL-POSMGR: T-format encoder functions and communication protocol

Part Number: BOOSTXL-POSMGR

Hi experts,

When I was doing the experiment about the encoder, I couldn't understand the meaning of some TI codes,mainly including PM_tformat_receiveData () function and PM_tformat_setupCommand()function :

The main questions are as follows:

1.How to calculate the bitIndex and wordNo values?

.

uint16_t PM_tformat_receiveData(uint16_t tformatDataID)
{
    uint32_t len, bitIndex, wordNo;
    uint16_t word1;

    word1  = 1;

    switch(tformatDataID)
    {
      case (PM_TFORMAT_DATAID2):
            len = 8;

            bitIndex = 13;
            wordNo = 1;
            tformatData.controlField = tformat_getBits (len, wordNo, bitIndex);

            wordNo = wordNo + (10 + (16 - bitIndex) ) / 16;
            bitIndex = 16 - ((10 + (16 - bitIndex)) % 16) ;
            tformatData.statusField = tformat_getBits (len, wordNo, bitIndex);

            wordNo = wordNo + (10 + (16 - bitIndex) ) / 16;
            bitIndex = 16 - ((10 + (16 - bitIndex)) % 16) ;
            tformatData.dataField0 = tformat_getBits (len, wordNo, bitIndex);

            wordNo = wordNo + (10 + (16 - bitIndex) ) / 16;
            bitIndex = 16 - ((10 + (16 - bitIndex)) % 16) ;
            tformatData.crc = tformat_getBits (len, wordNo, bitIndex);
            
} 

2.What does 0X903F mean here?How is it calculated?

Best regards

Johnson Alanl

  • Hello - I'm looking into this and will respond by end of Friday. 

    Regards

    Lori

  • Johnson,

    #1)

    The values come from the frame format for the t-format protocol.  This is described in documentation that can be obtained from Tamagawa.

    As an example, a general response from the encoder consists of:

    • Control Frame - 10 bits including start (0) /delimiter (1)
    • Status Field - 10 bits including start (0) /delimiter (1)
    • Data Field - depends on the command/response
    • CRC - 10 bits including start (0) /delimiter (1)

    The values are defined to extract the right field / bits from a given response. 

    #2)

    The | 0x903F operation is being used to set specific bits to 1 as required by the specification.