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.
The concept is called a running average.
You use the time between beat 5 and 1 (4 periods) to emit a bmp.
Then you use the time between beat 6 and 2 (4 periods) to emit a bmp.
Then you use the time between beat 7 and 3 (4 periods) to emit a bmp.
The first output will not be available until after you have detected 5 heart beats. Then, the display may update for every new heart beat detected.
However, since a normal person at the best has a rest pulse just under 30 and normally in the 50-70 bpm, you can ignore the concept of a running average.
If you take the time between 5 beats, a pulse of 28 bmp would give the first result after 9-11 seconds and then a new value every 9 seconds.
With a more normal pulse of 60, the first value would be available afer 4-5 seconds, with a new update every 4 seconds.
A young person at very hard load would with a pulse of 200 get a first value after 1.2-1.5 seconds, and a new update every 1.2 seconds.
I see... Many thanks for your all help...
Regards, natur3