PSOC 4200BLE WDT LONG DEEP SLEEP

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

cross mob
AnCo_2736831
Level 4
Level 4
25 likes received 10 likes received 10 likes given

Hi All,

I used the program below for PSoC Device 4200M:

PSOC 4200M WDT LONG DEEP SLEEP

PSoC 4200M WDT Long Deep Sleep

However, I want to use this program for PSoC Device 4200BLE. When I connect my BLE device to this program, instead of getting less than 1 mA when it goes to DeepSleep, I get around 5 mA.

Does this program, which I downloaded directly from the github link, work for 4200BLE, or do I need to make any modifications in order for it to work for my BLE Device. The github link is below:

GitHub - iotexpert/PSoC4-WDTExamples

Thanks,

Andrew Collins

0 Likes
1 Solution
Anonymous
Not applicable

Hi Andrew,

You do realize that the Red LED draws current? The 5 mA when the Red LED turns on would be expected; And the extra 5 mA is probably a misconfiguration of the deepsleep mode for the BLE peripheral.

If you go back to the basic example project with the WDT waking up the unit, and remove the RED LED from the project (comment it out/disable it), then you will get the least power consumption. But the BLE module will add current draw, and the red LED will add current draw (LEDs range from 2-20 mA for current draw depending on variables)

If you download and test the current on the example projects on the app-note page for the AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications​, then you should see very low power consumption. These examples implement the power saving points that I mentioned. (It doesn't include the Red LED, but the current would be a simple addition to the power draw of the unit when it is on)

Implementing the WDT and red LED into the example BLE Low Power project would be easier than the other way around.

Let me know if you are still unable to get it working/tested

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

I've gotten the CYBLE-022001-00 working with uAs of deep sleep current. You will need to make sure peripherals and debugging mode are disabled for the full power saving to drop below mA of current.

You will need to change the device selector in PSoC Creator to compile for the different chip, but otherwise all of the WDT and Deep Sleep code should be compatible between the different chips.

(The debug select is under the System declaration)

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Pratt,

When I tried disabling the peripherals, I found out that it will only be fully disabled in hibernation mode. I tried this but the LED would not blink anymore (it would just stay on), so I thought it would not work.

I have attached below three pictures of the program with the clock information that I have.

For the low frequency clocks, the power mode for WCO was shaded out in the tutorial while mine is able to change from low power to high power.

For the high frequency clocks, the tutorial never stated anything so it must be irrelevant, but I put everything on the lowest settings possible and disabled whatever I could.

Is there anything wrong with the clock configurations?

Thanks,

Andrew

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Andrew,

Any peripherals and settings that are disabled/turned-off in hibernate power mode can also be set when entering deep sleep mode; It is merely a matter of "flipping the right switches".

This guide on low power should help: AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications

It lists alot of tricks and settings for the PSoC that can be employed to minimize current and power usage throughout the entire program.

The important part is the function for entering low power mode, as it configures the chip to use the same clock for everything and turns off unused clocks.

It sets the chip to use the ECO to run the CPU, and disables the IMO to save power while in deep sleep:

Here's the code I use for power saving (should be similar to the AN above):

        CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);

        blessState = CyBle_GetBleSsState();

        if((blessState == CYBLE_BLESS_STATE_ECO_ON ||

        blessState == CYBLE_BLESS_STATE_DEEPSLEEP)) {

            CySysPmDeepSleep();

        } else if(blessState != CYBLE_BLESS_STATE_EVENT_CLOSE) {

            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_ECO);

            CySysClkImoStop();

            CySysPmSleep();

            CySysClkImoStart();

            CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_IMO);

        }

      CyBle_ExitLPM();

You will need the ECO running in order to use the BLE peripheral, and thus why I set up my own projects to utilize the ECO for the CPU while in deep sleep mode.

Your clock configurations look fine in the pictures you linked; Although for low power, you will want to get as many of the clocks disabled as possible (Ideally, it would go down to ILO as that uses the least power, but the BLE module requires the ECO or WCO to have accurate timing).

Also, make sure to set the Debug Select to GPIO to save power (This will remove the debugger configuration, but will give accurate power savings due to the debugger circuitry using alot more power)

0 Likes

Hi Pratt,

When I integrated the chunks of code into the program, and also switched the debug settings to GPIO, all it did was increase the amount of mA it took. Now it was 5mA when the LED was off, and 10mA when it was on. I tried reducing the IMO frequency to 3MHz from 48MHz, the LED would not even turn on.

Is there any other way to fix this problem?

0 Likes
Anonymous
Not applicable

Hi Andrew,

You do realize that the Red LED draws current? The 5 mA when the Red LED turns on would be expected; And the extra 5 mA is probably a misconfiguration of the deepsleep mode for the BLE peripheral.

If you go back to the basic example project with the WDT waking up the unit, and remove the RED LED from the project (comment it out/disable it), then you will get the least power consumption. But the BLE module will add current draw, and the red LED will add current draw (LEDs range from 2-20 mA for current draw depending on variables)

If you download and test the current on the example projects on the app-note page for the AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications​, then you should see very low power consumption. These examples implement the power saving points that I mentioned. (It doesn't include the Red LED, but the current would be a simple addition to the power draw of the unit when it is on)

Implementing the WDT and red LED into the example BLE Low Power project would be easier than the other way around.

Let me know if you are still unable to get it working/tested

0 Likes