Page 2 of 2

Re: Using Multiple interrupts in esp32

Posted: Sat Jul 31, 2021 1:58 am
by Sprite
Btw, core migration shouldn't happen if you pin a task to a core using e.g. xTaskCreatePinnedToCore. Given that in all this, the core configuration is pretty important, I suggest you make 100% sure everything is pinned correctly.

Re: Using Multiple interrupts in esp32

Posted: Sat Jul 31, 2021 7:36 am
by opcode_x64
Hello ESP_Sprite,

I also suspected the GPIO interrupt issue which you described in your last post.

I will check again if the tasks are pinned correctly and will post any issues here.

At this stage I want to ask if "esp_intr_alloc(...)" is capable of registering a Level-5 interrupt?
Means, can I replace:

Code: Select all

    ESP_INTR_DISABLE(31);
    intr_matrix_set(1, ETS_GPIO_INTR_SOURCE, 31);   
    ESP_INTR_ENABLE(31);
by

Code: Select all

   ESP_ERROR_CHECK(esp_intr_alloc(ETS_GPIO_INTR_SOURCE, ESP_INTR_FLAG_LEVEL5 | ESP_INTR_FLAG_IRAM, NULL, NULL, &adc_drdy_intr_handle));
The docs about Highlevel-Interrupt says, esp_intr_alloc(..) can be used for registering Highlevel-Interrupts. Now, independently of the ethernet GPIO interrupt issue we discussed here, when I use the esp_intr_alloc(...) instead intr_matrix_set(...) for registering the Level5-Interrupt the ADC interrupt is not working.... Maybe here is another mistake hidden, which causes the other issues...

opcode_x64

Re: Using Multiple interrupts in esp32

Posted: Wed Jan 26, 2022 7:15 am
by wernerwillemse
I am having the same problem. I am trying to use a hardware external interrupt (two GPIO input pins). The first interrupt works perfectly fine, but the second interrupt is simply not being serviced. I have scoured the forums and literature to no avail. There are many examples of one GPIO pin being used as an external trigger, but I haven't been able to find an example of more than one GPIO pin being setup for ISR.

The reason why I am trying to establish two interrupts is to create a quadrature encoder reader to read the position of a motor. Quadrature encoders require reading two signals (A and B) at highspeed. Here's a link to encoders in general: https://en.wikipedia.org/wiki/Increment ... 20movement.

I will appreciate any advice to help me move forward.
Two_Interrupts.txt
(1.35 KiB) Downloaded 353 times
Many thanks,
-Werner

Re: Using Multiple interrupts in esp32

Posted: Tue Jan 14, 2025 10:49 am
by dmitrij999
I am having the same problem. I am trying to use a hardware external interrupt (two GPIO input pins). The first interrupt works perfectly fine, but the second interrupt is simply not being serviced. I have scoured the forums and literature to no avail. There are many examples of one GPIO pin being used as an external trigger, but I haven't been able to find an example of more than one GPIO pin being setup for ISR.

The reason why I am trying to establish two interrupts is to create a quadrature encoder reader to read the position of a motor. Quadrature encoders require reading two signals (A and B) at highspeed. Here's a link to encoders in general: https://en.wikipedia.org/wiki/Increment ... 20movement.

I will appreciate any advice to help me move forward. Two_Interrupts.txt

Many thanks,
-Werner
I think you need to use built-in PCNT (Pulse Counter) which is intended to use for purposes like yours