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
  • Doesn't the data sheet have a suggestion how you stop the timer or alternatively just reads out the timer count?

    If you are going to develop the program in assembler, then you must figure out a way to either manage with an 8-bit timing value - or how to combine a high and low byte into a 16-bit number. Further, you must figure out how you convert a period time to a frequency (f = 1/T). This would be trivial in C.

Reply
  • Doesn't the data sheet have a suggestion how you stop the timer or alternatively just reads out the timer count?

    If you are going to develop the program in assembler, then you must figure out a way to either manage with an 8-bit timing value - or how to combine a high and low byte into a 16-bit number. Further, you must figure out how you convert a period time to a frequency (f = 1/T). This would be trivial in C.

Children