PSoC 4200DS Watchdog interrupt generation

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

cross mob
GaRo_3769926
Level 2
Level 2
First like given

Good morning.

I'm using the CY8C4045PVI-DS402 chip from the PSoC4200DS family. I'm trying to set a Watchdog interrupt in order to wake up my chip from deep sleep, and I've already succesfully understood the examples available for the 049 kit, which should be compatible. The thing is that, when going to set up the Watchdog interrupt in the Clocks menu, the "User provided" vs "Auto generated" window doesn't exist:

Watchdog_Interrupt.PNG<--- This doesn't exist!

What's more, the functions that I could use for the PSoC 4200 family don't exist for this chip! I can't use "CySysWdtSetMode" in order to tell the WDT to only interrupt instead of resetting. Apparently this all boils down to a definition in the CyLFClk.h and CyLFClk.c files, in which for this chip there is a variable called "CY_IP_SRSSV2" that isn't true. Upon googling a bit, I've found that SRSS stands for Systems Resource SubSystem, and apparently this chip has SRSSLT which stands for LiTe instead of the V2 version that basically every other PSoC 4 chip that I've stumbled upon uses.

Watchdog_Interrupt_3.PNG<--- This "CY_IP_SRSSV2" isn't true when compiling for this chip, so                                                                                                                                                          I 'm stuck with a greatly reduced set of functions that don't really help me.

My problem is that I can't get the Watchdog Timer to just interrupt instead of resetting. In the CyLFClk.c file I find references in functions that make me thiink the interrupt isn't being handled properly (the chip resetting after the 3rd non-serviced interrupt is mentioned), but I really can't find any documentation at all for the 4200DS family, let alone specifically the Watchdog.

Watchdog_Interrupt_2.PNG

Does anybody have any code example of a functioning non-resetting interrupt, or any information at all regarding 4200DS family + WDT? Or about the SRSSLT version and how to use it properly regarding the Watchdog?

Thank you very much in advance:

Gabriel

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Are you still looking for a solution?

This is my solution implementing Watchdog Interrupt on CY8CKIT-146

GS004454.pngGS004455.png

#include "project.h"

void wdt_Callback(void) {

    Pin_LED_Write(!Pin_LED_Read());

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    int_Wdt_StartEx(CySysWdtIsr);

    CySysWdtSetInterruptCallback(wdt_Callback);

    CySysWdtUnmaskInterrupt();

    for(;;)

    {

        /* Place your application code here. */

    }

}

CySysWdtIsr() is an interrupt service routine (ISR) defined in CyLFClk.c but never used.  You must connect the ISR to the WDT interrupt.

View solution in original post

3 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

The device you mentioned has only single WatchDog Timer. This WatchDog timer does not not have the provision to generate only interrupt without the Reset feature. In order not to generate reset by the Watch Dog Timer, you should manually clear the WDT interrupt in the WDT ISR.

I recommend you to use the reset feature because this is an extra feature that resets the device when the code is stuck in the firmware.

Thanks

Ganesh

0 Likes
lock attach
Attachments are accessible only for community members.
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Are you still looking for a solution?

This is my solution implementing Watchdog Interrupt on CY8CKIT-146

GS004454.pngGS004455.png

#include "project.h"

void wdt_Callback(void) {

    Pin_LED_Write(!Pin_LED_Read());

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    int_Wdt_StartEx(CySysWdtIsr);

    CySysWdtSetInterruptCallback(wdt_Callback);

    CySysWdtUnmaskInterrupt();

    for(;;)

    {

        /* Place your application code here. */

    }

}

CySysWdtIsr() is an interrupt service routine (ISR) defined in CyLFClk.c but never used.  You must connect the ISR to the WDT interrupt.

Thank you so much for your answer! I ended up circumventing the issue some way or another that I can't remember, basically avoiding watchdog at all, but your solution is simple and elegant.

Thank you very much

Gabriel

0 Likes