2006-05-08 10:34 PM
Hardware Interrupt TLI - behaving Erratic
2006-05-08 04:28 AM
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 & Amit2006-05-08 10:34 PM
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)