How to set WDT and TIMER0/1/2 priority

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

cross mob
JiLi_1045506
Level 1
Level 1

I would like to manually set the WDT0, WDT1 and WDT2 interrupt priority.  The API does not seem to have calls to be able to set priorities for these timers.

pastedImage_2.png

I am currently using two of the WDT timers.  Interrupts priorities are usually set in the Interrupt window, but they do not appear:

pastedImage_0.png

Code to turn on the timers:

  //set up lower power clocks

  CySysWdtSetInterruptCallback(CY_SYS_WDT_COUNTER0, Status_Handler); //timer0 goes off at 0.5 Hz, show status

  CySysWdtDisable(CY_SYS_WDT_COUNTER0_INT);

  CySysWdtDisableCounterIsr(CY_SYS_WDT_COUNTER0); //turn on only when status is requested

  CySysWdtSetInterruptCallback(CY_SYS_WDT_COUNTER2, Input_Handler); //this timer goes off at 32 Hz, does input processing

  CySysWdtEnableCounterIsr(CY_SYS_WDT_COUNTER2);

I cannot seem to find the API to set the priority.  Any hints?  I know about the Global Signal Reference block, but it seems like this block generates a new ISR that combines the interrupt of both WDT timers.  I would like to avoid this if possible.  I would like Status_Handler() and Input_Handler() to be called at a lower priority than 0, since another more critical block needs to run always (BLESS).

Any hints would be appreciated.  Thank you.

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please refer following interrupt sources table from "PSoC 41XX_BLE/42XX_BLE Family PSoC 4 BLE Architecture TRM, Document No. 001-92738"

GS004777.png

The WDT interrupts requests are assigned to the interrupt source IRQ8.  You can configure the interrupt number.  For example,

(void)CyIntSetVector(8u, &CySysWdtIsr);

CyIntEnable(8u);

These codes are contained in the auto generated file cyfitter_cfg.c

You can use a function "void CyIntSetPriority(uint8 number, uint8 priority)" to set the priority.

Regards,

Noriaki

View solution in original post

0 Likes
1 Reply
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please refer following interrupt sources table from "PSoC 41XX_BLE/42XX_BLE Family PSoC 4 BLE Architecture TRM, Document No. 001-92738"

GS004777.png

The WDT interrupts requests are assigned to the interrupt source IRQ8.  You can configure the interrupt number.  For example,

(void)CyIntSetVector(8u, &CySysWdtIsr);

CyIntEnable(8u);

These codes are contained in the auto generated file cyfitter_cfg.c

You can use a function "void CyIntSetPriority(uint8 number, uint8 priority)" to set the priority.

Regards,

Noriaki

0 Likes