Using Multiple interrupts in esp32

ESP_Sprite
Posts: 9761
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Multiple interrupts in esp32

Postby ESP_Sprite » Sat Jul 31, 2021 1:58 am

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.

opcode_x64
Posts: 47
Joined: Sun Jan 13, 2019 5:39 pm

Re: Using Multiple interrupts in esp32

Postby opcode_x64 » Sat Jul 31, 2021 7:36 am

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

wernerwillemse
Posts: 1
Joined: Wed Jan 26, 2022 6:37 am

Re: Using Multiple interrupts in esp32

Postby wernerwillemse » Wed Jan 26, 2022 7:15 am

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 280 times
Many thanks,
-Werner
I am a systems engineer working in the Life-Science field.

Who is online

Users browsing this forum: Bing [Bot] and 131 guests