Simplest Way to Add 10 Hz ISR to PSOC4000S?

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

cross mob
lock attach
Attachments are accessible only for community members.
TeMa_1467596
Level 5
Level 5
5 sign-ins 5 likes given First like received

I have a project using a CY8C4024AZI-S403 device.  I have running code but wanted to create a simple timer ISR that can perform things like scan for key presses etc.

I've used a GlobalSignal before on a PSoC4 BLE so I added one called GlobalSignal_2 with an attached isr_1. In the configuration window, GlobalSignal_2 uses Watch Dog Timer Interrupt (WDTInt).

I then went into the LFClk setting and enabled the Timer (WDT) as a free running timer (see attachment), added code to main to start the isr - isr_1_start(); -and added code to the isr_1.c file as follows:

CY_ISR(isr_1_Interrupt)

{

    #ifdef isr_1_INTERRUPT_INTERRUPT_CALLBACK

        isr_1_Interrupt_InterruptCallback();

    #endif /* isr_1_INTERRUPT_INTERRUPT_CALLBACK */

    /*  Place your Interrupt code here. */

    /* `#START isr_1_Interrupt` */

        CySysWdtClearInterrupt();

        tedsCount++;

    /* `#END` */

}

It compiles and runs but doesn't seem to ever call the ISR as tedscount never increments.  If I change the Timer (WDT) to mode Watchdog (w/interrupt) my code seem to get stuck in a doom loop - not sure what's happening

Any ideas what's wrong?

0 Likes
1 Solution
Anonymous
Not applicable

Please refer to the code example CE210292 for example of how to use WDT in PSoC 4000S for interrupt generation.pastedImage_0.png

View solution in original post

0 Likes
2 Replies
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Does the WDT clock is enabled by default or you must start it on your main function? did you enabled it?

EDIT:

Just found this blog post about psoc4 and WDT, it might help you. PSoC4 Watch Dog Timer - IoT Expert

0 Likes
Anonymous
Not applicable

Please refer to the code example CE210292 for example of how to use WDT in PSoC 4000S for interrupt generation.pastedImage_0.png

0 Likes