Hi,
I'm trying to configure the BBB Gpio debounce feature. I set GPIO2.6 to be an output pin and GPIO2.7 to be an input pin with interrupt enabled at just rising edge. All pinmux settings for both pins are done. Now i connect these pins with a wire externally [these are pins 45 and 46 on header P8] . Now I toggle the pin GPIO2.6 in a nearly infinite while loop and print out a short message in the interrupt to keep track which interrupts are triggered. I see that interrupts are triggered for each toggle of the pin as expected(that is, for every rising edge). I have a global counter variable which tells me which while iteration each edge interrupt corresponds to. I can see that each and every number is printed sequentially; so each of the edges are detected and each triggers an interrupt.
Now comes the weird part. I enable debounce clk in PRCM, enable corresponding bit gpio debounce register, and set the gpio debounce time to 0x01. Now the interrupts are farther apart, around 20 numbers are skipped with each interrupt. But I also see some distortion in the interrupts. Some unexpected interrupts are also missed, but this is rare. Now I increase debounce time to 0x02. The interrupts are proportionally farther apart, and I see a bit more distortion in the number sequence. At random points I just miss a lot of interrupts. As I keep increasing the debounce time, the distortion keeps increasing until around 0x08, when I rarely get interrupts at all. I get maybe 1 interrupt per 3 seconds (yes seconds), which is extremely small considering the input is toggling in a while loop with minimal delay. At higher numbers I barely get any interrupts.
I've tried this with other gpio pins (within GPIO2), other gpio modules(GPIO0 and GPIO1) and other BBB boards. I believe I'm configuring the debounce correctly since I'm getting nearly the expected outputs for debounce times 0x01 and 0x02. I've looked into the following related posts but I dont think they answer this problem.
http://e2e.ti.com/support/arm/sitara_arm/f/791/t/217327
https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/507463
https://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/p/169343/618474#618474
https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/379739
Regards,
Vineeth