How to enable brownout detection

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

How to enable brownout detection

Jump to solution
1,734 Views
felek
Contributor II

Hello!

I've encountered an issue with the power supply on my custom board. If the voltage drops to ~2.8V the RT1051 freezes and there is no way to reset the processor. I use a 18650 battery to power supply the board. Even if the USB cable will be connected (the voltage rises) the processor is not able to start working. The POR signal doesn't reset the MCU. The oscilloscope shows that DCDC_LP1 and 2 are 0V. So VDD_SOC is also 0V.

I tried to implement PMU Brownout detection but it doesn't work. There is not a lot of information in the Reference Manual about brownout detection. I also couldn't find any examples in SDK.

I want to use brownout detection because I have one GPIO connected to enable pin in the DCDC converter. So I can shutdown the MCU before it freezes.

According to fsl_pmu.h I tried to implement brownout:

PMU_1P1EnableBrownout(PMU, true);
PMU_1P1SetBrownoutOffsetVoltage(PMU, 0x5); // 5*25mV
PMU_2P5nableBrownout(PMU, true);
PMU_1P1SetBrownoutOffsetVoltage(PMU, 0x5); // 5*25mV

NVIC_EnableIRQ(PMU_EVENT_IRQn);

And interrupt

void ANATOP_EVENT0_IRQHandler(void) 
{
  const uint32_t status = PMU_GetStatusFlags(PMU);

  if (status & kPMU_1P1BrownoutOnOutput)
  {
    // ...
  }

  if (status & kPMU_2P5BrownoutOnOutput)
  {
    // ...
  }

  NVIC_ClearPendingIRQ(PMU_EVENT_IRQn);
}

The RT1051 doesn't generate an interrupt before freezes. Do I need to enable 1.1V and 2.5V LDO or it doesn't matter?

Do you have any ideas?

 

Best 

Dawid

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,637 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

To enable BO please refer to this:

	//Enable brownout circuitry in the LDO
	PMU_2P5nableBrownout(PMU, true);

	//Set LDO output voltage to 2.875V
	PMU_2P5SetRegulatorOutputVoltage(PMU, 0x1F);

	//Set LDO brownout offset voltage to 0.075V
	PMU_2P5SetBrownoutOffsetVoltage(PMU, 0x3);

	//Enable LDO output
	PMU_2P5EnableOutput(PMU, true);

It is important to note that Brownout target = OUTPUT_TRG - BO_OFFSET, in the example we will set BO_OFFSET as 0x3 (in 25 mV steps will be 0.075V). Target voltage calculation is as below:

OUTPUT_TRG = 0x1F (2.875V)
BO_OFFSET =  0x3 (0.075V)
Brownout target = 2.875V – 0.075V = 2.8V
This means that if the LDO 2P5 voltage output goes below 2.8V the brownout flag should be set.

Another suggestion I have is to keep the IRQ as simple as possible, and only use it to clear/set flags.

Best regards,
Omar

View solution in original post

4 Replies
258 Views
wavhal_m
Contributor II

Hello @felek ,

How do you confirm that it is working on actual hardware? Can you assist me regarding this?

Regards,

Mukund

0 Kudos
252 Views
felek
Contributor II

Hi @wavhal_m 

I used a regulated DC power supply to supply the hardware. 

In my case, I set the voltage to 3.5V-3.7V (normally the device uses the 18650 battery) and while the device was starting up I changed the voltage to 2.8V-3.0V and sometimes the uC was frozen. It consumed the power but couldn't restart (the restart signal didn't work).

I added the brownout interrupt where the uC was toggling the enable signal from the main power regulator. In this case, the uC doesn't freeze but restart due to lack of power. 

1,638 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

To enable BO please refer to this:

	//Enable brownout circuitry in the LDO
	PMU_2P5nableBrownout(PMU, true);

	//Set LDO output voltage to 2.875V
	PMU_2P5SetRegulatorOutputVoltage(PMU, 0x1F);

	//Set LDO brownout offset voltage to 0.075V
	PMU_2P5SetBrownoutOffsetVoltage(PMU, 0x3);

	//Enable LDO output
	PMU_2P5EnableOutput(PMU, true);

It is important to note that Brownout target = OUTPUT_TRG - BO_OFFSET, in the example we will set BO_OFFSET as 0x3 (in 25 mV steps will be 0.075V). Target voltage calculation is as below:

OUTPUT_TRG = 0x1F (2.875V)
BO_OFFSET =  0x3 (0.075V)
Brownout target = 2.875V – 0.075V = 2.8V
This means that if the LDO 2P5 voltage output goes below 2.8V the brownout flag should be set.

Another suggestion I have is to keep the IRQ as simple as possible, and only use it to clear/set flags.

Best regards,
Omar

1,628 Views
felek
Contributor II

Hello Omar,

thanks for your response. It works.

Best regards

Dawid

0 Kudos