xmc4800 Brown-out detection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User15581
Level 1
Level 1
I want to detection the supply voltage, and perform some action when the voltage drops.
The problem is that I can't find the handler (is that NMI_handler?) when brown-out detected.


//Enable power monitoring control register for brown-out detection.
XMC_SCU_POWER_EnableMonitor(0x01, 0x80);
//enable a trap source
XMC_SCU_TRAP_Enable(0X20);
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Yes, it is NMI handler in the default case.

Regards,
Jesus

#include "xmc_scu.h"

void NMI_Handler(void)
{
__BKPT();
}

int main(void)
{

XMC_SCU_TRAP_Enable(XMC_SCU_TRAP_BROWNOUT);
XMC_SCU_POWER_EnableMonitor(130, 1);

/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while(1U)
{

}
}
0 Likes
User15581
Level 1
Level 1
Thanks, but I didn't see the definition of void NMI_Handler(void) in the project.
Should I define it myself, or set in one of the APPs somewhere?
jferreira wrote:
Hi,

Yes, it is NMI handler in the default case.

Regards,
Jesus

#include "xmc_scu.h"

void NMI_Handler(void)
{
__BKPT();
}

int main(void)
{

XMC_SCU_TRAP_Enable(XMC_SCU_TRAP_BROWNOUT);
XMC_SCU_POWER_EnableMonitor(130, 1);

/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while(1U)
{

}
}
0 Likes

Hi,

We want to enable brownout detection as well.

Is there any guidance in terms of setting the threshold value? Our Vdd is 3.3 Volt. What should be the threshold value then? We are thinking of triggering brownout if the supply goes below 3V.  Any feedback/suggestion?

Btw, how many micro or milliseconds do we have left once we detect the brownout? Our MCU is XMC4800-144 pin. 

Thank you very much in advance, 

 

0 Likes