Hello Guys,
I was able to accomplish the I2C Interrupts ; When I created a separate project for I2C Interrupts I was able to read all the data on req addresses but later when I integrated the I2C Interrupt Routine with my current development application , I was able to read only the first ten address locations , the code remains the same. Where should be the problem ???
> Thanks for all your Support .
> Looking forward, > Samjith
The code is pasted below.I use LPC2368 as Master and CY8C20434(TouchKey Sensor IC) as my slave.The code works well if I create a separate project for I2C interrupt purpose . When I start integrating with my current project development I am able to read only some of the data locations in I2C .Why is that???
__irq void I2C_IRQHandler(void) /* I2C INTERRUPT HANDLER */ { switch(I21STAT) { case 0x08: /* ISSUE START CONDITION */ I21DAT = 0x22; /* SLA + W (0x22 | 0x00) */ I21CONCLR = 0x20; /* CLEAR START CONDITION */ break; case 0x10: /* REPEATED START CONDITION */ I21DAT = 0x23; /* SLA + R (0x22 | 0x01) */ I21CONCLR = 0x20; /* CLEAR START CONDITION */ break; case 0x18: /* SLA + W (FOR WRITING STARTING ADDRESS OF SLAVE DATA */ I21DAT = 0x00; /* CAPSENSE STARTING ADDRESS */ I21CONSET = 0x04; /* SET ACKNOWLEDGEMENT BIT */ break; case 0x28: /* CAPSENSE STARTING ADDRESS TRANSMITTED , ACK RECEIVED */ I21CONSET = 0x20; /* ISSUSE START CONDITION */ I21CONCLR = 0x04; break; case 0x38: I21CONSET = 0x20; /* START CONDITION ISSUED IF ARBITRATION LOST WITH ACK */ break; case 0x40: /* SLA + R TRANSMITTED ACK RECEIVED */ I21CONSET = 0x04; /* SET ACKNOWLEDGEMENT BIT */ break; case 0x48: /* SLA + R TRANSMITTED NACK RECEIVED */ I21CONSET = 0x20; /* SET STOP BIT */ break; case 0x50: /* DATA BYTE RECEIVED WITH ACK */ MasterBuff[Read_Index] = I21DAT; if(Read_Index != Read_Length) { I21CONSET = 0x04; Read_Index++; Capsense_Driver(); } else { Read_Index = 0; I21CONCLR = 0x04; } break; case 0x58: I21CONSET = 0x20; break; default : break; } I21CONCLR = 0x08; /* Clear I2C Interrupt Flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ }
Looking forward, Samjith