Menu

#124 Rising Edge Detection shows false counts with capacitance on input

Duplicate
None
Medium
Enhancement
2016-02-09
2016-02-09
No

When a clean edge with a fast (nSec range) rise/fall time is send to the input pins, Falling, Rising and BOTH edge detections work as advertised.

However, by only adding a small amount of capacitance (50pF) to the input, this changes the rise-time so much that false edge recognition is introduced.
I was able to reproduce this by using part of the test suite. I connected an output pin to an input pin by a 10K resistor and added capacitors of different values to the input pin and ground to show the effect.
The table below only shows count decrepancies.

    Rpi.GPIO

Capacitor Counter Falling Rising Both
Value sb

1uF 100 175 258 263
440nF 100 - 200 -
220nF 100 - 200 -
100nF 100 - 200 -
50nF 100 - 200 -
4.7nF 100 - 170 -
1nF 100 - 133 -
470pF 100 - 110 -
100pF 100 - 105 -
50pF 100 - 102 -
none 100 - - -

A detailed analysis of the Rising edges shows that they are recognized correctly, however, the total count is "falsified" by Falling edges, which are also detected.
I could verify this also on a scope.

    Rpi.GPIO        
    Testing Rising Edges

Capacitor Counter Falling Rising Total
Value sb

1uF 100 138 100 238
440nF 100 109 100 209
220nF 100 100 100 200
100nF 100 100 100 200
50nF 100 100 100 200
4.7nF 100 81 100 181
1nF 100 24 100 124
470pF 100 6 100 106
100pF 100 2 100 102
50pF 100 2 100 102
none 100 0 100 100

Related

Tickets: #124

Discussion

  • Ben Croston

    Ben Croston - 2016-02-09
    • status: New --> Verified
    • assigned_to: Ben Croston
    • Priority: High --> Medium
     
  • Ben Croston

    Ben Croston - 2016-02-09
    • status: Verified --> Duplicate
     
    • Paul Versteeg

      Paul Versteeg - 2016-02-10

      Thanks Ben, sorry for the messed-up tables. I tried to format them, but when
      I posted the software took all formatting away.

      I think that the major "take-away" is that any capacitance on the input
      messed the edge recognition somehow.

      Paul

      From: Ben Croston [mailto:croston@users.sf.net]
      Sent: dinsdag 9 februari 2016 18:00
      To: [raspberry-gpio-python:tickets]
      Subject: [raspberry-gpio-python:tickets] #124 Rising Edge Detection shows
      false counts with capacitance on input

      • status: Verified --> Duplicate

      [tickets:#124] http://sourceforge.net/p/raspberry-gpio-python/tickets/124/
      Rising Edge Detection shows false counts with capacitance on input

      Status: Duplicate
      Created: Tue Feb 09, 2016 12:36 PM UTC by Paul Versteeg
      Last Updated: Tue Feb 09, 2016 04:54 PM UTC
      Owner: Ben Croston

      When a clean edge with a fast (nSec range) rise/fall time is send to the
      input pins, Falling, Rising and BOTH edge detections work as advertised.

      However, by only adding a small amount of capacitance (50pF) to the input,
      this changes the rise-time so much that false edge recognition is
      introduced.
      I was able to reproduce this by using part of the test suite. I connected an
      output pin to an input pin by a 10K resistor and added capacitors of
      different values to the input pin and ground to show the effect.
      The table below only shows count decrepancies.

      Rpi.GPIO
      

      Capacitor Counter Falling Rising Both
      Value sb

      1uF 100 175 258 263
      440nF 100 - 200 -
      220nF 100 - 200 -
      100nF 100 - 200 -
      50nF 100 - 200 -
      4.7nF 100 - 170 -
      1nF 100 - 133 -
      470pF 100 - 110 -
      100pF 100 - 105 -
      50pF 100 - 102 -
      none 100 - - -

      A detailed analysis of the Rising edges shows that they are recognized
      correctly, however, the total count is "falsified" by Falling edges, which
      are also detected.
      I could verify this also on a scope.

      Rpi.GPIO        
      Testing Rising Edges
      

      Capacitor Counter Falling Rising Total
      Value sb

      1uF 100 138 100 238
      440nF 100 109 100 209
      220nF 100 100 100 200
      100nF 100 100 100 200
      50nF 100 100 100 200
      4.7nF 100 81 100 181
      1nF 100 24 100 124
      470pF 100 6 100 106
      100pF 100 2 100 102
      50pF 100 2 100 102
      none 100 0 100 100


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/raspberry-gpio-python/tickets/124/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #124

  • Ben Croston

    Ben Croston - 2016-02-09

    Merged into issue 121

     

    Last edit: Ben Croston 2016-02-09

Log in to post a comment.

Auth0 Logo