Questions and discussions about the software that runs on the TD RF module itself.
axelC
 
Posts: 16
Joined: Wed Feb 17, 2016 2:44 pm

De-Bounce delay

by axelC Thu May 12, 2016 9:51 am

Hi,

I am using impulse counter on
gpioPortC pin 0
This is the pin 25 of td1204 (named V_IO)

I use this init procedure
Code: Select all
// Set pin as input
   GPIO_PinModeSet(gpioPortC, 0, gpioModeInput, 0);

   //Set DOUT to 1 to activate filter, defined by tIOGLITCH (10-50ns)
   GPIO_PinOutSet(gpioPortC, 0);

   //Set configuration for pulse counter
   PCNT_Init_TypeDef pcntInit =
   {
      .mode       = pcntModeOvsSingle,   // OvsSingle : Single input LFACLK oversampling mode
      .counter    = 0,               // Set initial value to 0
      .top        = 0xFFUL,            // Set top to max value
      .negEdge    = true,            // positive edges
      .countDown  = false,            // up count
      .filter     = true,               // filter enabled X
               // The filter passes all high and low periods that are at least 5 clock cycles long.
               // With LFACLK = 32kHz, 5xPeriode = 156us,
   };


THe PCNT filter will be only 156us
That why i also try the Input filter with GPIO_PinOutSet(gpioPortC, 0);
But this filter is only 10-50ns

Do you think that there is a way to extend the filter around 100ms without adding an hardware filter on PCNT line?
Return to Firmware

Who is online

Users browsing this forum: No registered users and 27 guests