This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C-issue on Processes

Hi everyone

I am working in process. In that the i2c interrupt clashes with timer interrupt, and both are not functioning properly. But both of them works good separately. how to handle this nested interrupt in lpc2148. Also i2C module takes around 110.86 micro seconds to generate a proper interrupt. my controller works at 60 mhz and the i2c bus speed is 100 khz. any ideas regarding this would be helpful to me.

Thanks in advance

Regards
Sundar

Parents
  • HI Westermark

    Thanks for your response, after sending the start bit , i am waiting till the Serial interrupt flag is set, after that i continue my work , i tried not to wait there, but the I2C transaction didn't happen. the logic analyzer showed some junk data send to the slave device.

    void FUN_IRQ_I2C_1(void)__irq // irq function
    {
     Flag_I2C_0 = 0xFF;                     //update status flag
      Status_I2C_1 = I2C_Status_Register_1;                         //Read Status byte
      I2C1CONCLR=0x28;
      Vectored_Interrupt_Address = 0x00;
    }
    

    unsigned char(unsigned char Status_Code) // status code verification
    {
     while( Flag_I2C==0);
     Flag_I2C=0;
     if(Status_I2C_1!=Status_Code)
     {
      return 1;
     }
     else
     {
      return 0;
     }
    }
    

    Regards
    Sundar

Reply
  • HI Westermark

    Thanks for your response, after sending the start bit , i am waiting till the Serial interrupt flag is set, after that i continue my work , i tried not to wait there, but the I2C transaction didn't happen. the logic analyzer showed some junk data send to the slave device.

    void FUN_IRQ_I2C_1(void)__irq // irq function
    {
     Flag_I2C_0 = 0xFF;                     //update status flag
      Status_I2C_1 = I2C_Status_Register_1;                         //Read Status byte
      I2C1CONCLR=0x28;
      Vectored_Interrupt_Address = 0x00;
    }
    

    unsigned char(unsigned char Status_Code) // status code verification
    {
     while( Flag_I2C==0);
     Flag_I2C=0;
     if(Status_I2C_1!=Status_Code)
     {
      return 1;
     }
     else
     {
      return 0;
     }
    }
    

    Regards
    Sundar

Children