cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Interrupt TLI - behaving Erratic

y_gudekar
Associate II
Posted on May 09, 2006 at 07:34

Hardware Interrupt TLI - behaving Erratic

2 REPLIES 2
y_gudekar
Associate II
Posted on May 08, 2006 at 13:28

We are using ST72F561T6AR9, STVD7 evironment & COSMIC compiler.

memory model selected => short stack.

We need to use 3 Interrupts,

1. Timer16 - output compare,

2. SCI1 - Serial Receive Transmit

3. TLI - hardware interrupt

We have kept the natural proirities of the interrupts intact & Enabled them all.

For debugging we are toggling port pins in all ISRs & main routine.

I. We observed that if the TLI interrupt occurs when the execution is in main, the program works perfectly.

II. But, if it occurs when execution is in Timer16 ISR, The programs behaves Erratically. Execution never comes back to main function.

We can say this as we observed that the port pin getting toggled in the main routine, stopped toggling. & the level at which it freezed was random, indicating that held the level it had, when the timer ISR started.

III. Even if the execution never returned in main, all the ISRs were working properly. & they we getting executed whenever the corresponding interrupt was generated.

IV. To overcome this Problem we started disabling the TLI interrupt temporarily inside the Timer16 & SCI1 ISRs. This step made the problem very less frequent but was not the solution.

Q1. Is this a problem related to interrupt handler of ST7 chip?

Q2. Is the memory model ''short stack'' causing any trouble?

Regards,

Yogesh & Amit

luca239955_st
Associate III
Posted on May 09, 2006 at 07:34

From the compiler point of view,

Quote:

Q2. Is the memory model ''short stack'' causing any trouble?

this memory model is well suited to work with interrupts; just make sure, if your interrupt routines are working with long o floats (or are calling functions that do that), that you manally (pragma) save the extra registers associated with these variables.

Regards,

Luca (Cosmic)