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.
I can't make my code run into I2C ISR. Whats' wrong?
#include <DSP2833x_Device.h>
#pragma INTERRUPT()
void
i2c_isr()
{
I2caRegs.I2CFFTX.bit.TXFFINTCLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP8;
}
int
main()
{
EALLOW; // enable access to protected registers
SysCtrlRegs.WDCR = BIT6 | BIT5 | BIT3; // disable watchdog
SysCtrlRegs.PCLKCR0.bit.I2CAENCLK = 1; // enable clock to I2CA module
// setup FIFO
I2caRegs.I2CFFTX.bit.I2CFFEN = 1; // enable FIFO
I2caRegs.I2CFFTX.bit.TXFFRST = 1; // enable transmitter FIFO
I2caRegs.I2CFFRX.bit.RXFFRST = 1; // enable receiver FIFO
I2caRegs.I2CMDR.bit.IRS = 1; // enable module
PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // enable PIE controller for interrupts
// set function for interrupts
PieVectTable.I2CINT1A = (PINT)&i2c_isr;
PieCtrlRegs.PIEIER8.bit.INTx1 = 1;
IER |= M_INT8;
EINT;
EDIS; // disable access to protected registers
I2caRegs.I2CFFTX.bit.TXFFIENA = 1;
while(true);
}