Hi,
Hope I'm asking this at the right place, please apologize if I'm wrong:
I've read at several locations that the RPI GPIO sink current is configurable from 2 to 16mA and that the details are described in a document called "GPIO Datasheet Addendum". But all I could find when googling for that document is an errata: "http://www.scribd.com/doc/101830961/GPIO-Pads-Control2" describing details w.r.t. _output_ current control. Can anyone help out with information on how to configure GPIO _input_ (i.e. sink) current control?
Background: I'd like to count pulses from S0 current counting devices, an as these are about 100m away from my RPI, I though I should configure a decently high input current. An as the maximum current through the S0 current counting devices is rated at 27mA, the 16mA sink current may come in handy, avoiding extra external pull down resistors.
Thanks for any help,
Chris
- Grumpy Mike
- Posts: 973
- Joined: Sat Sep 10, 2011 7:49 pm
- Location: Manchester (England England)
- Contact: Website
Re: how to configure GPIO sink current
No that is not quite right. It is the drive current and hence the impedance of the output that is configurable. BUT this does not limit the current to a safe value or indeed a value equal to the drive current. For information on this see my page:-adlersam wrote:I've read at several locations that the RPI GPIO sink current is configurable from 2 to 16mA
http://www.thebox.myzen.co.uk/Raspberry ... tputs.html
Sink current is not a parameter for an input, sink current is an output value.how to configure GPIO _input_ (i.e. sink) current control?
Re: how to configure GPIO sink current
Yes, I read this already: It's an _excellent_ explanation to understand the RPI GPIO output behaviour.Grumpy Mike wrote:No that is not quite right. It is the drive current and hence the impedance of the output that is configurable. BUT this does not limit the current to a safe value or indeed a value equal to the drive current. For information on this see my page:-adlersam wrote:I've read at several locations that the RPI GPIO sink current is configurable from 2 to 16mA
http://www.thebox.myzen.co.uk/Raspberry ... tputs.html
Oh, I see. So "source and sink current" mentioned in the GPIO wiki are not referring to GPIO output and input current but to impedance of the output between the GPIO pin towards +3.3V and 0V! Many thanks for the clarification.Sink current is not a parameter for an input, sink current is an output value.how to configure GPIO _input_ (i.e. sink) current control?
Re: how to configure GPIO sink current
Signaling over a distance of 100m is going to cause you serious difficulties using basic 3.3V or 5V TTL logic levels. There will be significant scope for the cabling to pick up electrical noise and you'll also have the internal resistance & capacitance of the cabling to deal with. At a minimum, I'd suggest using differential line drivers between the Pi and the remote devices. The next step up would be to look at CAN bus or ethernet cabling.adlersam wrote:Background: I'd like to count pulses from S0 current counting devices, an as these are about 100m away from my RPI, I thought I should configure a decently high input current.
- Grumpy Mike
- Posts: 973
- Joined: Sat Sep 10, 2011 7:49 pm
- Location: Manchester (England England)
- Contact: Website
Re: how to configure GPIO sink current
You can get this distance if you use an logic level signal from 0 to 12V, then at the Pi end you have it going into the base of a transistor through a resistor and then connect the collector to the GPIO pin with the internal pull-ups enabled and the emitter to ground. Also a resistor from base to ground will lower the input impedance and thus reduce pickup.