cancel
Showing results for 
Search instead for 
Did you mean: 

Counting pulses with STM32G474

HaraldAnt
Visitor

Hi,

 

In my STM32G474 project, I'm receiving a signal consisting of a burst of pulses, with a relatively long idle period before the next burst. I'm trying to setup a system where I use timers to count the pulses, and a slave timer to detect the idle period. How is the best way to do this?

In my setup I'm using TIM2 in ETR2 mode, and using this, I'm able to count the pulses coming in by setting regular counter mode. My plan was to setup TIM4 to count independently with a timeout of say 40mSec. This timer is then set to receive resets from TIM2 whenever there is a counter update.

This don't seem to work.

My TIM4 is using internal clock and trigger source is ITR1, and slave mode is set to reset mode.

Any tips and suggestions?

Best regards

0 REPLIES 0