Interrupt priorities

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

Interrupt priorities

#1 Post by pwdixon » 25 Sep 2019 11:22

I'm using a PIC32MX795512L in two slightly different situations and getting reliable interrupt activity.

Situation1
Using a timer to produce a fixed output frequency by toggling an output in a timer interrupt.
I have other lower priority interrupts running as well as the highest priority timer.
I get random jitter (pulse edges delayed by perhaps 300us) in the output frequency (680Hz) which i believe is down to the timer interrupt being delayed by another interrupt ie. I don't think the higher priority interrupt is prempting the lower priority interrupt.
example of timer output jitter
example of timer output jitter
Bottom trace is timer generated.PNG (10.66 KiB) Viewed 1954 times
Situation2
Using a second PIC to detect the first PIC output pulse train (generated above) using an alternately triggered external interrupt to generate an output.
I have other lower priority interrupts running as well as the highest priority external interrupt.
I get random delays on the output that sometimes completely miss a whole pulse cycle (ie a delay of more than 700us).
Again I don't think the higher priority interrupt is prempting the lower priority interrupt.
Top trace is external interrupt jitter based on lower trace input
Top trace is external interrupt jitter based on lower trace input
Top trace is external interrupt generated.PNG (11.15 KiB) Viewed 1954 times
Do anyone know if interrupt priorities are actually working on this chip with this compiler?

Any suggestions what I could be doing wrong if the answer to the question above is positive?

pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

Re: Interrupt priorities

#2 Post by pwdixon » 25 Sep 2019 11:54

Post subject: Stuck in Single vector interrupt

appears to be about the same subject, was this ever fixed?

I'm trying the suggested fix from that post

pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

Re: Interrupt priorities

#3 Post by pwdixon » 25 Sep 2019 12:23

I have tried this suggestion and in both situations it appears to fix the issue, I'm not particularly happy about it as it looks like a bodge and I have a horrible feeling it will bite me later with some knock-on effect on some other code.

Still interested what ME have to say about it as this looks like a 2 year old problem that they don't seem to have fixed.

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Interrupt priorities

#4 Post by p.erasmus » 04 Nov 2019 18:03

:D
This problem is more than 4 years old
still the same old mikro some things never get fixed and device support stay behind the times
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

prakob
Posts: 187
Joined: 24 Nov 2012 07:05
Location: Thailand

Re: Interrupt priorities

#5 Post by prakob » 22 Nov 2019 06:00

Hi all

Did you try to enable Multi-vector Interrupt like
INTCONbits.MVEC =1;

Kind regards

praokb

pwdixon
Posts: 1431
Joined: 13 Apr 2005 11:14
Location: UK

Re: Interrupt priorities

#6 Post by pwdixon » 22 Nov 2019 08:53

I would have assumed that setting multivector in the project setup would do that for me automatically, I need to check if that is actually whats not working.

Post Reply

Return to “mikroC PRO for PIC32 General”