cancel
Showing results for 
Search instead for 
Did you mean: 

Counting heart rate over a period of time

llmg343
Associate II
Posted on December 03, 2015 at 13:04

Hi all,

I am doing a project to count heart rates. My heart rate device gives a digital output, which I plan to feed into PC2 pin of my STM32f1. My problem though, is calculating the heart rate using this digital input. Here is what I need to do:

1. I need to create a 5 second time period, in which the input is counted when high.

2. I need to then multiply the count with 12 after this 5 second time period to display on the LCD.

3. I will need the 5 second time period to start again, once it finishes.

I do know I have to use timers and interrupts to do this, but unfortunately I am using the STM32 for the first time. If someone could help me with a sample code, I would be obliged. Thank in advance.
1 REPLY 1
Posted on December 03, 2015 at 13:24

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Conting%20pulses%20over%20a%20certain%20time%20period&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=27]Other thread

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..