This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Intterupt not working...

Hi,

I'm using a timer and external interrupt to detect the pulse, i can set the timer to run for 5 secs and loop back. But the program cannot vector to the external interrupt. This is my interrupt configurations and routine.

;********************************************
;-----------INTERRUPTS CONFIGURATIONS--------
;********************************************
MOV IE,#8CH
MOV SWCINT,#000H
MOV EIE1,#000H
MOV EIE2,#000H
MOV EIP1,#000H
MOV EIP2,#000H
MOV IP,#08H

;****************************
;-Timer 1 Overflow Interrupt-
;****************************
T1_INT:    CLR TF1        ; Clear overflow flag
          MOV TH1,#0D0H
          MOV TL1,#0A0H
          RETI

;**********************
;-External Interrupt 1-
;**********************
EX_INT:    INC 40H         ; Increment 40H
          RETI

Does the input to the external interrupt need to be digital? Any advice would be nice... Thanks in advance.

Parents
  • I know what you are talking about. I can start the timer at the 1st peak, but i do not know how to stop the timer at the 2nd peak. Also the value in TH1 and TL1 are 8-bit each. How do i combine them together when the timer stops?

    Let me think... hmm...
    Lets say i configured the timer in auto-reload mode and the external interrupt to detect falling edges already...

    External_INT: SETB TR1
    

    Like this i can only start the timer. I have no idea how to stop the timer. Any suggestions?

Reply
  • I know what you are talking about. I can start the timer at the 1st peak, but i do not know how to stop the timer at the 2nd peak. Also the value in TH1 and TL1 are 8-bit each. How do i combine them together when the timer stops?

    Let me think... hmm...
    Lets say i configured the timer in auto-reload mode and the external interrupt to detect falling edges already...

    External_INT: SETB TR1
    

    Like this i can only start the timer. I have no idea how to stop the timer. Any suggestions?

Children
No data