Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4

pada_4804676
Level 1
Level 1

Hello,

We are attempting to drop the current of the CYBLE-212006-01 down to as low as possible. We are to the point where we just want to stop or hibernate the processor with nothing running just for concept.

attached are the schematic and archived project. Lines 106 through 121 are where our current concern lies. We just want to drop the current as low as possible, but even with a stop command cannot drop below 117uA.

We have reviewed the app note on low power applications, which has gotten us this far.

We are using a micro-amp meter connected in series with the supply of 3.3v to measure the power usage.

Any help would be appreciated.

Thank you

0 Likes
16 Replies
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

Could you please implement the below steps and see if the power consumption reduces?

1. Please refer to the recommendations for implementing the low power mode in section 2.5 Low-Power Implementation in the AN92584 (https://www.cypress.com/file/140991/download).

2. Please make sure that the debugging was disabled in the project to reduce current consumption. In Design Wide Resources Go to "system" view and change the "Debug Select" to GPIO.

3. Please put the GPIO pins to Analog High Z mode whenever pins are not used and can switch back to normal drive mode when pins are used. Please refer to the section 6.3 GPIOs in AN86233 (https://www.cypress.com/file/121271/download).

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

This is has not been resolved, we have studied your applications and tried to implement the low power mode, but each and every time we engage a low power mode other than STOP, (sleep, deepsleep) the system locks up and hits the reset vector.

We have to get the power down on this module and the example code is not functioning.  Again, we have read all the DS and applications notes, reviewed the BLESS code and the calls, but there is something wrong, please provide us with a webex meeting to help resolve this issue.

Note in the console it appears to do 2 deep sleep cycles, then one sleep cycle and it hits the reset vector, we cannot determine why?

> BLE Upgradable Stack Example Launcher

> Version: 1.20

> Compile Date and Time: Nov  6 2020 15:00:13

>BLE Upgradable Stack Example Stack

> Version: 1.20

> Compile Date and Time: Nov  6 2020 15:00:34

Stack project was updated.

Application is ready to be launched. Doing so.

> BLE Upgradable Stack Example Launcher

> Version: 1.20

> Compile Date and Time: Nov  6 2020 15:00:13

> LevelMax Main

> Version: 0.01

> Compile Date and Time: Nov  6 2020 15:16:31

Application project was updated. CCCD number has changed.

Erasing bounding data...

Starting WDT, status: 0

Performing battery test, status: 0

Starting battery test

Battery Level is: 0

Starting SPI, status: 0

Accell config, status: 0

Bluetooth On, StartAdvertisement with addr: 00a05017741b

CYBLE_EVT_ADVERTISING, state: 3

Entering Deep Sleep

Exiting Deep Sleep

Entering Deep Sleep

Exiting Deep Sleep

Entering Sleep

Exiting Sleep

/**************************************/

New bundle attached.

This request is time urgent please.

Herb

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

Sorry for the delay in our response. I checked the latest project you attached and observed the issue that you reported. I made some changes in main.c (Application project: LevelMax) of your project as a workaround to solve this issue. Modified file is attached with this project. Could you please repeat your testing using the attached file and see if there are any improvements?

We will discuss this issue internally with our product experts and get back to you with our comments as soon as possible.

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Sudeesh, please specify the changes you made to main.c, I do not see any?

Also, further testing indicates we cannot turn off the IMO, if it turned off in any way we loss the processor?

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

The changes are as below.

Line No 79: Commented "//CyGlobalIntDisable;"

Line No 114: lpMode = CyBle_EnterLPM(CYBLE_BLESS_SLEEP);

Line No 116: blessState = CyBle_GetBleSsState();

Line No 117: if(lpMode == CYBLE_BLESS_SLEEP)

Line No 123: Uncommented CySysPmSleep();

Line No 130: Commented "//CyGlobalIntEnable;"

I am not clear about your query about IMO. Could you please provide more details?

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

If we turn off the IMO in any way, the entire program stops, that makes no sense to us?

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Also, I had already replaced the enable/disable int with the enter/exit critical section calls, but that did not fix it.

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Update, we have made progress, but nowhere near the specified power numbers if 1.5uA average.  Archive attached.

We cannot switch to the ECO, switching HFCLK to the ECO in any way kills our program, that does not make sense?

We have tried setting to only ECO in the clock dialog and dynamically switching in code, as you will see.  With the only instructions commented out as the two outside ones, switching the clock to ECO and back to IMO, the project stops working, comment them again and works great, 5mA while connected and 600uA when disconnected, but why can't we turn off the IMO and run 100% from the ECO?

          if(blessState == CYBLE_BLESS_STATE_ECO_ON || blessState == CYBLE_BLESS_STATE_DEEPSLEEP)

            {

                //CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_ECO);

                //CySysClkImoStop();

               

                DBG_PRINTF("\r\n Entering deepsleep \r\n");

                CySysPmDeepSleep();

                DBG_PRINTF("\r\n Exiting deepsleep \r\n");

           

                //CySysClkImoStart();

                //CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_IMO);

            

            }

We have not started the WDT or the SPI.

Thanks for helping out.

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

In deepsleep power mode IMO and all high speed peripherals will be stopped after calling the API CySysPmDeepSleep(). So, it is not required to switch HFCLK from IMO to ECO before going to deepsleep.

pastedImage_1.png

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Thank you, we have read that chart many times, why are we drawing so much current?

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

Could you please test using the attached main.c file for LevelMax project?

Changes (main.c lines 144 to 196):

  1. Stopping UART and SPI blocks before calling CySysPmDeepSleep() API. Starting UART and SPI again after waking up from deep sleep.
  2. Setting drive mode of all GPIOs to Analog High Impedance mode before calling CySysPmDeepSleep() API. Drive modes are restored after waking up from deep sleep mode.

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Implemented that last night, did not have an impact.

Is utilizing the Sleep function for pins the same as setting to Analog HighZ?

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

It is recommended to set the drive mode of GPIOs to Analog HighZ to reduce power consumption during a low power mode.

Did you test after changing the GPIO drive mode to Analog HighZ?

Thanks and Regards,

Sudheesh

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

Doing that now, then what is the pinname_sleep(); function for?

0 Likes
HeGi_2497906
Level 5
100 replies posted 50 replies posted 25 replies posted
Level 5

All that was done, now we have a new issue, please explain why the stack code is as follows?

If the break is uncommented, the device enters and exits LPM one time and never returns?

Does the stack have to be restarted after each disconnect?   If so, where is that documented in the app notes?

If true, what else is not documented, I keep running into issues I cannot resolve.

    /**********************************************************

        *                       General Events

        ***********************************************************/

     case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:

         //AccelControl(OFF);

        //break;

     case CYBLE_EVT_STACK_ON: /* This event is received when the component is Started */

0 Likes
SudheeshK
Moderator
Moderator First question asked 750 replies posted 500 replies posted
Moderator

Hello,

Please see our comments below.

1. Please see the description for "_sleep" function from the GPIO component datasheet.

void Pin_Sleep(void)

Stores the pin configuration and prepares the pin for entering chip deep-sleep/hibernate modes. This function must be called for SIO and USBIO pins. It is not essential if using GPIO or GPIO_OVT pins.

2. As mentioned in the BLE component datasheet "The application layer is responsible for putting the BLE Sub-system and the micro-controller in to the desired sleep modes. Upon entering the requested sleep mode combination, the BLE Sub-system and the micro-controller are woken up by an interrupt every advertisement interval(in case of a GAP Peripheral) or connection interval (in case of GAP Central). "

After disconnection you have to restart the advertisement by calling "CyBle_GappStartAdvertisement()".

Could you please modify your code as below and see if the same issue happens?

/**********************************************************

*                       General Events

***********************************************************/

     case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:

         //AccelControl(OFF);

        apiResult = CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

        if (apiResult != CYBLE_ERROR_OK)

        {

            DBG_PRINTF("StartAdvertisement API Error: %d \r\n", apiResult);

        }

        break;

     case CYBLE_EVT_STACK_ON: /* This event is received when the component is Started */

Thanks and Regards,

Sudheesh

0 Likes