Search found 22 matches

by OSCPUDEV
Wed Feb 05, 2025 1:44 am
Forum: General Discussion
Topic: Replacing existing interrupt handler
Replies: 17
Views: 6332

Re: Replacing existing interrupt handler

Can you give me an example of how this should be done? I have the extern defined as:

extern "C" void new_xt_highint5();


There is a routine (assembly code) called new_xt_highint5, and it is a copy of the interrupt routine that I have been using successfully for the xt_highint5 replacement, but ...
by OSCPUDEV
Tue Feb 04, 2025 7:40 pm
Forum: General Discussion
Topic: Replacing existing interrupt handler
Replies: 17
Views: 6332

Replacing existing interrupt handler

I have a level 5 interrupt handler that replaces the weak casting of the xt_highint5 interrupt handler That works perfectly, but now I need to be able to change this handler on the fly, not just at compile time. From looking at the low level includes, it seems that there is a function in the ROM ...
by OSCPUDEV
Tue Aug 27, 2024 2:56 am
Forum: ESP32 Arduino
Topic: Best Frequency Meter ever made with ESP32 - awesome!
Replies: 100
Views: 209128

Re: Best Frequency Meter ever made with ESP32 - awesome!

Have you considered using the Capture Submodule of MCPWM module instead of the PCNT module? You can set the resolution down to 12.5ns (80MHz). There are 3 channels available, and they are fully hardware driven. An edge change on a GPIO causes the module to grab the current 32 bit timer value and ...
by OSCPUDEV
Thu Aug 22, 2024 7:44 pm
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

Just a follow-up! The problem with not being able to use NMI is apparently a known bug in the ESP-IDF! This has been reported:

https://github.com/espressif/esp-idf/issues/13629

There is a working around, but is only for v5.2.1 of the ESP-IDF core, not the version that the Arduino core is using ...
by OSCPUDEV
Wed Aug 21, 2024 4:37 pm
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

OK, so who handles the Arduino ESP stuff?

I looked at xtensa_vectors.S code and see how the interrupt handler works... and I can see why it takes 220ns before the high level interrupt routine is called. Can you tell me how I can determine WHERE (memory address) the interrupt table is located? It ...
by OSCPUDEV
Wed Aug 21, 2024 6:16 am
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

I tried a variety of things to invoke the override. "External" is not valid (Extern is). Also, this is not valid under Arduino IDE (compiler errors):



p=&ld_include_xt_nmi;


I tried even making a subroutine calls like: call ld_include_xt_nmi(), call _xt_nmi(), etc. and that didn't change ...
by OSCPUDEV
Tue Aug 20, 2024 12:03 pm
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

Do you actually refer to 'ld_include_xt_nmi' in your CMakelists.txt? (cflags needs a '-u ld_include_xt_nmi' to force the linker to evaluate your asm file)


I am using the Arduino IDE. I don't do anything with make files, just click the compile button. The exact same code, using .global ld_include ...
by OSCPUDEV
Mon Aug 19, 2024 8:52 pm
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

I also have a question about changing interrupt handlers. How can I have 5 different _xt_nmi routines and choose which one is used? I do NOT want to have to test inside of the interrupt and branch/jump to the appropriate code.. that would require >25ns, which is way too long. There must be a way to ...
by OSCPUDEV
Mon Aug 19, 2024 7:48 pm
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

Well, after looking over my code to try to get the NMI version to work I see that I made a big mistake in the interrupt setup (C++ code). I had the INTR_NUM at 14 correct, but I had the flags wrong. The esp_intr_alloc() flags should be ESP_INTR_FLAG_NMI (not ESP_INTR_FLAG_LEVEL5).

Now, the ESP32 ...
by OSCPUDEV
Mon Aug 19, 2024 10:34 am
Forum: ESP32 Arduino
Topic: High level interrupt (5) and NMI issues
Replies: 11
Views: 5110

Re: High level interrupt (5) and NMI issues

You were spot on about why the interrupt could be firing twice in a row! I swapped the code around so that the interrupt flag is cleared immediately following saving the registers. That does in fact solve the problem with the interrupt firing twice! Why is this the case though? I would expect that ...

Go to advanced search