This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2434: Debounce function for all GPIO?

Part Number: AM2434

Tool/software:

Hi expert, 

  I studied the AM24x TRM to learn how to use the debounce function for GPIO. The below description said the debounce function is not associated with all signals, so it's necessary to check the datasheet.
    

  Then, I check the AM24x Datasheet, and I found a few gpio signal description with note(1), indicating that these GPIOs have a debounce function, as shown in the example below.
    

  However, I checked the TRM, and all GPIOs have their own PadConfig settings (bits 13–11) to configure the debounce function individually.

   PadConfig example : GPIO1_54

        1. Data Sheet : it don't mention note(1)
             

        2. GPIO1_54 match to PadConfig 142
            
        3. PadConfig 142 can set debounce 
           
               

  So, I would like to know if all GPIOs can use the debounce function, or if only the GPIO signals marked with note (1) in the datasheet have this capability.
    

Regards

Bolt

  • Hi Bolt,

    Thanks for your query.

    So, I would like to know if all GPIOs can use the debounce function, or if only the GPIO signals marked with note (1) in the datasheet have this capability.

    As mentioned in the TRM that not all the GPIO signal has associated debounce functionality. So, only those signals which are marked with note(1) in the datasheet have debounce capability. For MCU_GPIO the signals will be marked with note(2). 

    Please refer below image.

    Regards, 

    Tushar

  • Hi Tushar,

        Thanks for your response.

        I am using a GPIO (e.g., GPIO1_54) for interrupt input, but this GPIO doesn’t have a debounce function.

        When the GPIO input signal has glitches and noise, it affects the interrupt signal, causing it to trigger at incorrect times.

        Does the AM243x have any other function to handle GPIO glitches or filter noise?

    Regards

    Bolt

  • Hi Bolt,

    Can you please explain the use case in more details?

    it affects the interrupt signal, causing it to trigger at incorrect times.

    By incorrect timing, Does this means it is a periodic interrupt? Is there a periodic write on GPIO (High/Low)?

    What is the period of the interrupt? And when incorrect interrupt occurs what is time delta?

    Regards,

    Tushar

  • Hi Tushar,

       Thanks for your response.

        For example, our application will use an FPGA to produce two constant periodic signals, one at 62.5 µs and the other at 1 ms. Both periodic signals will be sent to the AM24x using two GPIO pins. When the trigger signal occurs, the FPGA will set the signal to a high level for just 3 µs, then reset the signal to a low level.

        The signal allows the AM24x to trigger a hardware interrupt to execute periodic actions. However, when our environment has noise (e.g., during an ESD test), I observed that the AM24x triggers the hardware interrupt within 5 µs. This means that when the GPIO experiences noise, the AM24x incorrectly triggers the hardware interrupt.

        So, I would like to know if there is any method available in the AM243x to de-glitch signals for all GPIOs that do not have a debounce function.

    Regards

    Bolt

  • Hi Bolt,

    Thanks for sharing the above details.

    I observed that the AM24x triggers the hardware interrupt within 5 µs.

    Can you please tell how are you measuring the above time differences?

    Is this understanding correct that the interrupt should trigger within 3us windows but is triggering in 5us window?

    Regards,

    Tushar

  • Hi Tushar,

      I used CycleCounterP_getCount32( ) to record the time of each interrupt trigger.

      The times I recorded are not the delay between the external HW interrupt signal arriving and the software being triggered, but rather the interval between each software trigger.

      Under normal periodic triggering, the minimum interrupt trigger interval recorded is approximately 62.5 µs.

      When noise interference occurs, the minimum interrupt trigger interval recorded is 5 µs.

     I hope this information can help you provide me with a method to handle GPIO glitches and noise.

    Thanks a lot.

    Regards

    Bolt

  • Hi Bolt,

      So, I would like to know if there is any method available in the AM243x to de-glitch signals for all GPIOs that do not have a debounce function.

    There is no way to configure debounce period for the GPIO pin if this functionality is not present for the pin in interrupt mode.

    As an alternate you can use the polling mode and read the GPIO_IN_DATA/GPIO_OUT_DATA register to check if a signal change is detected. Once a signal change is detected, wait for a particular timeout(i.e. debounce period) and read the register again to see the Pin status. 

    This way you can filter out the noise for the GPIO signal change.

    Regards,

    Tushar