0
\$\begingroup\$

According to the SAM3X handbook it can do debouncing of interrupts "automatically", how would I enable that on an arduino due? The doc http://www.atmel.com/Images/doc11057.pdf states something about setting it directly in the PIO.

\$\endgroup\$
2
  • 5
    \$\begingroup\$ This question appears to be a user-level arduino issue or about use or arduino libraries, not about electronics or the embedded code that touches it. We are not the arduino help desk. \$\endgroup\$ Jul 2 '14 at 16:54
  • 1
    \$\begingroup\$ This is clearly a question about the microcontroller which just happens to sit on an Arduino board. @OlinLathrop \$\endgroup\$
    – jippie
    Jul 2 '14 at 17:46
2
\$\begingroup\$

Then that's what you'd do. The Arduino libraries are not omnipotent, nor do they even expose all the functionality available. Sometimes you'll have no choice but to twiddle the bits yourself.

\$\endgroup\$
1
  • \$\begingroup\$ I try and push this whenever I can. Many people who use with Arduino really think that they're programming a microcontroller and are unaware they're using a very much simplified API. \$\endgroup\$
    – sherrellbc
    Jul 2 '14 at 16:56
1
\$\begingroup\$

You can search the datasheet for "ebounc", which matches various spellings of "debouncing" related words. Especially chapter 32.5.9 in the datasheet you refer to describes "Input Glitch and Debouncing Filters". Find the registers that match the debouncing configuration for the I/O pins you need.

This Arduino forum post talks about direct register manipulation. In this respect the Arduino IDE works identical to how you program it in 'bare' C.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.