cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

RoFr_4201436
New Contributor II

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 Reply
Len_CONSULTRON
Honored Contributor II

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."
0 Likes