cancel
Showing results for 
Search instead for 
Did you mean: 

PIT, multiple interrupts at different times

AndreasPA
Associate III

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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
2 REPLIES 2
Erwan YVIN
ST Employee

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

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.