BOD with RTC battery on LPC55xx

cancel
Showing results for 
Search instead for 
Did you mean: 

BOD with RTC battery on LPC55xx

498 Views
janpieterderuit
Contributor IV

Hi,

we have an RTC application with an LPC55S16, where we have a backup battery connected as discussed here:
https://community.nxp.com/t5/LPC-Microcontrollers/Recommended-circuit-for-RTC-Battery-backup/m-p/998...
So VBAT_PMU is powered by normal power-supply and backup battery, both through a diode.

We also want to use the BOD functionality (RESET by BOD).
We initially configured the VBAT BOD (using POWER_SetBodVbatLevel).
But looking at the power domains schematic in the linked post, and also table 313 inthe user manual, VBAT BOD is in the AO power domain, powered by VBAT_PMU, and thus the RTC backup battery.
So this will never trigger the BOD (on our specified power level).
Or am I wrong?

The other option is the CORE BOD.
But this is on a completely different voltage level, so no (easy) relation with VCC.
I suppose we just keep the defaults, but I have some questions:

  1. What is the default voltage level and hysteresis for core (it's not specified in the user manual)
    Or is there no default, and should we explicitly set one.
    Any good default level you can recommend?
  2. The SDK has kPDRUNCFG_PD_BODCORE (at bit 2 of the PDRUNCFG0 register), but table 332 in the usermanual says bit 2 is Reserved...
    Can you tell me whether this BOD is enabled by default, and whether we can use this flag or shouldn't we?

Thanks in advance.

Labels (1)
Tags (3)
0 Kudos
15 Replies

363 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

At least, for the RTC power supply, I attach the power domain for LPC55xx, pls refer to it.

BR

XiangJun Rong

0 Kudos

359 Views
janpieterderuit
Contributor IV

Hi, thanks, very informative.

On page 5 "BOD VBAT" is only connected to VBAT_PMU, while "BOD CORE" is connected to both VBAT_PMU and VDD_PMU.
To me this looks like:

  • BOD CORE is powered by VBAT_PMU, and monitors VDD_PMU
  • BOD VBAT is powered by VBAT_PMU and monitors VBAT_PMU

Which confirms my conclusions

On page 9 "BOD VBAT" is connected to VBAT, while "BOD CORE" is connected to VDD_PMU.
This might suggest that "BOD VBAT" monitors VBAT_DCDC, but as "LDO AO" is also connected to VBAT here, I think VBAT stands for VBAT_PMU here as well.

BR, Jan Pieter

0 Kudos

354 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is my opinion:

  • BOD CORE is powered by VBAT_PMU, and monitors VDD_PMU
  • BOD VBAT is powered by VBAT_PMU and monitors VBAT_DCDC

Pls check if it match with what you have observed with test.

BR

XiangJun Rong

 

0 Kudos

349 Views
janpieterderuit
Contributor IV

No, that does not match my test results.
If that would have been the case, the BOD would not have triggered at 0.4V higher than the selected threshold (e.g. 3.0V instead of 2.6V).

You base your opinion only on section 13.4.2 from UM11295.pdf, right?
Or do you have additional information supporting your opinion?

Thanks in advance.

0 Kudos

344 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Yes, you are right, I based my opinion only on section 13.4.2 from UM11295.pdf.

What you observed is:

  • BOD CORE is powered by VBAT_PMU, and monitors VDD_PMU
  • BOD VBAT is powered by VBAT_PMU and monitors VBAT_PMU

I will check with AE team to know if the section 13.4.2 from UM11295.pdf is correct or not.

BR

XiangJun Rong

0 Kudos

480 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jan,

As you have seen that the BOD(Brown Out Detection module) is powered bt VBAT_PMU pin, but it detects/monitors the voltage of VBAT_DCDC pin rather than VBAT_PMU pin, because the VBAT_DCDC pin provides power for the core and most peripherals via internal DC/DC converter pin VDD_PMU.

In conclusion, the BOD can NOT monitor VBAT_PMU pin voltage. If you just want to power the RTC via battery, while the VBAT_DCDC pin is power off, in the case, the BOD is useless, furthermore the core is not powered, so there is not response for any interrupt or reset event.

Regarding the default BOD voltage, pls refer to the following fig in UM11126.pdf.

xiangjun_rong_0-1638156200182.png

For the default hysteresis,

xiangjun_rong_1-1638156294261.png

Regarding the PDEN_BODVBAT, I think it is bit3 in PDRUNCFG0

xiangjun_rong_2-1638156766199.png

Hope it can help you

BR

XiangJun Rong

 

 

0 Kudos

392 Views
janpieterderuit
Contributor IV

Hi XiangJun Rong,

I have been measuring the BOD behavior on our board, and what I see is not what you are saying.
This is (part of) our schematics for the power supply of the LPC55S16 (where VCC = default 3.3V):

janpieterderuit_1-1638915920409.png

(based on https://community.nxp.com/t5/LPC-Microcontrollers/Recommended-circuit-for-RTC-Battery-backup/m-p/998...)

Now when I set the VBAT BOD Threshold to 2.6V (with Reset), the device actually already resets when VCC is 3.0V.
When I set the threshold even lower, the device only resets when VCC gets below 1.6V.

So I tried what happens when I disconnect the battery (so VBAT_PMU is only powered by VCC).
The device now also resets @3.0V when threshold is 2.6V.
But now when I set the threshold to 2.2V, the device resets @2.6V.

So I started measuring the VBAT_PMU voltage level (as it will be 0.4V lower due to the diode), and there I indeed see the voltages associated with the threshold.

Then I shorted the diode (connecting VCC directly with VBAT_PMU).
And then I see resets at expected VCC levels.

So my conclusions:

  • VBAT BOD monitors the VBAT_PMU, not VBAT_DCDC as you stated
  • In the original circuit (with battery) the battery keeps the VBAT_PMU voltage level at at least 2.6V, so it will never reset due to VBAT BOD (the reset at 1.6V is probably due to a Core BOD reset)

Can you confirm this?
If this is indeed the case, the VBAT BOD cannot be used in combination with an RTC battery setup, right?
So then we should use the Core BOD, but as mentioned before, it's not accessable from the SDK...

Thanks in advance.

BR, Jan Pieter de Ruiter
Airios

0 Kudos

379 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I copy the section 13.4.2 from UM11295.pdf, it clearly says that the VBAT BOD module is powered by VBAT_PMU, but it detects the VBAT_DCDC voltage.

Can you use two power supplies to have a test? for you example, you can connect one power supply to VBAT_PMU, another voltage variable power supply to VBAT_DCDC.

BR

XiangJun Rong

xiangjun_rong_0-1638930703042.png

 

0 Kudos

370 Views
janpieterderuit
Contributor IV

Hi XiangJun Rong,

thanks again for your quick reply.

Yes, I saw that the Usermanual also says BOD monitors VBAT_DCDC.
But my measurements clearly shows that is not true.
Or am I doing something wrong?

As a matter of fact I did the testing with 2 variable power supplies, as the battery on the board was already empty.
Our HW guys are looking into it, but it seems VBAT_PMU draws a (relatively) lot of current...

All together it seems like a (battery backed) RTC solution is not possible with the LPC55xx, so we'll have to look at an external RTC module (quickly, as we are running out of time).
So please let us know as quick as possible whether a battery backed RTC is still possible with the LPC55xx.

BTW: about the picture you showed a while ago (about the PMC_BODCORE_TRIGLVL_MASK  in fsl_power.c):
You are aware that fsl_power.c is empty in the SDK, we only have the fsl_power compiled library?
But from the picture you showed I guess we can just remove the

#if defined(PMC_BODCORE_TRIGLVL_MASK)

right?

BR,
Jan Pieter de Ruiter

0 Kudos

469 Views
janpieterderuit
Contributor IV

Hi XiangJun Rong,

thanks for the quick reply.

So VBAT BOD is powered in AO power domain (VBAT_PMU pin), but monitors the VBAT_DCDC voltage.
That makes sense, thanks for the clarification.
I think it's worth mentioning in the documentation.

Regarding the default BOD voltage:
You're referring to UM11126, which is for LPC55S6x/LPC55S2x/LPC552x.
But I'm using LPC55S16, which is in UM11295.
Also you're referring to VBAT BOD, but I'm asking about CORE BOD.
Anyway, I don't need to use CORE BOD (ans also found were the defaults are mentioned (below Table 338)

Regarding the PDEN_BODVBAT:
Again: you're referring to VBAT BOD, but I'm asking about CORE BOD.
I also noticed that PMC_BODCORE_TRIGLVL_MASK must be defined to be able to use POWER_SetBodCoreLevel, while there is no documentation about this MASK.
So to me it looks like Core BOD should not be used (configured), right?

BR, Jan Pieter

0 Kudos

452 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I am sorry for referring to wrong user manual.

Pls refer to the POWER_SetBodCoreLevel (power_bod_core_level_t level, power_bod_hyst_t hyst, bool enBodCoreReset); function, as you see there is not so-called PMC_BODCORE_TRIGLVL_MASK, if you call the function, you can set the voltage level and hysteresis to trigger Reset when the core voltage is less than a threshold.

Hope it can help you

BR

XiangJun Rong

 

xiangjun_rong_0-1638239777032.png

 

0 Kudos

446 Views
janpieterderuit
Contributor IV

Hi XiangJun Rong,

thanks again for the quick reply, really appreciated!

I know the function POWER_SetBodCoreLevel is described as such in the User Manual.
But in the SDK, in fsl_power.h, the declaration is:

 

#if defined(PMC_BODCORE_TRIGLVL_MASK)
/*!
 * @brief set BOD core level.
 *
 * @param level BOD detect level
 * @param hyst BoD Hysteresis control
 * @param enBodCoreReset core brown out detect reset
 */
void POWER_SetBodCoreLevel(power_bod_core_level_t level, power_bod_hyst_t hyst, bool enBodCoreReset);
#endif

 

 

So as long as PMC_BODCORE_TRIGLVL_MASK is not defined (which isn't from the SDK), the function is not available.
I was curious, so I tried to use the function by just defining PMC_BODCORE_TRIGLVL_MASK in the makefile, and it builds.
So (at least) libpower_softabi.a is build with this define set.

0 Kudos

438 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jan,

Thank you, I see where it is defined.

BR

Xiangjun Rong

0 Kudos

414 Views
janpieterderuit
Contributor IV

Hi, I don't understand your reply.

Did you find where it is defined? Can you tell me where?

Or are you going to have a look?

BR, Jan Pieter

0 Kudos

403 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jan

I meant I see where the void POWER_SetBodCoreLevel(power_bod_core_level_t level, power_bod_hyst_t hyst, bool enBodCoreReset) is defined in SDK package

thank you

BR

XiangJun Rong

 

xiangjun_rong_0-1638760353876.png

 

0 Kudos