cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Bluetooth

YoCh_2286961
New Contributor II

Hello Supporter,

When entering and then exiting from Deep Sleep Mode, P30 is read abnormally.

The conditions that occur are :

     Step 1. Exit from Deep Sleep by High value on P30.

     Step 2. Maintain Step1 for 2 ~ 3 seconds

     Step 3. Low Value On P30

     Step 4. Read the value of P30. --> The value is read as High instead of Low.

If use P37 instead of P30, it works normally.

I want to know why this is happening on the P30.

Below is a part of the code.

void mesh_app_init(wiced_bool_t is_provisioned)

{

     ........

     wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE, GPIO_PIN_OUTPUT_LOW );

     wiced_init_timer(&app_aaa_timer, &mesh_app_aaa_timer_callback, 0, WICED_MILLI_SECONDS_PERIODIC_TIMER);

     wiced_start_timer(&app_aaa_timer, 1000);

}

void mesh_app_aaa_timer_callback(uint32_t arg)

{

     WICED_BT_TRACE("*** AAA Value : %x\n",wiced_hal_gpio_get_pin_input_status(WICED_P30));

     if(wiced_hal_gpio_get_pin_input_status(WICED_P30) == 0)

     {

          wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE, GPIO_PIN_OUTPUT_LOW );

          wiced_hal_gpio_register_pin_for_interrupt( WICED_P30, aaa_interrrupt_handler, NULL );

          wiced_power_save_start( WICED_WAKE_SOURCE_ALL, 30000); //Deep Sleep Mode

     }

}

void aaa_interrrupt_handler(void *data, uint8_t port_pin)

{

     WICED_BT_TRACE("aaa_interrrupt_handlerPin:%d\n",port_pin);

     WICED_BT_TRACE("AAA Detect : %d\n",wiced_hal_gpio_get_pin_input_status(WICED_P30));

     // Clear interrupt

     wiced_hal_gpio_clear_pin_interrupt_status(WICED_P30);

}

Best regards,

YH Choi

0 Likes
Reply
1 Solution
YoCh_2286961
New Contributor II

It was solved after put GPIO_PULL_DOWN as below.

wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE | GPIO_PULL_DOWN, GPIO_PIN_OUTPUT_LOW );

However, in the following cases, the same phenomenon occurs.

(The circuit has an external pull-down resistor of 560K.)

wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE | GPIO_PULL_UP_DOWN_NONE, GPIO_PIN_OUTPUT_LOW );

I want to know why there are different results.

View solution in original post

0 Likes
Reply
5 Replies
WinstonF_61
Moderator
Moderator

Please clarify the below

Part No. CYW20706 or CWY20719?

WICED SDK Version:

Regards
Winston
0 Likes
Reply
YoCh_2286961
New Contributor II

Part No. : CYW20706(7)

WICED-SDK Version: Wiced_006.002.001.0002

0 Likes
Reply
YoCh_2286961
New Contributor II

I applied my code based on OnOffServer.

0 Likes
Reply
AbhishekK_31
Employee

By default P30 is configured for pull up (check file /20706-A2_Bluetooth/platforms/CYW920706WCDEVAL/wiced_hal_platform.h) as it is connected to a button which is active low. You can configure this pin for pull down with the wiced_hal_gpio_configure_pin API

YoCh_2286961
New Contributor II

It was solved after put GPIO_PULL_DOWN as below.

wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE | GPIO_PULL_DOWN, GPIO_PIN_OUTPUT_LOW );

However, in the following cases, the same phenomenon occurs.

(The circuit has an external pull-down resistor of 560K.)

wiced_hal_gpio_configure_pin( WICED_P30, GPIO_EN_INT_RISING_EDGE | GPIO_PULL_UP_DOWN_NONE, GPIO_PIN_OUTPUT_LOW );

I want to know why there are different results.

View solution in original post

0 Likes
Reply