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
  • Another thing. When measuring the pulse, you do not want to count # of heart beats in a fixed time interval. You want to measure the time between a fixed number of heart beats.

    If you measure for 5 seconds, the start of the measurement period can start directly after a heart beat, but it can just as well start just before a heart beat.

    In the same way, the 5 seconds can end just before or just after a heart beat.

    This gives an error of +/- 1 heart beat during your 5 seconds, or a pulse error of +/- 12 bpm. Not too impressive, I would think.

    This is the reason why a doctor who manually checks the pulse have to use a long time interval. You, on the other hand, have a high-quality clock available and can measure the exact number of milliseconds for a specific number of beat intervals.

    But that requires you to start (or reset) the timer at a heart beat, and to stop (or read out) the timer after n more heart beats have been received.

Reply
  • Another thing. When measuring the pulse, you do not want to count # of heart beats in a fixed time interval. You want to measure the time between a fixed number of heart beats.

    If you measure for 5 seconds, the start of the measurement period can start directly after a heart beat, but it can just as well start just before a heart beat.

    In the same way, the 5 seconds can end just before or just after a heart beat.

    This gives an error of +/- 1 heart beat during your 5 seconds, or a pulse error of +/- 12 bpm. Not too impressive, I would think.

    This is the reason why a doctor who manually checks the pulse have to use a long time interval. You, on the other hand, have a high-quality clock available and can measure the exact number of milliseconds for a specific number of beat intervals.

    But that requires you to start (or reset) the timer at a heart beat, and to stop (or read out) the timer after n more heart beats have been received.

Children
  • 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?