cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

luca_3497456
New Contributor

Hi Everyone,

I am using the CY8C4248-LQI-BL583 PSOC BLE module. I am using the WDT at every second. I have a LED light on and off every second of the interrupt. However, when I use the RTC, that is in my code call RTC_Start(), the WDT interrupt is never called. However, when I don't use the RTC, the WDT works. If I wan the RTC and the WDT to work. In clock settings for my system I set the RTC_Sel to Timer 0 and the WDT to Timer 1. I have to use two seperate timers to have WDT and RTC to work. I just do not understand why my RTC and WDT cannot run with the same Timer?

Thank You!

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator

Hi lcamal_3497456​,

WDT has only one callback function for each of the counters. When you are trying to do automatic update of  RTC, the RTC_Update() is registered as the callback for WDT overwriting the previous one.

You can use the Implement RTC update manually check box in the RTC configurator and call the API in the WDT callback function. Thus you have only one WDT callback for both your custom callback code and RTC_Update().

Hope this helps!

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
6 Replies
BragadeeshV
Moderator
Moderator

Hi lcamal_3497456​,

Can you please attach your project file focusing on the issue so that it will be easier for us to debug.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
luca_3497456
New Contributor

I have attached the program I am running. You will see that the WDT is never invoked unless you comment out RTC_1_Start().

0 Likes
BragadeeshV
Moderator
Moderator

Hi lcamal_3497456​,

WDT has only one callback function for each of the counters. When you are trying to do automatic update of  RTC, the RTC_Update() is registered as the callback for WDT overwriting the previous one.

You can use the Implement RTC update manually check box in the RTC configurator and call the API in the WDT callback function. Thus you have only one WDT callback for both your custom callback code and RTC_Update().

Hope this helps!

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
luca_3497456
New Contributor

Hi BragadeeshV_41​,

What are the benefits of using one WDT verses another? Correct me if I'm wrong, would there be a benefit in power consumption using only one verses two? Also, is using a WDT for the real time clock sufficient to wake up the CPU from deep sleep? I think so, I will try it and comment.

0 Likes
luca_3497456
New Contributor

Using the RTC and a single WDT set to RTC_Sel in the low frequency clocks automatically wakes up the system from deep sleep.

0 Likes
BragadeeshV
Moderator
Moderator

Hi lcamal_3497456​,

Yes, you are right. Using two timer blocks of WDT will consume more power when compared to one. The lesser the no of CPU resources, the lesser will be the power consumption.

I hope you have answered your second part of the question by yourself. Yes, this is possible.

Please let us know if all your issues are resolved. Happy to help

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes