KEA Interrupt Input Killing ADT7420 Sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KEA Interrupt Input Killing ADT7420 Sensor

721 Views
kaslewis
Contributor III

Hello ,


I am using an ADT7420 (from Analog Devices) with an interrupt set to 35 Celsius. The issue I am having is the when the interrupt fires (whether active low or active high) the sensor stops working.  By stop working I mean the I2C communication stops and can not be reconnected without resetting the whole system. The interrupt pin is directly connected to PA0 which is configured as a KBI. I have measured the input pin on the micro I am using (KEA64 by Freescale) and it is sitting at 0.60 V. When the ADT7420 is disconnected from this pin there is no issue. I was therefore wondering why this may be occurring and how I may go about mitigating the issue.

Would a simple diode help or would putting an inverter inline to isolate the ADT7420 from the KEA64 solve the issue. Any information on why this occurs or away to prevent it from happening would be much appreciated.

Thanks

2014-12-30 03_34_00-Edit Message KEA Interrupt Input Killing ADT7420 Sensor _ Freescale Community.jpg

Interrupt firing and I2C stopping abruptly.

2014-12-30 03_34_51-Edit Message KEA Interrupt Input Killing ADT7420 Sensor _ Freescale Community.jpg

Close up of interrupt firing and I2C stopping with no stop bit


//Interrupt Handlers

void KBI0_IRQHandler()

{

    if((GPIOA_PDIR & GPIO_PDIR_PDI(0x1)))                    //Temperature interrupt

    {

        //Deal with high temperature scenario

        GPIOA_PTOR |= 0x10000;                                          //Set output low, toggle LED0

    }  

    read_Temperature();//TODO: Should disable interrupts here read in mainand then renable interrupts

    KBI0_SC |= KBI_SC_KBACK_MASK;                                       //Clear interrupt flag

}

0 Kudos
2 Replies

369 Views
vignesh_vb_7
Contributor IV

The pin PA0 is connected to I2C clock soI think it might be the problem for I2C not working after the interrupt

0 Kudos

369 Views
mjbcswitzerland
Specialist V

Hi Kas

I would suggest that there is a problem with the read_temperature() routine since the clocks of the I2C read also look strange compared to the reads taking place before the interrupt arrives (no clock stretching taking place in the 9th clock cycle).

Or is it a problem that you are polling the I2C bus and the interrupt interrupts the present I2C operation and starts a new I2C operation, which corrupts the original read? If this is the case you need to take the read_temperature() out of the interrupt and instead set a flag to tell the main polling code that it should do the read "after" it has completed the present I2C activity. Since your operarion looks to be completely based on polling (also the I2C driver) I would in fact also suggest that there is not much sense in using an interrupt but instead just check the temperature input state after the main I2C operation completes (between each loop) and handle when it sees that its level is indicating the interrupt state.

Regards

Mark

0 Kudos