Hello,
I'm trying to reach the current stated in the datasheet of the LPC845 in power down mode.
I'm working at Tamb = 25°C, Vdd = 3.3V, QFN33 package.
This is the code I run :
#include "fsl_debug_console.h"
#include "board.h"
#include "fsl_common.h"
#include "fsl_power.h"
#include "fsl_usart.h"
#include "fsl_syscon.h"
#include "fsl_wkt.h"
#include "fsl_iocon.h"
#include "pin_mux.h"
#include <stdbool.h>
#include "fsl_pint.h"
#include "fsl_swm.h"
/*
* Setup a GPIO input pin as wakeup source.
*/void DEMO_PreEnterLowPower(void)
{
/* switch main clock source to FRO18M */
POWER_DisablePD(kPDRUNCFG_PD_FRO_OUT);
POWER_DisablePD(kPDRUNCFG_PD_FRO);
CLOCK_SetMainClkSrc(kCLOCK_MainClkSrcFro);
CLOCK_SetFroOscFreq(kCLOCK_FroOscOut18M);
CLOCK_SetFroOutClkSrc(kCLOCK_FroSrcFroOsc);/* system osc power down
* application should decide if more part need to power down to achieve better power consumption
* */
POWER_EnablePD(kPDRUNCFG_PD_SYSOSC);
CLOCK_DisableClock(kCLOCK_Iocon);
CLOCK_DisableClock(kCLOCK_Uart0);
}
/*!
* @brief Main function
*/
int main(void)
{
BOARD_BootClockPll24M();GPIO_PortInit(GPIO, 0);
CLOCK_EnableClock(kCLOCK_Iocon);/* disable all pull ups */
for (int i =0; i< 52; i++)
{
if (i == 12) continue; //reserved
if (i == 19) continue; //reserved
if (i > 30 && i <35) continue; //reserved
if (i > 35 && i <50) continue; //reserved
IOCON->PIO[i] &= ~(IOCON_PIO_MODE_MASK);
IOCON->PIO[i] &= ~(IOCON_PIO_HYS_MASK);
}CLOCK_DisableClock(kCLOCK_Iocon);
for (int i =0; i< 28; i++)
{
if (i == 24)// || i == 6)
{
//UART RX pin set to input
GPIO_PinInit(GPIO, 0, i, &(gpio_pin_config_t){kGPIO_DigitalInput, 0});
continue;
}
if (i == 6)
{
//S2LP shutdown must be set
GPIO_PinInit(GPIO, 0, i, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
continue;
}
GPIO_PinInit(GPIO, 0, i, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
}DEMO_PreEnterLowPower();
/* disable SWD */
CLOCK_EnableClock(kCLOCK_Swm);
SWM0->PINENABLE0 = 0xFFFFFDFF; //demap everything except reset
SWM0->PINENABLE1 = 0x7F;
CLOCK_DisableClock(kCLOCK_Swm);
CLOCK_DisableClock(kCLOCK_Gpio0);
POWER_EnterPowerDown(0);return 1;
}
What am I missing?
FYI for the community:
We spent a lot of time trying to achieve the 1.5uA consumption in Power-Down mode on LPC845M301JHI33, but we couldn't get it lower than ~6uA. We finally got confirmation from NXP that the LPC845 in 33-pin package draws more current than the higher-pin-count parts.
NXP's response was:
33pin package power down mode typical power consumption is higher than 48pin, which is normal but currently they don't have data in DS
The suggestion from application team is " using the 48pin package to replace the 33pin package".
Hope this note saves some headache and wasted time for someone else...
Hi wang qifei
I got time to test your power_mode_switch_lpc.c today -- replace the same file with it under SDK2.8 power_mode_switch_lpc demo . but the result is not as yours, Could you please upload your project here?
Thanks
Jun Zhang
I tested it again.
I think the key issue of getting 43.6uA in power down mode is that IDE is interactive with LPC845 via SWD background, LPC845 debug module was not fully power down. I just tested below code on demo code (very simple):
after downloading code, disconnected power supply, then powered on board again. the current went down to 1.5uA:
Jun Zhang
Good to know.
Thanks for the sharing,
Jun Zhang
Hello Jun,
The code above is extracted from the example you've mentioned. Actually the power consumption is about the same with the example.
By the way, the mode 4 (deep power down) does not work on my side, current does not go below 2mA in this mode (but this is not the problem here)
In the code I posted above, is there something missing, did I forget to disable something ?
Thanks,
I checked sample code power down mode, temperature is around 26C. it's 43.6 uA. It's normal. please check the same.
Hello,
Ok, but what modifications do I have to do in the code, in order to be able to reach the current stated in page 48 of the datasheet ?
Power-down mode states 1.5µA typ current at 25°C...
Thank you,
Victor
Victor,
in order to get the datasheet value, you need
- IDD measurements were performed with ALL pins configured as GPIO outputs driven LOW and pull-up resistors disabled.
- ALL oscillators and analog blocks turned off.
the SDK demo should not do all above initialization.
BTW, I test deep power down mode with SDK demo. the Id is 1.4uA
Have a great day,
Jun Zhang
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello Jun,
Can you provide the project used for reaching this current ?
I honestly don't know what I forget to disable...
Thanks !
Sorry, I don't have the testing project for datasheet data.
User needs to follow this to implement by self.
Thanks,
Jun Zhang
Hi
I suggest test your board with MCUXpresso SDK demo
SDK_LPCXpresso845MAX\boards\lpcxpresso845max\demo_apps\power_mode_switch_lpc\
This demo has 4 options:
1. Sleep mode
2. Deep Sleep mode
3. Power Down mode
4. Deep power down mode
select power download mode, test if the current is as your expected.
Have a nice day,
Jun Zhang