We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We have run into a problem in an old well functioning program. The arbitaration between two interrups seem not to work.
The two interrupts are the ASC0RxInterrupt and the T2_interrupt. Previously the T2_interrupt, used as a timer interrupt (10ms), had a very short service rutine but we had to increase it so it may take up too 500us. Now the ASC0RxInterrupt sometimes get hanged up and recieved chars are loosed. The ASC0RxInterrupt have higer interrupt level and should break the T2_interrupt but it does not always succeed. If we for instance make a while(1) in the T2_interrupt rutine we can see that the ASC0RxInterrupt works perfectly. So it definitly have a higer interrupt level. By toggling output pins we can study on an oscilloscope exactly whats happens. It looks like if a ASC0RxInterrupt occurs very close to a T2_interrupt the T2_interrupt will run until it is finnished and not until then the control is handled over to the ASC0RxInterrup. Since the RX0 is running on 9600 Baud a char is then lost.
Does anyone have any suggestion on what to do or try. We can find no sollution in the manuals?
If I remember correctly, clearing IEN on C16x/ST10 to disable interrupts globally could occasionally lead to interrupt handlers being executed with interrupts disabled. This means no higher level interrupts. See here: http://www.keil.com/support/man/docs/c166/c166_xf_interrupts.htm Could this be it?
At first we thought this could be the issue. But we have now reduced the code to simple dummy functions and no interrupts are ever disabled (uP used is a XC161CJ). Still I have a lower priority interrupt that when occuring just before a higher prioriated one won't leave control to the higer prioritated. If the lower prioritated interrupt has run for a while it can be interrupted as expected.
Can I ask two questions?
1) Are you using local register banks (see errata INT_X.009)?
2) What is the interrupt level and group priority for the two interrupts? They can't have the same ILVL level.