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.

TMS320F28027F: I2C interrupts occur only once

Part Number: TMS320F28027F

Hi,

I'm having a lot of trouble getting the interrupts on the I2C module of the TMS320 to work. I've spent weeks on this, so any help you can give me would be appreciated.

I'm using a launchpad board as the slave receiver and a TMS570HDK as the master. The master sends out a 9 byte long message, but I can't get the slave to receive the whole message. I've tried various ways and there seems to be a common problem. Initially I tried using the AAS flag and then polled the RRDY flag to capture the payload. This works, but only once. The AAS flag remains set despite a STOP condition being received (and the flag set).

I then tried a different tack. I set the RRDY to generate the interrupt. This receives the first byte and nothing else. The RRDY flag in STR is cleared by writing a 1 to it, but it still only interrupts once. I did a ready of I2CISRC to see if that is being cleared and it is.

So to summarise:

AAS flag cannot be cleared and the interrupt is generated only once.

RRDY flag can be cleared but still only interrupts once

SCD never generates an interrupt, even though the flag is being set and the enable register configured to generate an interrupt.

Is there another register that needs to be accessed to reinitialise the interrupts?

  • Hi Andy,

    Sorry for the delay in response on your other post.

    Are you using FIFO mode in your program? The RRDY register bit is not meant to be used when in FIFO mode.

    Can you share your code with me so I can review it? If you don't feel comfortable sharing on the forum you can send it to me directly by accepting my connect request on E2E and private messaging it to me.

    Andy Worsley89 said:
    AAS flag cannot be cleared and the interrupt is generated only once.

    AAS should get cleared after a STOP condition as documented.

    Andy Worsley89 said:
    RRDY flag can be cleared but still only interrupts once

    This should be cleared after reading from the I2CDRR. It will be set again if a new byte is copied into I2CDRR.

    Andy Worsley89 said:
    SCD never generates an interrupt, even though the flag is being set and the enable register configured to generate an interrupt.

    This could be related to I2C interrupt priority and the need to read from the I2CISRC.INTCODE register bits. See documentation below:

    Best,

    Kevin