You are here

Watchdog reset | Cypress Semiconductor

Watchdog reset

Summary: 5 Replies, Latest post by TheThinker on 19 Sep 2013 01:13 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
arenosoft's picture
6 posts


How do i know if Reset is from watchdog, i need to debug my device



uday's picture
Cypress Employee
569 posts

The Watch Dog Timer can be enabled and started using the API, void CyWdtStart(uint8 ticks, uint8 lpMode), where, the parameter ticks can take the values,

  • 0 CYWDT_2_TICKS                                             2 CTW Ticks
  • 1 CYWDT_16_TICKS                                          16 CTW Ticks
  • 2 CYWDT_128_TICKS                                        128 CTW Ticks
  • 3 CYWDT_1024_TICKS                                      1024 CTW Ticks

Note that the lpMode parameter configures the "Low power mode configuration". It does not work on PSoC5 ES1 silicon.

Once the Watch Dog Timer is enabled, the watch dog timer needs to be cleared before it times out and resets the device. The same can be done using, CyWdtClear() API.

You can refer the system reference guide document to see explanations for the same APIs. It can be accessed from PSoC Creator under, Help --> Documentation --> System Reference Guide.





BMAH's picture
Cypress Employee
189 posts


Attached is a simple project that implements watch dog functionality in PSoC 5LP. We need not place any components on our schematic for this. This can actually be done in firmware using two APIs:
1. CyWdtStart()
2. CyWdtClear()
The details on these APIs can be obtained from the System Reference Guide.

 In this project first we enable the watch dog for a Time Period of 2.048 – 3.072 s. Now we need to make sure that the Watchdog is cleared before this time. If not, the device would get reset.

The attached project has been tested in our CY8CKIT-050 PSoC 5LP Development Kit. Toggle_Led would indicate that the device would get Reset and Toggle_Led_1 indicates that the device would not get Reset.

To test this project, first program this and we can see Toggle_Led blinking initially. Now suppose you do not press the switch ( which in turn would clear the Watchdog)in 3 seconds, you can again see Toggle_Led blinking indicating that the device got reset. On the other hand, in every 3 second if you press the switch, you can see Toggle_Led_1 blinking indicating that the device is not getting reset as pressing the switch would clear the Watchdog.

Hope this project helps!

Stub for 327900356's picture
1 post

Question was 2 1/2 years old. Probably already answered?


user_14586677's picture
7646 posts

Bob, to be a little more precise -


date difference:
2 years 5 months 5 days
or 29 months 5 days
or 127 weeks 0 days
or 889 days


Then of course we could correct for Femto Sec, or the planck length and

speed of light, and the beat goes on.


Regards, Dana.

TheThinker's picture
37 posts

Considered Daylight savings?


Log in to post new comments.