- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am working with Psoc4 Ble pioneer kit.
i want to generate a WDT based interrupt after every hour. so to do that i have i have used global signal component.
this is my code
CY_ISR(WDT_ISR_handler)
{
WDT_ISR_ClearPending();
}
int main(void)
{
HW_Init();
/* Starts RTC component */
RTC_Start();
/* Set RTC time update period */
RTC_SetPeriod(1u, SYSTICK_EACH_1_HZ);
RTC_ClearAlarmStatus() ;
RTC_SetAlarmHandler( alarm_handler ) ;
RTC_SetAlarmMask( RTC_ALARM_SEC_MASK ) ;
WDT_ISR_StartEx(WDT_ISR_handler);
for(;;)
{
}
}
please find attached screen shots for WDT2 clock configuration.(currently i am testing it with only 4 seconds)
so my problem is first time interrupt is generated after 4 seconds but then it could not clear and the pending register or something.
please guide me.
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Tags:
- psoc 4
- watchdog timer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
i have solved the problem.
this is my code.
CY_ISR(WDT_ISR_handler)
{
CySysWdtClearInterrupt(CY_SYS_WDT_COUNTER2_INT);
}
int main(void)
{
HW_Init();
/* Starts RTC component */
RTC_Start();
/* Set RTC time update period */
RTC_SetPeriod(1u, SYSTICK_EACH_1_HZ);
RTC_ClearAlarmStatus() ;
RTC_SetAlarmHandler( alarm_handler ) ;
RTC_SetAlarmMask( RTC_ALARM_SEC_MASK ) ;
/* Enable WDT0 counter */
CySysWdtEnable(CY_SYS_WDT_COUNTER2_MASK); // WDT=PeriodicTimer
WDT_ISR_StartEx(WDT_ISR_handler); // Start ISR for pin toggle
CySysWdtEnable(CY_SYS_WDT_COUNTER2);
for(;;)
{
}
}
thanks for helping.
Mohit