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.

TMS320F28379D:

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

I2C interrupt service routine not triggered?

When I debug/run my code it ends up in a routine called   Interrupt_defaultHandler  and reports the variables: pieVect=0x0DB1  and vectID 88

My code contains these lines:

Interrupt_initModule();
Interrupt_initVectorTable();
Interrupt_register(INT_I2CA, &i2cAISR);

I2C_disableModule(I2CA_BASE);
I2C_initMaster(I2CA_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_33);
I2C_setBitCount(I2CA_BASE, I2C_BITCOUNT_8);
I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS);
I2C_setEmulationMode(I2CA_BASE, I2C_EMULATION_STOP_SCL_LOW);
I2C_enableInterrupt(I2CA_BASE, I2C_INT_STOP_CONDITION |
I2C_enableFIFO(I2CA_BASE);
I2C_clearInterruptStatus(I2CA_BASE, I2C_INT_RXFF | I2C_INT_TXFF);
I2C_enableModule(I2CA_BASE);

    if(I2C_getStopConditionStatus(I2CA_BASE))
    {
        return(ERROR_STOP_NOT_READY);
    }

    I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS);

    if(I2C_isBusBusy(I2CA_BASE))
    {
        return(ERROR_BUS_BUSY);
    }

    I2C_setDataCount(I2CA_BASE, (msg->numBytes + 2));

    I2C_putData(I2CA_BASE, msg->command);
    I2C_putData(I2CA_BASE, msg->memoryHighAddr);
    I2C_putData(I2CA_BASE, msg->memoryLowAddr);

    for (i = 0; i < msg->numBytes; i++)
    {
        I2C_putData(I2CA_BASE, msg->dataBuffer[i]);
    }

    //
    // Send start as master transmitter
    //
    I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);
    I2C_sendStartCondition(I2CA_BASE);
    I2C_sendStopCondition(I2CA_BASE);

INT_I2CA  registers vector 0x0DB0  (not 0x0DB1)  the register description is:

Name Vector ID Address Size (x16) Description Core priority ePIE group Priority
INT8.1 88 0x0000 0DB0 2 I2CA interrupt 12 1 (Highest)

How is it ending up on an odd address?  I don't think that I even register that address  "0x0DB1"

  • Hi Terry,

    I'd suggest taking a look and comparing to the 'i2c_ex6_eeprom_interrupt' software example for the F2837x device in C2000WARE. Directory location is below:

    C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\examples\cpu1\i2c

    Some additional functions / lines of code to check for interrupt enabling:

        //
        // Interrupts that are used in this example are re-mapped to ISR functions
        // found within this file.
        //
        Interrupt_register(INT_I2CA_FIFO, &i2cFIFO_isr);
    
        Interrupt_enable(INT_I2CA_FIFO);
    
        Interrupt_register(INT_I2CA, &i2c_isr);
    
        Interrupt_enable(INT_I2CA);
    
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;

    Best,

    Kevin

  • Thank Kevin:

         I ended up abandoning that approach and used code from example 4, that is working for me.