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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/13/05 12:31
Read: times


 
#99331 - Interrupt question
Hello Forum,

In my project I am struggling with external interrupt 0. I am using AT89S8252 microcontroller, which is controlling a DC and AC motor. I want to use external interrupt 0 as emergency stop button. As in emergency stop, I want microcontroller to stop all operations in process and go back to start of program. As I switch on power to microcontroller, the code works fine and the external interrupt works fine as well. but as the program goes back to start and runs again , then the external interrupt does not work. Means external interrupt works only once after switching on power.In order to make it work again I have to siwtch off power and switch on again (which I understand resets the program) But why is that ?? I have read the tutorial and previous threads on website but could not figure out the solution. I am making the program to jump to start within interrupt routine, is this the problem?

Below is the code
Initialisation of Interrupt

START2:
MOV SP,#31H
MOV IE,#85H
CLR IT0


Interrupt Service Routine is as below

EXTERNAL_INTERRUPT:

      MOV P0,#0FFH
      MOV P1,#0FFH
      MOV P3,#4FH
      CALL CLEAR_LCD
      CALL EMERGENCY_STOP_TEXT
      
      LJMP MAIN
      
      RETI


All suggestions would be appreciated

Regards
James

List of 31 messages in thread
TopicAuthorDate
Interrupt question            01/01/70 00:00      
   Interrupt            01/01/70 00:00      
      then how?            01/01/70 00:00      
         One way is to            01/01/70 00:00      
            Little more description            01/01/70 00:00      
               Routine            01/01/70 00:00      
   interrupt exit            01/01/70 00:00      
      tried but gives error            01/01/70 00:00      
         assembler???            01/01/70 00:00      
            Assembler is Pinnacle            01/01/70 00:00      
               go to Pinnacle support            01/01/70 00:00      
               Asking for solutions            01/01/70 00:00      
      Now THAT was elegant!            01/01/70 00:00      
   use WDT to RESET the micro            01/01/70 00:00      
   some comments            01/01/70 00:00      
      Its like this            01/01/70 00:00      
         Emergency stop            01/01/70 00:00      
            I understand            01/01/70 00:00      
               If you REALLY want to do it            01/01/70 00:00      
                  optimizing            01/01/70 00:00      
                  possible troubles            01/01/70 00:00      
                     excellent point!            01/01/70 00:00      
                        This is not a solution            01/01/70 00:00      
                           Do it as you wish            01/01/70 00:00      
                              Makes sense            01/01/70 00:00      
                              the consensus last time was that the onl            01/01/70 00:00      
                                 WD reset - yes, why not            01/01/70 00:00      
                                    You say "no" and agree            01/01/70 00:00      
                                       no no = yes            01/01/70 00:00      
                                    Watchdog output            01/01/70 00:00      
                              Thanks, Done            01/01/70 00:00      

Back to Subject List