ULP Pulse Counting Example

filipESP
Posts: 71
Joined: Tue Nov 06, 2018 12:42 pm

ULP Pulse Counting Example

Postby filipESP » Mon Nov 19, 2018 9:15 am

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ULP Pulse Counting Example

Postby WiFive » Mon Nov 19, 2018 9:57 am

Gpio34 has no internal pull resistor so it floats and you are measuring noise

filipESP
Posts: 71
Joined: Tue Nov 06, 2018 12:42 pm

Re: ULP Pulse Counting Example

Postby filipESP » Mon Nov 19, 2018 10:08 am

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?

filipESP
Posts: 71
Joined: Tue Nov 06, 2018 12:42 pm

Re: ULP Pulse Counting Example

Postby filipESP » Mon Nov 19, 2018 11:13 am

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ULP Pulse Counting Example

Postby WiFive » Mon Nov 19, 2018 1:15 pm

Call both

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ULP Pulse Counting Example

Postby Ritesh » 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?
Regards,
Ritesh Prajapati

filipESP
Posts: 71
Joined: Tue Nov 06, 2018 12:42 pm

Re: ULP Pulse Counting Example

Postby filipESP » Thu Nov 22, 2018 9:09 am

If I would to use two GPIOs in the same time what I need two modify in the .S file?

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ULP Pulse Counting Example

Postby Ritesh » Fri Nov 23, 2018 8:27 am

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?
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Google [Bot] and 112 guests