LPC54608 powerconsumption in deepsleep

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC54608 powerconsumption in deepsleep

18,438件の閲覧回数
carstengroen
Senior Contributor II

Dear NXP,

we are currently trying to verify the power consumption of the LPC54608 (QFP 208 in a prototype board) and are seeing something not quite in line with the datasheets.

Mounted on the board:

  • LPC54608
  • 3 pcs 10K pullup resistors on P0.4, P0.5 and P0.6 (ISP0 to ISP2)
  • 3 LED with 1 K series resistors to VCC (output kept at high level, no power consumption from LEDs)
  • 10 pcs decoupling caps (a mix of 10 nF and 100 nF)
  • VBAT is connected to VCC thru a 1 ohm resistor
  • VREFP/VDDA is connected to VCC thru a 1 ohm resistor
  • P3.15 is connected to GND

Board also has NAND Flash and SDRAM on bottom side, none of these are mounted

Debug connector is removed during tests, only supply (1.8V or 3.3V are connected).

The program executes a dummy loop for 1 second and then does sleep or deepsleep for 1 second. The deep powerdown just executes the powerdown and nothing more (no irq enabled etc). We use the utick for generating the 1 second ticks in sleep and deepsleep.

We see the following numbers:

(ROM API is version 19.01)

Running at 12 MHz FRO 

At 3.24V supply

  • Sleep: 3.0 mA (Datasheet: 1.7 mA typ), active 4.0 mA (Datasheet: 4.1 mA typ)
  • Deepsleep: 1.67 mA (Datasheet: 22 uA typ), active (simple loop) 12 MHz:4.1 mA (Datasheet: 4 mA typ)
  • Deep powerdown: 260 nA (Datasheet: 326 nA typ)

At 1.85V supply

  • Sleep: 2.0 mA (Datasheet: 1.7 mA typ@3.3V), active 3.1 mA (Datasheet: 4 mA typ@3.3V)
  • Deepsleep: 550 uA (Datasheet: 22 uA typ@3.3V), active (simple loop) 12 MHz:3.1 mA (Datasheet: 4 mA typ@3.3V)
  • Deep powerdown: 220 nA (Datasheet: 326 nA typ@3.3V)

The numbers for deep powerdown fits fine with the datasheet, no problem there. The sleep consumption at 1.85V is also ok according to the datasheet.

Then things go a little out of control....

At 3.2V, the sleep value is 3.0 mA and datasheet says 1.7 mA. At 1.8V it drops to 2.0 mA (closer to the 1.7 mA)

Deepsleep is more off, at 1.8V it is 1.67 mA, datasheets claims 22 uA. At 1.8V it drops to 550 uA.

I have verified that there is no current flowing over the 3 pullup resistors and also the series resitors for the 3 LEDs.

I'm not sure that any of the peripherals that might be running out from a reset can consume this much power.

Do you (NXP) have an application that demonstrates the numbers from the datasheet ? I know there are samples etc that shows some of the power modes, but they are not complete (does not handle GPIO settings etc etc). There must be a complete sample that can show the exact numbers from the datasheet ??

The "rom power" lib and associated header is a "mess". There is absolutely no documentation about all the different "set voltages etc". Where do we find information about all these details ???

We need to verify these numbers before we are able to go ahead with two new designs with (hopefully) the LPC54608 device.

We are using LPCOpen, the code is below:

    SystemCoreClockUpdate(); //Update clock

    Chip_GPIO_Init(LPC_GPIO);
      /* Enable IOCON clock */
     Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_IOCON);
    
    

    romver = Chip_POWER_GetROMVersion(); // Romver is 19.01

     /* Enable the power to the Watchdog Oscillator,
        UTick timer ticks are driven by watchdog oscillator */
     Chip_SYSCON_PowerUp(SYSCON_PDRUNCFG_PD_WDT_OSC);

     /* Initialize UTICK driver */
     Chip_UTICK_Init(LPC_UTICK);

     /* Clear UTICK interrupt status */
     Chip_UTICK_ClearInterrupt(LPC_UTICK);

     /* Set the UTick for a delay of 1000mS and in repeat mode */
     Chip_UTICK_SetDelayMs(LPC_UTICK, 1000, true);

     /* Enable Wake up from deep sleep mode due to UTick */
     Chip_SYSCON_EnableWakeup(SYSCON_STARTER_UTICK);

     /* Enable UTICK interrupt */
     NVIC_EnableIRQ(UTICK_IRQn);
    
    Chip_SYSCON_EnableWakeup(SYSCON_STARTER_UTICK);
    
    // At 3.24V supply
        // Sleep: 3.0 mA (Datasheet: 1.7 mA typ), active 4.0 mA (Datasheet: 4.1 mA typ)
        // Deepsleep: 1.67 mA (Datasheet: 22 uA typ), active (simple loop) 12 MHz:4.1 mA (Datasheet: 4 mA typ)
        // Deep powerdown: 260 nA (Datasheet: 326 nA typ)
    
    // At 1.85V supply
        // Sleep: 2.0 mA (Datasheet: 1.7 mA typ@3.3V), active 3.1 mA (Datasheet: 4 mA typ@3.3V)
        // Deepsleep: 550 uA (Datasheet: 22 uA typ@3.3V), active (simple loop) 12 MHz:3.1 mA (Datasheet: 4 mA typ@3.3V)
        // Deep powerdown: 220 nA (Datasheet: 326 nA typ@3.3V)

    while (1) {
        for (i=0; i<1000000; i++);
        //Chip_POWER_EnterPowerMode(POWER_SLEEP, 0, 0);
        //Chip_POWER_EnterPowerMode(POWER_DEEP_SLEEP, 0, 0);
        Chip_POWER_EnterPowerMode(POWER_DEEP_POWER_DOWN, 0, 0);
    }    ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

System init:

/* Clock and PLL initialization based on the internal oscillator */
void Chip_SetupIrcClocking(uint32_t iFreq)
{
     PLL_CONFIG_T pllConfig;
     PLL_SETUP_T pllSetup;
     PLL_ERROR_T pllError;

     /* Power up the FRO and set this as the base clock */
     Chip_SYSCON_PowerUp(SYSCON_PDRUNCFG_PD_FRO);

     /* Till the PLL is Up use 12MHz FRO as the base clock */
     Chip_Clock_SetMainClockSource(SYSCON_MAINCLKSRC_FRO12MHZ);


     /* Setup FLASH access */
     setupFlashClocks(iFreq);
     
     /* Set system clock divider to 1 */
     Chip_Clock_SetSysClockDiv(1);
}





/* Set up and initialize hardware prior to call to main */
void Chip_SystemInit(void)
{
     
     /* Enable All SRAMs */
     Chip_SYSCON_PowerUp(SYSCON_PDRUNCFG_PD_SRAM0 | SYSCON_PDRUNCFG_PD_SRAM1 | SYSCON_PDRUNCFG_PD_USB_RAM);
     Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_SRAM1);
     Chip_Clock_EnablePeriphClock(SYSCON_CLOCK_SRAM2);
     
     /* Initial internal clocking @180MHz */
     Chip_SetupIrcClocking(12000000);
     //Chip_SetupIrcClocking(96000000);

     /* Setup system clocking and muxing */
     Board_SetupMuxing();

}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Board muxing is empty.

ラベル(3)
0 件の賞賛
返信
24 返答(返信)

16,852件の閲覧回数
marcprager
Contributor III

I remember how hard it was to get sleep/powerdown modes running on LPC81x. I have no experience with LPC54xxx so far.

Your last observation sounds, like there are some digital input pins active, that are operating as 'electroscopes' .-)

How can you be sure, that for every such pin a pullup/down is active? Especially on a family of uC with different numbers of pins which may be pinned out physically on one package, but are buried inside the package for another...

Then those infamous I2C pins that cannot have a pullup enabled thus must be configured as output and switched to LOW instead. I guess your problem is not something, that's not connected (soldered) but something that's not connectable / only

'connectable' by software settings.

An NXP board proves nothing, because such one can handle (connectable) floating port issues in hardware (external pullup resistor). Full schematic required!

Carsten, I don't envy your work, really. Good luck! You'll make it, eventually.

Marc

0 件の賞賛
返信

16,852件の閲覧回数
carstengroen
Senior Contributor II

Thanks Marc :smileyhappy:

Yes, I find that this low-power stuff usually is the hardest part (some of the CPU manufacturers are not always exactly trustworthy about their current consumption, luckily I have NOT had any problems with NXP and their current consumption numbers !!!!)

I think you are right about the open pins, but according to the datasheet all I/O should have pullups. It would be VERY nice to get a schematic from NXP that shows the absolute minimum required to get the magic low power numbers. Sometimes its a little confusing to see all their "bells and whistles" evaluation boards with much too much stuff on :smileysad:

Regarding the LPC8xx, been there done that :smileyhappy: We have a large project with LPC1778 as "master" and a LPC824 as slave (connected using I2C) that goes to deep sleep and wakes up every second to monitor stuff and fire up the LPC1778 if needed.


I hope and pray for a schematic from NXP that shows EXACTLY what to connect in order to get the 22 uA in deepsleep :smileyhappy:

We absolutely need to verify and demonstrate that this power consumption can be achieved before proceeding.

I'm all ready and prepared to make a PCB ASAP with that and only that configuration, once I get the information the gerbers will be sent within 2 hours  !!

0 件の賞賛
返信

16,853件の閲覧回数
pge
Contributor I

Have you tried to set all non connected IO as GPIO low level (0) output ?

Non connecte IO are floating and consume few microamps per IO.

This match with your first measurement in Deep Power Down mode you have correct value because all IO are not powered at all while in Deep Sleep mode they are still powered.

PGE

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Good point, but all the I/O are internally pulled up so not floating. But still it would be nice to have a schematic from NXP that shows exactly what to connect to get the results from the datasheet

EDIT: Just to be sure, I tried setting all GPIO to outputs and set the output state to low. (except the 3 pins with pullup resistors). No change in current in deepsleep.

!! The above is not correct, I failed with this test! Setting all gpio to output and 0 level lowers the current to 370 uA !!

0 件の賞賛
返信

16,853件の閲覧回数
pge
Contributor I

Internal pull-up  are not good with low-power. You should try to disable them and configure all IO as GPIO low level (0) output. 

If you look at datasheet you can see the following:

Power measurements in Active, sleep, and deep-sleep modes were performed under the
following conditions:
• Configure all pins as GPIO with pull-up resistor disabled in the IOCON block.
• Configure GPIO pins as outputs using the GPIO DIR register.
• Write 1 to the GPIO CLR register to drive the outputs LOW.
• All peripherals disabled.

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Patrick,

as I wrote just before your answer, setting the GPIO to outputs and low did not change the current one single bit.

(the code I run is the exact same as Tom is running on the NXP ref design where he sees 21 uA)

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Oh my, I failed in the "set GPIO to output and low level" !

When setting it correct, the current is now lowered to 370 uA !

I do not set P0.4, P0.5 and P0.6 as well as P0.10, P0.11, P0.12 (ISP bypass and SWD). All others are set as outputs and low level!

The board is now also not sensitive to touching anymore!

Thanks "pge" !

Still have a long way to go, 370 uA is somewhat larger than 22 uA :smileywink:

0 件の賞賛
返信

16,852件の閲覧回数
pge
Contributor I

Try to set also the ISP and SWD pin associated GPIO as output low level but keep the current configuration for the muxing. These IOs will have SWD/ISP signals but the internal GPIO will not be floating. 

Also double check that all peripherals are turned off (AHBCLKCTRL) and all analog block are also turned off (PDRUNCFG)

Patrick

0 件の賞賛
返信

16,852件の閲覧回数
carstengroen
Senior Contributor II

Thanks Patrick,

the trick with the SWD and ISP pins did not change things.

The PDRUNCFG are set when the POWER_EnterDeepSleep() function is called (only the SRAM blocks and WDT OSC are kept running). The AHBCLKCTRL should have no impact that the clock is off I think ? 

Disabling most of the SRAM did make a rather large impact.

If only the SRAMX are enabled during deepsleep, consumption is around 290 uA

If all the SRAM are enabled, consumption is around 325 uA

The 290 uA should be the same conditions as the one in the datasheet, it still puzzles me that Tom measures 21 uA in his setup.

The difference in current enabling the SRAM0/1/2/3 is also of major concern to us (I don't think I did find the current consumption for the SRAM blocks in the DS, only number that are dependent on clock frequency are shown...)

Anyway, the 290 uA should be 23 uA, so something is clearly not right (yet)

(The 370 uA from my measurement before were taken a little to fast, sleep time is now "forever" and current takes some time to come down)

0 件の賞賛
返信

16,853件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

There are several issues in your code.

(1) I suspect that your code got into exceptional interrupt handler before going to deep sleep mode since you shut off all the RAMs and no wakeup source to wake up the MCU from deep sleep mode. The current your got looks like active current to me or it went to deep sleep mode and came back on in 1 second and you didn't notice the current spike,

(2) If you want to use the UTICK as the wakeup souce, you will have to leave WDT on in deep sleep mode, then, your

deep sleep current would be higher. 

 

First of all, make sure you go to deep sleep mode correctly:

        // Increase your UTICK interval from 1 second to 5 seconds, thus, give you enough time to monitor the power down

current.

        // Leave at least one RAM on, if your application use RAMX, then, you need to leave RAMX on, instead of RAM0.

        // Leave each RAM on in deep sleep mode, deep sleep current is ~5~10uA higher.


        Chip_POWER_EnterPowerMode( POWER_DEEP_SLEEP, (SYSCON_PDRUNCFG_PD_SRAM0 | SYSCON_PDRUNCFG_PD_WDT_OSC), 0 );

      // MCU should wake up after 5 seconds.
        while(1);      // Ideally, use the LED blinky code to make sure MCU wakes up by the UTICK.

(3) If you like to see lower current, use pin interrupt as wakeup source, you can power down the WDT in deep sleep mode as below. You will get the power number: closer to the data sheet:

  Chip_POWER_EnterPowerMode( POWER_DEEP_SLEEP, SYSCON_PDRUNCFG_PD_SRAM0, 0 );

(4) Once you program your code into the flash, make sure SWD_CLK is disconnected, or pull your SWD debugger out. It will lower your current.

(5) Little things makes difference. In your code, if you don't use GPIO or RAM2, or RAM3, don't leave them on, your actvie current will be lower.

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Tang,

I have now started work on this again. I have changed the UTICK delay to 5 seconds as you proposed. MHz

I now measure 560 uAmp in deepsleep.

When doing POWER_DEEP_SLEEP, I see no difference on the power consumption 

from

Chip_POWER_EnterPowerMode(POWER_DEEP_SLEEP, (SYSCON_PDRUNCFG_PD_SRAM0  | SYSCON_PDRUNCFG_PD_WDT_OSC), 0);‍‍‍‍‍

to

Chip_POWER_EnterPowerMode(POWER_DEEP_SLEEP, 0, 0);‍‍‍‍‍

and both ways works as they should, the CPU wakes up every 5 seconds (a LED is lit while doing the "for (i=0:..." code.

and the current are in both cases 560 uAmp

When doing the POWER_SLEEP, current consumption is still 1.7 to 1.8 mA. Program works also correctly here (LED flashes etc)

It would be very nice to see have the source code available for the powerlib functions, then it would be possible to see what the difference is, or at least NXP to supply a testprogram that shows the exact and precise way to get the current consumption shown in the datasheet !

I need to be able to show this for any of our projects to take off (especially the deepsleep)

0 件の賞賛
返信

16,853件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

Carsten,

     Sorry to see you struggle on this. On the LPCXpresso54608 board, I could never achieve the power number specfied

on the datasheet because there are too much interactions between the debugger and target MCU. The optimal power consumption was obtained from the internal eval board that there is very little interaction with the external components.

Unfortunately, we only built a few for internal use. So, it's not likely the software or power library issue, but the board you are testing. There will be a break-up board coming, but, I don't know about the exact release date yet.

Based on the datasheet, SRAMx and WDT OSC only draw 2uA and 23uA, when you leave them on in deep sleep mode, it may not be noticable. But, if one of the pins you set pull-up internally, but pulled-down externally, it draws 20~30uA easily.

If you don't use GPIO as wakeup source and SRAMx, don't turn on the clocks in SYSAHBCLKCTRLx, also check your PDRUNCFGx and make sure all these unused peripherals are powered down.

The only API you need to use is the Chip_POWER_EnterPowerMode() to enter one of the low-power modes.

set_voltage() will set the internal regulator voltage and number of wait state to optimal based on the operational frequency you like to use so that you can achieve lowest power and highest perforrmance (e.g. coremark score). 

Publishing source is easy, but matching documentation is not because there are some many internal regulators controlling different peripherals. Shutting off flash in deep sleep mode and turn flash back on wakeup also involved some other peripherals related to the silicon. We don't try to keep it as a secret but make customers' life easier.

Do you mind sending us the schematics along with the complete source, maybe through an official support channel?

I assume you measure current on VDD. I am also curious how your VDDA, VREFN, and VDDA are connected on your board.

 

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Tang,

I understand Smiley Happy

The board I have made has also footprints for USB, SD, NAND flash and SDRAM etc but none of this are mounted on the board I do the power tests on. I have taken the original schematic and removed all components that are not mounted to simplify things. The stuff you see on the attached schematic is exactly what are mounted on the board (picture of the board in my original post)

The power supply is coming from a lab supply (3.2 V). Current is measure with a Agilent (keysight) 34461A benchtop multimeter (also measured across a 10 ohm resistor with a Keysight MSOX3024T scope)

I had forgotten to remove the pullup in IOCON register for P3.15, when I do that the power drops to 510 uA in deepsleep (before this it was 560 uA).

NOTE: C23 (22 uF) has been removed, no change in current (was afraid of leakage if defect etc)

To get a little closer to whats going on, I tried the utick_wakeup project from the SDK (version 2.2). With this example, a little modified to the original, I get 255 uA in deepsleep! This better than my own example, but still 10 times worse than the datasheet ?

The code from utick_wakeup.c and pin_mux.c is below:

/*
 * Copyright (c) 2016, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * o Redistributions of source code must retain the above copyright notice, this list
 *   of conditions and the following disclaimer.
 *
 * o Redistributions in binary form must reproduce the above copyright notice, this
 *   list of conditions and the following disclaimer in the documentation and/or
 *   other materials provided with the distribution.
 *
 * o Neither the name of the copyright holder nor the names of its
 *   contributors may be used to endorse or promote products derived from this
 *   software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "fsl_debug_console.h"
#include "board.h"
#include "fsl_common.h"
#include "fsl_power.h"
#include "fsl_utick.h"

#include "pin_mux.h"
#include <stdbool.h>
/*******************************************************************************
 * Definitions
 ******************************************************************************/
#define APP_EXCLUDE_FROM_DEEPSLEEP                                                                             \
    (SYSCON_PDRUNCFG_PDEN_SRAMX_MASK | SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK | \
     SYSCON_PDRUNCFG_PDEN_WDT_OSC_MASK)
#define APP_LED_INIT (LED3_INIT(1));
#define APP_LED_TOGGLE (LED3_TOGGLE());
#define UTICK_TIME 3000000
/*******************************************************************************
 * Prototypes
 ******************************************************************************/
/*!
 * @brief delay a while.
 */
void delay(void);

/*******************************************************************************
 * Code
 ******************************************************************************/
void delay(void)
{
    volatile uint32_t i = 0;
    for (i = 0; i < 3000000; ++i)
    {
        __asm("NOP"); /* delay */
    }
}

/*!
 * @brief Main function
 */
int main(void)
{
    /* enable clock for GPIO*/
    CLOCK_EnableClock(kCLOCK_Gpio3);

    BOARD_InitPins();

    /* Running FRO = 12 MHz*/
    BOARD_BootClockFRO12M();

    APP_LED_INIT;

    UTICK_Init(UTICK0);

    /* Set the UTICK timer to wake up the device from reduced power mode */
    UTICK_SetTick(UTICK0, kUTICK_Repeat, UTICK_TIME, NULL);

    /* Enter Deep Sleep mode */
    POWER_EnterDeepSleep(APP_EXCLUDE_FROM_DEEPSLEEP);

    while (1)
    {
        LED3_ON();
        delay();
        LED3_OFF();
        POWER_EnterDeepSleep(APP_EXCLUDE_FROM_DEEPSLEEP);
    }
}

/*
 * Copyright (c) 2016, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * o Redistributions of source code must retain the above copyright notice, this list
 *   of conditions and the following disclaimer.
 *
 * o Redistributions in binary form must reproduce the above copyright notice, this
 *   list of conditions and the following disclaimer in the documentation and/or
 *   other materials provided with the distribution.
 *
 * o Neither the name of the copyright holder nor the names of its
 *   contributors may be used to endorse or promote products derived from this
 *   software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * TEXT BELOW IS USED AS SETTING FOR THE PINS TOOL *****************************
PinsProfile:
- !!product 'Pins v2.0'
- !!processor 'LPC54608J512'
- !!package 'LPC54608J512ET180'
- !!mcu_data 'ksdk2_0'
- !!processor_version '0.0.0'
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR THE PINS TOOL ***
 */

#include "fsl_common.h"
#include "fsl_iocon.h"
#include "pin_mux.h"

#define IOCON_PIO_DIGITAL_EN        0x0100u   /*!< Enables digital function */
#define IOCON_PIO_FUNC0               0x00u   /*!< Selects pin function 0 */
#define IOCON_PIO_FUNC1               0x01u   /*!< Selects pin function 1 */
#define IOCON_PIO_FUNC5               0x05u   /*!< Selects pin function 5 */
#define IOCON_PIO_FUNC6               0x06u   /*!< Selects pin function 6 */
#define IOCON_PIO_INPFILT_OFF       0x0200u   /*!< Input filter disabled */
#define IOCON_PIO_INV_DI              0x00u   /*!< Input function is not inverted */
#define IOCON_PIO_MODE_INACT          0x00u   /*!< No addition pin function */
#define IOCON_PIO_MODE_PULLUP         0x20u   /*!< Selects pull-up function */
#define IOCON_PIO_OPENDRAIN_DI        0x00u   /*!< Open drain is disabled */
#define IOCON_PIO_SLEW_STANDARD       0x00u   /*!< Standard mode, output slew rate control is enabled */
#define PIN2_IDX                         2u   /*!< Pin number for pin 2 in a port 2 */
#define PIN10_IDX                       10u   /*!< Pin number for pin 10 in a port 0 */
#define PIN12_IDX                       12u   /*!< Pin number for pin 12 in a port 3 */
#define PIN29_IDX                       29u   /*!< Pin number for pin 29 in a port 0 */
#define PIN30_IDX                       30u   /*!< Pin number for pin 30 in a port 0 */
#define PORT0_IDX                        0u   /*!< Port index */
#define PORT2_IDX                        2u   /*!< Port index */
#define PORT3_IDX                        3u   /*!< Port index */

/*
 * TEXT BELOW IS USED AS SETTING FOR THE PINS TOOL *****************************
BOARD_InitPins:
- options: {coreID: singlecore, enableClock: 'true'}
- pin_list:
  - {pin_num: A2, peripheral: FLEXCOMM0, signal: TXD_SCL_MISO, pin_signal: PIO0_30/FC0_TXD_SCL_MISO/CTIMER0_MAT0/SCT0_OUT9/TRACEDATA(1), mode: inactive, invert: disabled,
    glitch_filter: disabled, slew_rate: standard, open_drain: disabled}
  - {pin_num: B13, peripheral: FLEXCOMM0, signal: RXD_SDA_MOSI, pin_signal: PIO0_29/FC0_RXD_SDA_MOSI/CTIMER2_MAT3/SCT0_OUT8/TRACEDATA(2), mode: inactive, invert: disabled,
    glitch_filter: disabled, slew_rate: standard, open_drain: disabled}
  - {pin_num: C3, peripheral: GPIO, signal: 'PIO2, 2', pin_signal: PIO2_2/ENET_CRS/FC3_SSEL3/SCT0_OUT6/CTIMER1_MAT1, mode: pullUp, invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: L2, peripheral: SYSCON, signal: CLKOUT, pin_signal: PIO3_12/SCT0_OUT8/CTIMER3_CAP0/CLKOUT/EMC_CLK(1)/TRACECLK, mode: inactive, invert: disabled, glitch_filter: disabled,
    slew_rate: standard, open_drain: disabled}
  - {pin_num: P2, peripheral: SWD, signal: SWO, pin_signal: PIO0_10/FC6_SCK/CTIMER2_CAP2/CTIMER2_MAT0/FC1_TXD_SCL_MISO/SWO/ADC0_0, mode: inactive, invert: disabled,
    glitch_filter: disabled, open_drain: disabled}
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR THE PINS TOOL ***
 */

/*FUNCTION**********************************************************************
 *
 * Function Name : BOARD_InitPins
 * Description   : Configures pin routing and optionally pin electrical features.
 *
 *END**************************************************************************/
void BOARD_InitPins(void) {
  CLOCK_EnableClock(kCLOCK_Iocon);                           /* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */

  const uint32_t port0_pin10_config = (
    IOCON_PIO_FUNC6 |                                        /* Pin is configured as SWO */
    IOCON_PIO_MODE_INACT |                                   /* No addition pin function */
    IOCON_PIO_INV_DI |                                       /* Input function is not inverted */
    IOCON_PIO_DIGITAL_EN |                                   /* Enables digital function */
    IOCON_PIO_INPFILT_OFF |                                  /* Input filter disabled */
    IOCON_PIO_OPENDRAIN_DI                                   /* Open drain is disabled */
  );
  IOCON_PinMuxSet(IOCON, PORT0_IDX, PIN10_IDX, port0_pin10_config); /* PORT0 PIN10 (coords: P2) is configured as SWO */
  
 
  const uint32_t port3_pin012_config = (
    IOCON_PIO_FUNC0 |                                        /* Pin is configured as PIO2_2 */
    IOCON_PIO_MODE_PULLUP |                                  /* Selects pull-up function */
    IOCON_PIO_INV_DI |                                       /* Input function is not inverted */
    IOCON_PIO_DIGITAL_EN |                                   /* Enables digital function */
    IOCON_PIO_INPFILT_OFF |                                  /* Input filter disabled */
    IOCON_PIO_SLEW_STANDARD |                                /* Standard mode, output slew rate control is enabled */
    IOCON_PIO_OPENDRAIN_DI                                   /* Open drain is disabled */
  );
  IOCON_PinMuxSet(IOCON, 3, 0, port3_pin012_config); /* PORT3 PIN0 (coords: C3) is configured as PIO3_0 */
  IOCON_PinMuxSet(IOCON, 3, 1, port3_pin012_config); /* PORT3 PIN1 (coords: C3) is configured as PIO3_1 */
  IOCON_PinMuxSet(IOCON, 3, 2, port3_pin012_config); /* PORT3 PIN2 (coords: C3) is configured as PIO3_2 */
  
 
  const uint32_t port3_pin15_config = (
    IOCON_PIO_FUNC0 |                                        /* Pin is configured as PIO3_15 */
    IOCON_PIO_MODE_INACT |                                  /* Selects no pull function */
    IOCON_PIO_INV_DI |                                       /* Input function is not inverted */
    IOCON_PIO_DIGITAL_EN |                                   /* Enables digital function */
    IOCON_PIO_INPFILT_OFF |                                  /* Input filter disabled */
    IOCON_PIO_SLEW_STANDARD |                                /* Standard mode, output slew rate control is enabled */
    IOCON_PIO_OPENDRAIN_DI                                   /* Open drain is disabled */
  );
  IOCON_PinMuxSet(IOCON, 3, 15, port3_pin15_config); /* PORT3 PIN15 (coords: C3) is configured as PIO3_15 */

}

/*******************************************************************************
 * EOF
 ******************************************************************************/
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 件の賞賛
返信

16,853件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

Casten,

     I am trying to use the breakup board and internal validation board with minimum interaction with external components. On LQFP 100 and BGA 180 package, both deep sleep current is very close to the data sheet number,

mid-20uA. But, on 3 boards with LQFP208 package I am testing, the deep sleep current is a lot higher now, varies from 90uA to 200uA. On one of the boards I am testing, tying AGND and VREFN, the current is 70uA less. So, I do like to know how you connect these ground pins. I will also try to find a matching part you are using LPC54608J512, W3, 1635XX and try it out.

 

     Just let you know I am in the middle of the debugging on that now and will get back to you on this. At mean time, it will be helpful if you could try on a different board.

0 件の賞賛
返信

16,853件の閲覧回数
carstengroen
Senior Contributor II

Tang,

I just tried a BGA board I made with a

LPC54608J512

ET180

P6W559.00  13

ESD17061A

Basically the same connections as the board above (no SDRAM mounted). On this I see 700 uA with the same program running (deepsleep). Not quite sure whats going on there...There might be some mounting issues with the BGA, I tried changing the CPU, but no change. There might still be something not quite perfect, so lets ignore that one for now.

The original design, if you look at the schematics above the VREFN is connected to GND, but! the VSSA (analog ground) is NOT connected (must have missed that one during symbol creation, sorry for that! I tried connecting the VSSA to GND also, but the current did not change

0 件の賞賛
返信

16,853件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

LPC5460x_208pin_deepsleep_current.jpg

Carsten,

    I got deep sleep current working on the 208-pin package socketed NXP validation board. I tested 3 chips on this board. There are some loose connection on the socket I struggled a lot, but once it's working, the overall the deep sleep current should match what our Datasheet states, 20~25uA.

Once you program the flash, if you have SWCLK tied to GND, the deep sleep current is around mid-70uA, take the jumper out to leave it open, it should be mid-20uA. I tried to tie VREFN to AGND or GND or both, it didn't make any difference. Attached here is my test code. But, for some reason, I suspect it's not your code but something is wrong on your board.

Best regards,

Tom

0 件の賞賛
返信

16,852件の閲覧回数
carstengroen
Senior Contributor II

Tom,

I have now mounted another board (BD208). I have only mounted the absolute minimum of components. Also, I have added connections to the USB1 (GND/VCC). The program running is the "examples_5460x\periph_pmu" you attached in your post above.

I measure around 600 uA on this board, but a very interesting observation is that when moving a finger across the first 30 pins or so (approx pin 10 and upwards) the current consumption sometimes goes as low as 70 uA ! So maybe there is something that is not connected but should be ??

I have triple checked the pinout of the device and found to errors, the layout should also be ok

So, I'm a little lost here. Attached the schematic for the connections on this specific testboard, is there anything you could recommend ? 

0 件の賞賛
返信

16,852件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

Carsten,

     You are very close, once you get to ~70uA, remove SWCLK jumper, it should get you down to mid-20uA. It's one of these pins (first ~30 pins you mentioned above) on your board causing the problem.

    Attached here is the 208-pin package schematics, it's not I don't want to show you the schematics in the first place, we also use this board for some analog characterization. So, it's not the simplest solution. The important part is this board doesn't have an on-board debugger tied to target, and all jumpers are very flexible.

JP1, JP2, JP7, JP23, JP24, JP25, JP27, JP29(3and4), JP31(3and4), JP57(1and2), JP70, JP71(1and 2), JP72, JP73 are closed, current is measured between JP21(1and2).

All these SJs are tied to the GPIOs, so, no EMC or SPIFI, or SD pins are connected.

All these GPIOs are inputs with pull-up already, you shouldn't have to do anything, if you set all GPIOs to output low, the total I/O current should show little difference.

   

Once you program the deep sleep code to the flash, remove jumper on JP31, you should save additional 40~50uA.

  

Best,

Tom

0 件の賞賛
返信

16,852件の閲覧回数
carstengroen
Senior Contributor II

Thanks Tom,

I have looked over the schematics, and at first glance I don't see anything (much) different than I do :smileysad:

But, can you also measure the current for USB1, analog etc ? When I measure the consumption, I do it for my board in total (total current on 3.3V). I need the total current for the complete chip in order to be able to judge if we can use it or not.

Don't misunderstand me, I appreciate the schematics and the work you have done in explaining it, but it would still be nice if someone from NXP would take the responsibility and make a simple and correct schematic for the verification of the deepsleep current (I'm not knocking on you in any way! :smileywink:). As I wrote, I will get a test board produced ASAP if such info could be made available from NXP.

I have also issued a support ticket about this as time is running out and we do soon need to make a decision here...

0 件の賞賛
返信

16,852件の閲覧回数
Dezheng_Tang
NXP Employee
NXP Employee

Carsten,

    Someone internally is working on a simplified board to measurement deep sleep current. Once he finished the testing,

I will ask around if we could loan you a board to do some measurement.

    For deep sleep current with USB1, this is a tricky one: you have two options to do that:

(1) If you want to use USB1Wake or USB1Activity interrupt as the wake up source to wake up the part from deep sleep, you will have to leave USB PLL, external OSC, USB PHY, and USB RAM on in deep sleep mode, it will result lot higher deep sleep current. We have the option to do it, but personally speaking, it's not desired. 

(2) You can use the pin interrupt to wakup MCU from deep sleep, then, you can pretty much shut off everything when you call Chip_POWER_EnterPowerMode(), the deep sleep current should be the same as I mentioned earlier, lower-to mid 20uA, you can have the USB1 running in normal operation, but, you need to shut off all the USB1 related: USB PLL, external OSC, USB PHY, USB RAM, route USB1 VBUS pin to a GPIO pin interrupt, before going to deep sleep mode. After wakeup (e.g. USB cable is plugged in and connected to the host, VBUS is high), you need to power up external OSC and USB PHY, re-enable USB PLL, re-initialize USB1 controller, etc., which result longer wakeup time. But, deep sleep current is very low.

Tom

0 件の賞賛
返信