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.

Check if I2C Transmission was succesful as Slave in FIFO Mode without Interrupt

Hi

I want to check if a PMBus Transmission was successful.

The DSP is the Slave in FIFO Mode and I can not use Interrupts.

How is it possible to know if all data is send wihout using digital loopback mode?

A non working Code is:

if((NoBytesActualTx == NoBytes) && ( ! I2caRegs.I2CFFTX.bit.TXFFST) && ( ! I2caRegs.I2CSTR.bit.XSMT) && (I2caRegs.I2CSTR.bit.SCD)){

if (I2caRegs.I2CSTR.bit.NACK){   /*successful*/ }

else{ /*error*/ }}

It isnt working cause the XSMT Flag isnt cleared.

But what other Method can be used to check the Status of the I2CXSR Register?

Thanks

Mario

  • Hi

    Sorry forget the sentence with the Digital loopback mode.

    It makes something completely different than i first thougt.

    But i still don't want to use it :-)

    Thanks

    Mario

  • Hi Mario,

    Im not very familiar with the PMBus protocol but usually when I set the DSP in slave TX mode, I set it up to respond to the AAS(Addressed as Slave) interrupt. May I ask why you are unable to use interrupts for this application?

    Short of probing the data line or using digital loopback mode,I doubt you can see the status of I2CXSR register, except from the XSMT bit.

    Also, I found this app note for PMbus over I2C that was done on a C2000 device that might be useful(SPRABJ6) :

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=sprabj6&docCategoryId=1&familyId=919

  • hi

    There is a lot of time critical code with nested interrupts etc. and i don't want to use Interrupts, too. It would get to complicated to test all possible circumstances.

    But I found an other way:

        if (CommStatus.bit.CheckTx){                // CheckTx Flag was set in last cycle, now we can check if TX was successful
            if (! I2caRegs.I2CSTR.bit.XSMT){TX Buffer underflow -> The Master waits for more Data, that we don't have. We will make a complete Reset and the I2C Hardware will send 0xFF till the Master stops receiving}
            else{TX was successful}
        }

        if((NoBytesActualTx == NoBytes)){                      // Bytes to send = transmitted Number of Bytes
              if (! I2caRegs.I2CFFTX.bit.TXFFST){             // TxFIFO is empty
                    if (CommStatus.bit.SCD){                         // and Stop Condition detected
                        TX was successful
                    }
                    else{
                        CommStatus.bit.CheckTx    = 1;          // TX must be checked in next cycle -> set Flag
                    }
              }
        }

        if (CommStatus.bit.SCD){            // Stop Condition detected
           TX aborted by Master
        }

    Hope this works. I'm just testing it.

    Thanks

    Mario