hi, i'm trying to make the comparator works, following the soc userguide, my code is the following:
void comphandler(void) { GPIOPinIntClear(GPIO_A_BASE,GPIO_PIN_5); GPIOPinWrite(GPIO_B_BASE,GPIO_PIN_5,0xff); } int main(void) { SysCtrlClockSet(false, false, SYS_CTRL_SYSDIV_32MHZ); SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ); HWREG(0x400D9710) |= 0x20; // set PAIEN5 HWREG(0x400D9704) |= 0x0; //PAIRC5=0 : rising edge interrupt HWREG(0x400D7024) |= 0x02; //enable comparator HWREG(IOC_PA5_OVER) |= 0x01; //set PA5 analog HWREG(IOC_PA4_OVER) |= 0x01; //set PA4 analog IntMasterEnable(); IntEnable(INT_GPIOA); GPIOPinWrite(GPIO_B_BASE,GPIO_PIN_5,0); while(1) { } }
it's a one shot function,just to see if the interrupt works.
but i have no response, i use pa4 as reference pin and have a trimmer on pa5.
thanks!