AnsweredAssumed Answered

Analog voltage comparator not working on i.MXRT1062

Question asked by rohit ballurgi on Mar 20, 2019
Latest reply on Mar 26, 2019 by Kerry Zhou

I am trying to compare voltages using comparator 1 and 2 for the power inputs GPIO_AD_B1_02 (usb) & GPIO_AD_B1_03 (board) on my i.MXRT1062 hardware. It is not working. I am using continuous mode. I'm powering the device from both the power inputs. When I remove one of the power inputs, I'm expecting the interrupt to be hit, but it is not hitting.

 

CMP1

#define DEMO_CMP_BASE CMP1

#define DEMO_CMP_USER_CHANNEL 3U

#define DEMO_CMP_DAC_CHANNEL 7U

#define DEMO_CMP_IRQ_ID ACMP1_IRQn

#define DEMO_CMP_IRQ_HANDLER_FUNC ACMP1_IRQHandler

 

mCmpDacConfigStruct.referenceVoltageSource = kCMP_VrefSourceVin2; /* VCC. */

mCmpDacConfigStruct.DACValue = 32U;                                /* Half voltage of logic high level. */

 

CMP2

#define DEMO_CMP_BASE CMP2

#define DEMO_CMP_USER_CHANNEL 3U

#define DEMO_CMP_DAC_CHANNEL 7U

#define DEMO_CMP_IRQ_ID ACMP2_IRQn

#define DEMO_CMP_IRQ_HANDLER_FUNC ACMP2_IRQHandler

 

mCmpDacConfigStruct.referenceVoltageSource = kCMP_VrefSourceVin1; /* VCC. */

mCmpDacConfigStruct.DACValue = 32U;                                /* Half voltage of logic high level. */

Outcomes