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)?
-
- Posts: 27225
- Joined: Tue Mar 25, 2014 12:40 pm
Re: OutputOpenDrain
This is the Raspberry Pi 2B GPIO web page for Windows 10 IoT Core: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)?
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 !!
Re: OutputOpenDrain
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
[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.
Re: OutputOpenDrain
You can simulate open drain by setting the output value to 0 and then using the direction register as your output signal.
Re: OutputOpenDrain
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!
Thank you all!