mmkw43
Posts: 554
Joined: Tue Dec 24, 2013 6:18 pm

GPIO edge detection

Tue Feb 17, 2015 3:29 pm

Sometimes I get a little sloppy action with a program that interfaces to the GPIO pins set as inputs. I do intend on using an opto isolator with my switch which will clean things up and of course I have pullups on the pins. (By the way, are there internal pullups you can use?)

Anyway, does using the option of rising or falling edge make a difference? (I imagine it would) Anyone out there that has noted the difference? I go low = True for my input so falling edge would be the choice.

Thanks.

3corey2
Posts: 85
Joined: Sun Feb 15, 2015 2:59 am

Re: GPIO edge detection

Tue Feb 17, 2015 3:33 pm

be more specific what you are doing here, im not sure how to answer this question.
ras pi 2, gotta love it.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO edge detection

Tue Feb 17, 2015 3:35 pm

Each gpio may be programmed to have neither, internal pull-up to 3V3, or internal pull-down to ground. The internal resistors are circa 50k ohm.

I'm not sure why a rising or falling edge would behave differently.

mmkw43
Posts: 554
Joined: Tue Dec 24, 2013 6:18 pm

Re: GPIO edge detection

Tue Feb 17, 2015 4:51 pm

Good -- I assume you meant "either" -- I'll look into it. Do all the ports have the internal resistor? My opto made a big difference I'll add the falling edge as well.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO edge detection

Tue Feb 17, 2015 5:11 pm

mmkw43 wrote:Good -- I assume you meant "either" -- I'll look into it. Do all the ports have the internal resistor? My opto made a big difference I'll add the falling edge as well.
Each gpio. I mean neither, i.e. a gpio may be programmed to have no pull-up or pull-down, pull-up, or pull-down.

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: GPIO edge detection

Tue Feb 17, 2015 7:42 pm

Just a reminder that pins 3 and 5 (GPIO 2/3 or 0/1 on very early Pi models) have strong on-board external pull-ups.

Return to “Beginners”