Skip to main content
AndreasPA
Associate III
October 19, 2020
Question

PIT, multiple interrupts at different times

  • October 19, 2020
  • 1 reply
  • 881 views

Hello all.

I'm playing around with the PIT interrupts and im finding that after setting up 3 seperate timers with different interrupt rates with the same priority setup in the IRQ Component rla. It's only constantly interrupting the PIT with the lowest timer.

for example, in my case PIT 2 is the only one getting interrupted. is there an issue with multiple TIE being set ?

Setup:

0693W000004KBNRQA4.png/* PIT clock enabled. */

 SPCSetPeripheralClockMode(92, SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2));

 PIT.PITMCR.R   = 1;

//clk @ 48Mhz

//////////////////////////////////////////////////////////////////////////////

//PIT 1

 PIT.CH[1].LDVAL.R = 60000000;

 PIT.CH[1].CVAL.R = 60000000;

 PIT.CH[1].TFLG.R = 1;    

 PIT.CH[1].TCTRL.R = 3;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//PIT 2

 PIT.CH[2].LDVAL.R = 48000000;

PIT.CH[2].CVAL.R = 48000000; 

 PIT.CH[2].TFLG.R = 1;          

 PIT.CH[2].TCTRL.R = 3;      //////////////////////////////////////////////////////////////////////////////

// PIT 3

 //CAN_DELAY_GLOBAL

 PIT.CH[3].LDVAL.R = 58000000;

 PIT.CH[3].CVAL.R  = 58000000;

 PIT.CH[3].TFLG.R = 1;    

 PIT.CH[3].TCTRL.R = 3;    

    This topic has been closed for replies.

    1 reply

    Erwan YVIN
    ST Employee
    October 20, 2020

    Hello ,

    There is an example with 3 differents channels :

    SPC560Dxx_RLA PIT Test Application for Discovery

    Maybe you can check this configuration.

    Best regards

    Erwan

    AndreasPA
    AndreasPAAuthor
    Associate III
    October 21, 2020

    Hey Erwan,

    thanks for the advice, it works but i really wanted to know why at the same IRQ priority only one would toggle

    i had a look into the PIT functions and they all have the same IRQ priority of 12 so im not too sure as why mine isnt working.