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.

C2000 I2C Read Interrupt



I have gotten I2C Read to work by polling but now I'm trying to replace that and generate a read interrupt.

I have configured the I2C registers as follows:

EALLOW;
SysCtrlRegs.PCLKCR0.bit.I2CAENCLK = 0x0001;
EDIS;

EALLOW;
GpioCtrlRegs.GPBPUD.bit.GPIO32 = 0x0000;
GpioCtrlRegs.GPBPUD.bit.GPIO33 = 0x0000;
GpioCtrlRegs.GPBQSEL1.bit.GPIO32 = 0x0003;
GpioCtrlRegs.GPBQSEL1.bit.GPIO33 = 0x0003;
GpioCtrlRegs.GPBMUX1.bit.GPIO32 = 0x0001;
GpioCtrlRegs.GPBMUX1.bit.GPIO33 = 0x0001;

EDIS;
// Initialize I2C Module
// Note : The prescaler must be initialized only while the I2C module is in the reset state (IRS = 0 in I2CMDR).
// The prescaled frequency takes effect only when IRS is changed to 1.
// Changing the IPSC value while IRS = 1 has no effect.

I2caRegs.I2CPSC.all = 9; // Prescaler - need 7-12 Mhz on module clk //6
I2caRegs.I2CCLKL = 45; // NOTE: must be non zero //5
I2caRegs.I2CCLKH = 45; // NOTE: must be non zero //5

 I2caRegs.I2CIER.bit.RRDY = 1; // Enable RRDY interrupts
I2caRegs.I2CFFTX.all = 0x0000; // Disable FIFO mode and TXFIFO

I2caRegs.I2CFFRX.all = 0x0000; // Disable RXFIFO, clear RXFFINT,

I2caRegs.I2CMDR.all = 0x0020; // 1: Take I2C out of reset
                                                           // 0: Stop I2C when suspended

I have created the following code to read from I2C buffer as follows:

unsigned char i = 0;

I2caRegs.I2CSAR = 0x0004;
I2caRegs.I2CCNT = 2;
I2caRegs.I2CMDR.all = 0x2C20;

for(i=0;i<2;i++)

{

 data[i] = I2caRegs.I2CDRR;

I2caRegs.I2CSTR.bit.RRDY = 1;

}

It doesn't seem to be call the interrupt. What am I doing wrong?