We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
I see... So instead of incrementing a variable until the 2nd pulse, i should increment until the 3-4 pulse?
Correct! No existing (real) heart beat monitor measures the pulse using a single heart beat interval.
I see... Thanks..
natur3
That would be one way to do it, but it would result in a very slow update rate, which might prove very irritating to the user of the device.
Instead, you can measure the beat-to-beat frequency, but output an average value of the last X measurements (the larger X, the smoother the output).
What do u mean by "output an average value of the last X measurements"? What is X measurements?
What is X measurements?
X is a positive number which is larger than 1.
So if X is 4, you take four beat-to-beat measurements and average them.
"4 beat-to-beat measurements"
You mean like from one pulse to 1 pulse, that is considerd one beat-to-beat? If i take 4 beat-to-beat, won't that a very long time?
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