Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/16/04 09:55
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#77483 - RE: just a thought
Responding to: ???'s previous message
hi,

I have initialized all unused interrupts in the following way:
void int_0 (void) interrupt 0 using 0{}


It is not enough. Let assume that due a malfunction, it happens that external interrupt 0 is enabled (EX0=1). Because reset value of TCON register is 0x00 so this interrupt is level activated (IT0=0). As result if the pin INT0 comes to low level (either by external source or just because you reset it somehow in program) then external interrupt 0 appears. What is the result? External interrupt 0 routine will be called. As it is empty so program leaves it but corresponded flag keeps set (IE0=1). So program does one step of main stream and comes back to the ISR. Then it leaves it, does next step, goes to ISR again etc. Well, it may result that program goes execute slowly but it does not hang ups (as long as you do not use watchdog timer correctly).
What does happen if another interrupts come? Well, UART interrupt will be still executed because it has high priority. But ISR of timer 0 will not be called anymore. It is because internal polling sequence detects and processes interrupt of INT0 early than of timer 0.

My suggestions:
1. implement a flag which may be controled externally if some non-allowed interrupt occures. For example, set a pin at startup time, and clear it inside all ISRs which are not allowed. Then just look at the level of the pin to check if malfunction happens (LED connected to the pin, may helps here).
2. Re-init (disable) any non-allowed interrupt inside its ISR. With this way even an interrupt comes it will be disabled immediately and so interrupt system recovers itself.
3. Check your program for any TCON and TMOD manipulations. It may happen that you change values of bits like TR0, GATE0, C/T0 accidentally.
4. Check stack ammount. It may be that your stack is not ballanced and increased or decreased step by step till something wrong happens.
5. Read MCU errata. As you use secure microcontroller so it is not possible for me to look at its documentation due Law. But I hope you have it.

Regards,
Oleg

List of 43 messages in thread
TopicAuthorDate
Priority interrupt problem with DS5240            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS5240            01/01/70 00:00      
         RE: Priority interrupt problem with DS5240            01/01/70 00:00      
            RE: Priority interrupt problem with DS5240            01/01/70 00:00      
            RE: Priority interrupt problem with DS5240            01/01/70 00:00      
   just a thought            01/01/70 00:00      
      RE: just a thought            01/01/70 00:00      
         RE: just a thought            01/01/70 00:00      
            RE: just a thought            01/01/70 00:00      
               RE: just a thought            01/01/70 00:00      
                  RE: just a thought            01/01/70 00:00      
                     RE: just a thought            01/01/70 00:00      
                        RE: just a thought            01/01/70 00:00      
                           RE: just a thought            01/01/70 00:00      
                  RE: just a thought            01/01/70 00:00      
   Avoid USING !            01/01/70 00:00      
      RE: Avoid USING !            01/01/70 00:00      
         caught it myseld            01/01/70 00:00      
      RE: Avoid USING !            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS52            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      Get rid of USING            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      use using ???            01/01/70 00:00      
   Resolved?            01/01/70 00:00      
   My USING experience            01/01/70 00:00      
      RE: My USING experience            01/01/70 00:00      
         Resolved ? ... I don\'t know            01/01/70 00:00      
   !! PROBLEM SOLVED!!!!            01/01/70 00:00      
      Which compiler?            01/01/70 00:00      
         RE: Which compiler?            01/01/70 00:00      
      RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
         RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
            RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
      RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
         RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
            RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS5240            01/01/70 00:00      
         RE: Priority interrupt problem with DS5240            01/01/70 00:00      

Back to Subject List