1 Reply Latest reply on Jun 8, 2020 6:38 PM by NoriakiT_91

    How to set WDT and TIMER0/1/2 priority

    JiLi_1045506

      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.

       

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

       

      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.

        • 1. Re: How to set WDT and TIMER0/1/2 priority
          NoriakiT_91

          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