Page 1 of 1
ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 9:15 am
by filipESP
Hi,
I'm trying to use ULP for counting pulse from GPIO.
Button on the pcb board is connect to GPIO34, so I changed variable gpio_num from GPIO_NUM_0 to GPIO_NUM_34 and I wake up the ESP with using timer in five seconds periods.
I do nothing when the program is executing but I get the number of pulse in e.g. equals to 3562.
What pulses are count in this case?
Re: ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 9:57 am
by WiFive
Gpio34 has no internal pull resistor so it floats and you are measuring noise
Re: ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 10:08 am
by filipESP
In case with GPIO_NUM_0 is the same problem.
So, what I need to do is set internal pull on the GPIO_NUM_0 pin?
Re: ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 11:13 am
by filipESP
OK, it is working when I use esp_sleep_enable_ulp_wakeup() function but I need to use function called esp_sleep_enable_timer_wakeup( 6000000 ). The ESP wakes up but doesn't count the pulse from the button.
Re: ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 1:15 pm
by WiFive
Call both
Re: ULP Pulse Counting Example
Posted: Mon Nov 19, 2018 6:36 pm
by Ritesh
WiFive wrote: ↑Mon Nov 19, 2018 1:15 pm
Call both
Is this uses to count only total number of pulses? Not used to measure timing of each pulse ? Correct?
Re: ULP Pulse Counting Example
Posted: Thu Nov 22, 2018 9:09 am
by filipESP
If I would to use two GPIOs in the same time what I need two modify in the .S file?
Re: ULP Pulse Counting Example
Posted: Fri Nov 23, 2018 8:27 am
by Ritesh
Ritesh wrote: ↑Mon Nov 19, 2018 6:36 pm
WiFive wrote: ↑Mon Nov 19, 2018 1:15 pm
Call both
Is this uses to count only total number of pulses? Not used to measure timing of each pulse ? Correct?
Hi WiFive,
Would you please check my last question and provide your valuable feedback for same?