LPC55S69 : Power-down mode & GPIO lines

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

LPC55S69 : Power-down mode & GPIO lines

3,278 Views
EugeneHiihtaja
Senior Contributor I

Hi !

Almost all peripherals ( except wakeup sources ) need to be reinitialized after wakeup from power-down mode.

But what about native GPIO lines ? I have several lines what configured as output and also used PU/PD resistors.

It seems to be they completely loze configuration and direction need to be configured again and etc.

For example LEDs on EVK boards are not possible to put ON e.g very weak low signal.

Does it specified somewhere to what configuration, GPIO lines dropped during power down state ?

Can those lines keep at list PU/PD register for keep state with smaller sink current as usually.

Regards,

Eugene

Labels (1)
0 Kudos
Reply
7 Replies

3,105 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Eugene, 

Power-down mode eliminates power used by almost all analog and digital peripherals. Both FRO 192-MHz and FRO 1-MHz are disabled. The flash memory is also disabled. The processor state – and some critical peripherals like the security controller are retained, internal SRAM values can be maintained, and the logic levels of the pins remain static. GPIO group interrupts, selected serial peripherals in Flexcomm3 (SPI, I2C, USART), RTC, OS Event Timers and analog comparator can be left running.

If you need to maintain control of the GPIO, I recommend to consider using deep-sleep mode instead. Here the CPUs state and registers, peripheral registers, and internal SRAM values are maintained, and the logic levels of the pins remain static.

Please refer to chapter 13 of the user manual for more information.

Best Regards,

Sabina

0 Kudos
Reply

3,105 Views
EugeneHiihtaja
Senior Contributor I

Hi sabinabruce‌ !

Could you point me to exact place where mentioned "and the logic levels of the pins remain static" in case of PowerDown mode ?

I clearly see that GPIO-DIR is set to 0 e.g pins start to be inputs and only PU/PD can maintain level if no need high current.

I think GPIO pin repeater mode is designed to assist for this feature/problem.

Can it be clarified little bit more ? Someting weired with those regular GPIO pins.

Regards,

Eugene

0 Kudos
Reply

3,105 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hi Eugene, 

You may refer to section 13.3.5 of the User manual.

Repeater mode can help you for the GPIO pins that are configured as input and not driven externally. So in the case of leds this will not be possible to configure as repeater. 

Can you provide a small example project of this behavior you are experiencing, so that I can test it from my end.

Best Regards,

Sabina

0 Kudos
Reply

3,105 Views
EugeneHiihtaja
Senior Contributor I

Hi sabinabruce‌ !

I have modified standart lpc example where DIR and FMCCR registers is printed before and after power down mode.

Entering Powerdown [Reset to wakeup] ...
+Port0 DIR - 0x0, PIN - 0x60001024, SET - 0x0, CLR - 0x0
+Port1 DIR - 0xD0, PIN - 0x40200, SET - 0x40200, CLR - 0x0
+SYSCON->FMCCR - 0x103A

Press any key to confirm to enter the power down mode and wakeup the device by press s1 key on board.

Gin event occurs
-Port0 DIR - 0x0, PIN - 0x60001004, SET - 0x0, CLR - 0x0
-Port1 DIR - 0x0, PIN - 0x402C0, SET - 0x402C0, CLR - 0x0
-SYSCON->FMCCR - 0x101A
Wakeup.

You can see that DIR and prefetch bit are lost.

Those finding are not clearly mentioned in UM and need to be clarified if this some wrong configuration 

or just some errata or expected behaviour. But official NXP reply required.

Regards,

Eugene

PS. I haven't found how-to attach file to this post but exact modification for file power_manager_lpc :

"

#if (defined(FSL_FEATURE_SYSCON_HAS_POWERDOWN_MODE) && FSL_FEATURE_SYSCON_HAS_POWERDOWN_MODE)
case kPmu_PowerDown: /* Enter power down mode. */
{
/* Led initialized and set ON */
LED_RED_INIT(0);
LED_BLUE_INIT(0);
LED_GREEN_INIT(0);
PRINTF("+Port0 DIR - 0x%X, PIN - 0x%X, SET - 0x%X, CLR - 0x%X\r\n", GPIO->DIR[0], GPIO->PIN[0], GPIO->SET[0], GPIO->CLR[0]);
PRINTF("+Port1 DIR - 0x%X, PIN - 0x%X, SET - 0x%X, CLR - 0x%X\r\n", GPIO->DIR[1], GPIO->PIN[1]), GPIO->SET[1], GPIO->CLR[1];
SYSCON->FMCCR |= 0x30; // enable prefetch, acceleration is enabled by default
PRINTF("+SYSCON->FMCCR - 0x%X\r\n", SYSCON->FMCCR);

PRINTF(
"\r\nPress any key to confirm to enter the power down mode and wakeup the device by press s1 key on "
"board.\r\n\r\n");
GETCHAR();

#if (defined(FSL_FEATURE_POWERLIB_EXTEND) && FSL_FEATURE_POWERLIB_EXTEND)
#if (defined(DEMO_WAKEUP_WITH_GINT) && DEMO_WAKEUP_WITH_GINT)
DEMO_PreLowPower();
POWER_EnterPowerDown(APP_EXCLUDE_FROM_POWERDOWN, 0x7FFF,
WAKEUP_GPIO_GLOBALINT0 | WAKEUP_GPIO_GLOBALINT1, 1);
DEMO_PowerDownWakeup();
APP_InitWakeupPin();

PRINTF("-Port0 DIR - 0x%X, PIN - 0x%X, SET - 0x%X, CLR - 0x%X\r\n", GPIO->DIR[0], GPIO->PIN[0], GPIO->SET[0], GPIO->CLR[0]);
PRINTF("-Port1 DIR - 0x%X, PIN - 0x%X, SET - 0x%X, CLR - 0x%X\r\n", GPIO->DIR[1], GPIO->PIN[1]), GPIO->SET[1], GPIO->CLR[1];
PRINTF("-SYSCON->FMCCR - 0x%X\r\n", SYSCON->FMCCR);
#endif
#else
POWER_EnterPowerDown(APP_EXCLUDE_FROM_POWERDOWN);
#endif
}
break;
#endif

0 Kudos
Reply

3,105 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hi Eugene,

So after thoroughly checking what happens. I found that when the command  CLOCK_SetFLASHAccessCyclesForFreq(32768U); is executed it rewrites the value. So to force that the prefetch bit is not over written I simply added that 0x30 to enable the prefetch bit.

pastedImage_1.png

Then when this gets execute it will not rewrite the bit. 

Once I execute the example you provided I get the following:

pastedImage_2.png

Here it won't be necessary to add the following line since it will be done in that function.

SYSCON->FMCCR |= 0x30; // enable prefetch, acceleration is enabled by default

Best Regards,

Sabina

0 Kudos
Reply

3,105 Views
EugeneHiihtaja
Senior Contributor I

Hi sabinabruce‌ !

So you also see drop of prefetch bit and DIR registers.

I think usage of CLOCK_SetFLASHAccessCyclesForFreq(32768U) is not mandatory. MCu can go to PowerDown from any clock scheme.

So I should recover it in my code in common case.

Is this so ?

Regards,

Eugene

0 Kudos
Reply

3,105 Views
Sabina_Bruce
NXP Employee
NXP Employee

Yes it looks like it needs to be recovered after waking up from power down. This can be implemented in another location of your preference or as I have done above. 

Sabina

0 Kudos
Reply