Regarding Deepsleep causes lags in RTC datetime

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

cross mob
NeDh_4602711
Level 5
Level 5
5 solutions authored First solution authored 50 replies posted

Hello,

I am developing a wristband based on the CYBLE-022001-00 module and currently, I am displaying only date and time. but I am facing problems related to consumption. I am getting only 4 hours backup on 160mAh battery which is very less and not acceptable. So I have added deep sleep but the problem is that it shows the lag in watch date time for displaying DateTime I have used the RTC component and I am executing RTC_update() after every 1 second. As it is wristband it has to be a compact so I cannot add RTC circuit externally.

Also, I tried to calculate deep sleep time and add those seconds manually to RTC but it is not that accurate. Their remains a huge lag.

What is the solution to this problem.? If I am not giving any sleep then it gives back of only 4 hours and if I add sleep then there is lags in DateTime.

Thanks in advance

Regards,

Neeraj Dhekale

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

Hi Neeraj,

I have gone through RTC_P4_WDT_Example it working perfectly with no lag but@ found that it is consuming around 7 milliAmps.Currently, it is consuming 0.3 milliamps with our current firmware.

We recommend you to follow the firmware flow present in the RTC_P4_WDT_Example. To reduce power consumption of the project:

1. Please remove all the print statements from the code. Disable the UART.

2. Remove all the LEDs and LFCLK pin that drives the clock signal on the pin.

3. In the Systems Tab change the Debug select option to GPIO as shown in the image attached.

It is possible to keep the maximum time controller in deep sleep and wake up after say 30-60 seconds to update time by 30-60 seconds directly?

Yes. It is possible. For that, you need to call the API RTC_Update() once in 30-60 seconds. Before that you need to call RTC_SetPeriod() with the number of ticks/seconds you want to increment for every RTC_Update() function. Please go through the function description in the void RTC_Update(void) in RTC.c . You can see the usage of both of these APIs in the code example I pointed in the previous response.

For more information, please refer RTC component datasheet.

Kindly update if you have any other queries.

Thanks

Ganesh

View solution in original post

0 Likes
6 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello Neeraj,

Just for confirmation, when you disable the DeepSleep in your application, the project working fine without any lag. Correct?

Please give highest priority to WDT interrupt. Do not write any big code in the WDT ISR/callback. You can use flags inside the ISR and write your code in main firmware. Prefer manual mode of WDt than Auto-mode.

Are you using ILO or WCO to source the WDT? Please note that the tolerance for ILO is very high in case of PSoC devices. We recommend you to use WCO.

Have you gone through the code example RTC_P4_WDT_Example in PSoC Creator ? Please check if this code example is working correctly without any lag.

If possible, please attach your project and the procedure to test it. We will debug it at our side.

Thanks

Ganesh

0 Likes

Hello,

Yes, when I disable the deep sleep it is working fine with no lag.

I will check with WDT the highest priority.

Yes, I am using WCO.

I have gone through RTC_P4_WDT_Example it working perfectly with no lag but@ found that it is consuming around 7 milliAmps.Currently, it is consuming 0.3 milliamps with our current firmware. It is possible to keep the maximum time controller in deep sleep and wake up after say 30-60 seconds to update time by 30-60 seconds directly?

pastedImage_0.png

Thanks and regards,

Neeraj

0 Likes

Hi NeDh_4602711​,

Can you please share your project (or stripped down version) so that we can try to reproduce the issue at our end as well/?

Regards,

Bragadeesh

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

Please find the attached stripped version.

Regards,

Neeraj

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

Hi Neeraj,

I have gone through RTC_P4_WDT_Example it working perfectly with no lag but@ found that it is consuming around 7 milliAmps.Currently, it is consuming 0.3 milliamps with our current firmware.

We recommend you to follow the firmware flow present in the RTC_P4_WDT_Example. To reduce power consumption of the project:

1. Please remove all the print statements from the code. Disable the UART.

2. Remove all the LEDs and LFCLK pin that drives the clock signal on the pin.

3. In the Systems Tab change the Debug select option to GPIO as shown in the image attached.

It is possible to keep the maximum time controller in deep sleep and wake up after say 30-60 seconds to update time by 30-60 seconds directly?

Yes. It is possible. For that, you need to call the API RTC_Update() once in 30-60 seconds. Before that you need to call RTC_SetPeriod() with the number of ticks/seconds you want to increment for every RTC_Update() function. Please go through the function description in the void RTC_Update(void) in RTC.c . You can see the usage of both of these APIs in the code example I pointed in the previous response.

For more information, please refer RTC component datasheet.

Kindly update if you have any other queries.

Thanks

Ganesh

0 Likes

Hi Neeraj,

If you are still seeing lag in RTC functionality in Deep Sleep, please ensure that you have enabled High power setting for WCO in the Clocks tab as shown in the image below:

high power.PNG

We are curious to know about the accuracy that you are getting !!

Thanks

Ganesh

0 Likes