VonHatte
Posts: 3
Joined: Mon Aug 17, 2015 10:38 am

OutputOpenDrain

Mon Aug 17, 2015 10:55 am

Hi,

I am doing project where I need to use GPIO pins as OutputOpenDrain. Problem is that when I am setting drive mode in code I get exception that says that drive mode is not supported.

To the actual question: Is it that Raspberry Pi 2 does not support OutputOpenDrain mode at all or are only few of them supporting it (I tried this on several GPIO)? Does anyone know any workaround that I could use (preferably without any changes to electronics)?

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: OutputOpenDrain

Mon Aug 17, 2015 11:48 am

VonHatte wrote:Hi,

I am doing project where I need to use GPIO pins as OutputOpenDrain. Problem is that when I am setting drive mode in code I get exception that says that drive mode is not supported.

To the actual question: Is it that Raspberry Pi 2 does not support OutputOpenDrain mode at all or are only few of them supporting it (I tried this on several GPIO)? Does anyone know any workaround that I could use (preferably without any changes to electronics)?
This is the Raspberry Pi 2B GPIO web page for Windows 10 IoT Core:

https://ms-iot.github.io/content/en-US/ ... gsRPi2.htm

http://ms-iot.github.io/content/en-US/w ... Coding.htm
Take what I advise as advice not the utopian holy grail, and it is gratis !!

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

Re: OutputOpenDrain

Mon Aug 17, 2015 1:16 pm

The Raspberry Pi GPIOs do not have an Open Drain Output mode.
[edit] I suppose you could emulate by setting the GPIO to Input when you would set Open Drain output high, and Output Low when you would want to pull it low. That way it would pull down when "0" and float when "1".

and plugwash has beaten me too it :)
Last edited by rpdom on Mon Aug 17, 2015 1:21 pm, edited 2 times in total.

plugwash
Forum Moderator
Forum Moderator
Posts: 3770
Joined: Wed Dec 28, 2011 11:45 pm

Re: OutputOpenDrain

Mon Aug 17, 2015 1:18 pm

You can simulate open drain by setting the output value to 0 and then using the direction register as your output signal.

VonHatte
Posts: 3
Joined: Mon Aug 17, 2015 10:38 am

Re: OutputOpenDrain

Mon Aug 17, 2015 6:27 pm

Thank you all for answering. I tried using normal output without knowing raspberry pi in internal circuitry and it seems to work. It's not optimal so I'm going to give a try direction register.

Thank you all!

Return to “Windows 10 for IoT”