Question about the heart sensor

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RoFr_4201436
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello everyone,

I have a question regarding the heart sensor. I saw this topic on the internet:

https://community.cypress.com/t5/PSoC-4-MCU/Heart-Rate-Monitor-Sensor-interface-with-Psoc-4/m-p/6387...

I took thist project:

RoFr_4201436_1-1617350473275.png

 

and saw the following code:

RoFr_4201436_0-1617350444953.png

  1. First, I didn't understand what this interruption does.
  2. Second, in the part "bpm = 60000 / beat;", I understood that it would be how many pulses he gave 60000 milliseconds divided by the amount of pulses he gave in that time, however in the part "beat = ADC_GetResult16 (0);" does it take the amount of pulses in 60000 milliseconds? I didn't get it right.
0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

RoFr,

The interrupt is attached to the ADC.  When the ADC completes a conversion, then the interrupt gets executed.

In the interrupt, the source of the interrupt is cleared and a flag (n=1) gets sent to the main() task to signal the ADC needs processing.

About 2.:  Not sure.  The ADC reads the instantaneous voltage of the sensor through a low-pass filter and then a Difference amp configuration(?).   One would think you'd want the number of beats in 60000ms (60 seconds).

Maybe you should ask the author of the project.

 

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply