GPIO output become low in Extend sleep mode

6 posts / 0 new
Last post
ZhiGang
Offline
Last seen:5 years 9 months ago
加入:2014-12-04 09:56
GPIO output become low in Extend sleep mode

I test DA14580 in my DA14580EVKET-B, and set GPIO port 0, pin4 as output, value is 1.

If #undef CFG_EXT_SLEEP , output always high.
if #define CFG_EXT_SLEEP , ouput become low

How to keep the output when system enter Extend Sleep?

JE_Dialog
Offline
Last seen:21 hours 28 min ago
Staff
加入:2013-12-05 14:02
Hello ZhiGang,

Hello ZhiGang,

Can you clarify the question ? are you saying that hwen you enter extended sleep mode, the I/O state of the GPIO port 0 is not retaining its state ?

All the GPIOs have retention state so will keep their state during extended sleep. (As input each GPIO can be used as input to the wake-up counter in extended sleep.)

BR JE_Dialog

ZhiGang
Offline
Last seen:5 years 9 months ago
加入:2014-12-04 09:56
I find that set_pad_functions

I find that set_pad_functions() will called every time system wakeup, In this function I set I/O output LOW. but Some I/O will set to HIGH in working. So when system wakeup, It's become LOW.

MHv_Dialog
Offline
Last seen:1 week 4 days ago
Staff
加入:2013-12-06 15:10
Hi

Hi

The periph_init function in periph_setup.c is called every time you wake up from sleep. This function calls the setpad function which always sets the level unconditionally - just as you stated.

You should remove the statement

GPIO_ConfigurePin( GPIO_PORT_1, GPIO_PIN_1, INPUT_PULLUP, PID_GPIO, false );

从set_pad_functions()的乐趣ction.

In the function app_set_dev_config_complete_func(), set your default or start-up value using the GPIO_ConfigurePin:

GPIO_ConfigurePin( GPIO_PORT_1, GPIO_PIN_1, INPUT_PULLUP, PID_GPIO, false ); // false sets the pin low

Then in your application, instead of setting the pin with the GPIO_SetInactive() or GPIO_SetActive(), use the GPIO_ConfigurePin() function - use false to set the pin low, use true to keep it high. This will ensure that the pin is correctly configured and remains latched during sleepmode.

SEM
Offline
Last seen:4 years 5 months ago
加入:2014-12-03 09:11
Hi MHv_dialog,

Hi MHv_dialog,
I configured GPIO pin like the description in your last statement. When I undef the flag CFG_EXT_SLEEP, it works fine, but otherwise CFG_EXT_SLEEP is defined and I wake up from sleep, the pin is low. Is it necessary to set the port retention separate?

BR SEM

SEM
Offline
Last seen:4 years 5 months ago
加入:2014-12-03 09:11
Hi MHv_Dialog,

Hi MHv_Dialog,

do you have any news for me???

BR SEM