cancel
Showing results for 
Search instead for 
Did you mean: 

I using stm32l4 in low power mode and wants micro counts of input gpio pulses.I attached the explanation and the code.

alianvari
Associate III
 
6 REPLIES 6

Is there a difference whether you count the pulses i low power or during full run?

What is the source of pulses? Is it clean? Isn't it a pushbutton or any other mechanical contact?

JW

I generate pulses with 4Hz frequency by another board and print number of each pulse also when I press button pulse production stops and then after 20ms products a another pulse(I things micro in second board is waking up ).

when pressed button in first board, micro in second board wake up and print number of received pulses and enter low power run mode again also second board wake up every 2s and print "hello".

note:I use lptim in second board.

best regards.

I generate pulses with 4Hz frequency by another board and print number of each pulse also when I press button pulse production stops and then after 20ms products a another pulse(I things micro in second board is waking up ).
when pressed button in first board, micro in second board wake up and print number of received pulses and enter low power run mode again also second board wake up every 2s and print "hello".
note:I use lptim in second board.
best regards.

Cut down the program to absolute minimum - no low power mode, no print, just counting the pulses.

Does it now correctly count the pulses?

JW

I did these works i.e no low power mode no wake up, it now correctly count the pulses except for the first time the button is pressed that counts down a unit.

I did these works i.e no low power mode no wake up, it now correctly count the pulses except for the first time the button is pressed that counts down a unit.