LPC 18xx Brown Out Help

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

LPC 18xx Brown Out Help

591 Views
jakeweiner
Contributor I

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

Labels (2)
0 Kudos
1 Reply

293 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Jake,

Could you share your project?

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos