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.

TMS320F280049C: Example code for using interrupts with PMBUS in I2C mode

Part Number: TMS320F280049C

I find the documentation for using PMBUS in I2C mode and especially with interrupts lacking.

I am aware of the pmbus_eeprom example in

libraries/communications/PMBus/c28/examples/common/source/pmbus_eeprom.c

and this has helped me to talk to a sensor we are using.

However that code uses polling in  waitUntilBusBusy and waitForAck, one of which

includes a loop to delay 100usec!

In our case they both seem to loop around 300-800 times worst case, which is not acceptable.

So I would like to convert the code to be interrupt driven.

I think I have figure out how to set the interrupt mask PMBINTM to 

capture busy condition (BUS_FREE?) but and ACK (DATA_REQUEST and DATA_READY??)

but detecting NACK evades me.

Also clearing / acknowledgment  of interrupt seems obscure. 

By experimenting I've determined that all I have to do is

PieCtrlRegs.PIEACK.all |= 1 << (8 - 1); // clear group 8

which is kind of strange as the actual peripheral (PMBUS) still has the condition that caused the

interrupt in the first place.

And yeah, I don't want any driver code, just honest close to the metal examples or description.

  • In PMBus, NACK cannot generate interrupt. In PMBus master mode, when NACK is received it will automatically generate a STOP condition.

  • Thanks. That is a good piece of information.

    But this is kind of the problem. Having to gather this sort of information bit by bit. I'm very uncomfortable releasing my code to the unsuspecting users when it is based on experimentally gathered information and tidbits harvested from forums like this.

    I don't get a warm and fuzzy feeling and it keeps wake at night to think about things like "if NACK generates STOP condition and I did not find that from the datasheet, what else is there that could stop my code from functioning under certain conditions that we have not managed to cover in our tests".

    So some example code written by someone who truly understands how the PMBus engine works would be highly appreciated.

    Or full discussion of the various flags and interrupt behaviour.

  • Kustaa,

    We don't have any plans to release interrupt based PMBus (I2C mode). I can bring this up with management. But even if it is approved, it won't be available by 3Q / 4Q.

    What happens on NACK condition is described in TRM.

    Regards,

    Manoj