Hi all,
I'm quite new to brownouts and at work I am required to implement a feature to detect if our LPC1837 device falls below a certain threshold on startup. I was just wondering if this would be the correct way to implement such a feature
// Set BOD Threshhold //
if (detect>=0 && detect<=3){
LPC_CREG->CREG0 &= ~(3<<8);
LPC_CREG->CREG0 |= detect<<8;
}
Chip_EVRT_Init();
Chip_EVRT_ConfigIntSrcActiveType(EVRT_SRC_BOD1,EVRT_SRC_ACTIVE_FALLING_EDGE); // now im not sure exactly which option to select here, I figured i want to detect the falling edge?
Chip_EVRT_SetUpIntSrc(EVRT_SRC_BOD1,ENABLE);
NVIC_EnableIRQ(EVENTROUTER_IRQn);
Now the problem that I am having is that despite clearing the event status with
LPC_EVRT->CLR_STAT &= (0x01UL<<EVRT_SRC_BOD1);;
I am stuck in my event handler routine. Just wondering if this would be a problem with my chip (I cant measure the internal voltages) or, more likely, something wrong with my code.
Any help would be greatly appreciated.
Thanks in advance,
Jake
Hi Jake,
Could you share your project?
Thanks in advance!
Best Regards,
Carlos Mendoza
Technical Support Engineer