Skip to main content
Graduate
November 6, 2025
Question

Alternative option for GPIO External Interrupt for fast signals

  • November 6, 2025
  • 3 replies
  • 847 views

Hello, 

I'm using Nucleo H723ZG.

In my project, i need to detect a rising edge to trigger a callback. What i have done is that i setup a GPIO as external interrupt, and i verified the code by manually connecting and releasing from 3v3 pin. The actual signal i want to trigger is high for approx 38ns , and the callback is not triggering.

What is the best solution for this?

System operating at - 480MHz

Peripheral clocks - 60MHz

Timer clocks - 120MHz

 

edit : Can i use Timer input capture for that, does using it in one pulse mode mean it detects a rising edge and then resets until next trigger (as a slave timer)

edit: I tried the timer input capture too, but still same effect, I used the HAL_TIM_IC_CaptureCallback , One pulse mode is enabled, it is in slave mode, I even applied a 1MHz signal still callback is not triggering, when i applied a 100KHz signal the callback triggers properly. 

edit: upto 400KHz signal the below callback is properly triggering

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim){
	if(htim == &htim4){
	strcpy(uart_buf,"triggering - meh\n\r");
	HAL_UART_Transmit_DMA(&huart3,(uint8_t*)uart_buf, sizeof(uart_buf));
	}
}

edit: It seem the Interrupts were triggering, but due to large number of interrupts, the MCU was not able to execute anything. What i want to achieve is that i want to initiate SPI in DMA mode after it overflows (update event), will enabling DMA for timer help?

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    November 6, 2025

    Hello,

    38ns high, and what about the low duration?

    sreyas40Author
    Graduate
    November 6, 2025

    about 570ns low.

    I even applied a 1MHz signal still not working, but for 100KHz it is working, but i need it to work for fast signals

    Explorer
    November 6, 2025

    Check the datasheet / reference manual, but all GPIOs have configurable glitch filters implemented.
    Here an example I had at hand, for another MCU :

    Ozone_0-1762420511912.png

    GPIO speed and glitch filter settings are not neccessarily related to the core clock frequency.

    sreyas40Author
    Graduate
    November 6, 2025

    I could only find this in the datasheet

    sreyas40_0-1762425302671.png

     

     

    What about the timer input capture, is it same like GPIO EXT Interrupt.

    I even applied a 1MHz signal still not working, but for 100KHz it is working, but i need it to work for fast signals.

    Explorer
    November 6, 2025

    1 MHz is too fast for any uCPU, as its needs time to process interrupt request, 1-2 usec.

    Plz, describe your project, sure there is another way to get results w/o overloading hardware

    Super User
    November 6, 2025

    Make sure your signal reaches the pin you intend to. The simplest method is to set that pin as GPIO Out and toggle and observe at the point where you connect your signal. 

    Make sure the signal has voltages for valid logic levels for your VDD.

    Write a minimal but complete compilable program exhibiting the problem and test with that. By minimal I mean no RTOS, no fluff, just clock initialization, setup of the interrupt, and a means to observe the interrupt to occur (e.g. incrementing a volatila counter which is observed in debugger).

    JW

    sreyas40Author
    Graduate
    November 6, 2025

    the signal is generated by another timer (PWM) , i verified the signal in a logic analyzer. 

    I again changed the signal to 100KHz and now the ic callback is triggering , but i need the ic for fast signal like i mentioned in the beginning

     

    Explorer
    November 6, 2025

    > edit: I tried the timer input capture too, but still same effect, I used the HAL_TIM_IC_CaptureCallback , ...

    Ozone_0-1762429236333.png

    Don't you see the problem here ?
    Are you not aware that "callbacks" are executed in interrupt context ?