<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Reading from a pin configured as OUTPUT_OPEN_DRAIN.</title>
		<link>http://forums.leaflabs.com/topic.php?id=1588</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:20:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1588" rel="self" type="application/rss+xml" />

		<item>
			<title>RichardE on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10315</link>
			<pubDate>Sun, 22 Apr 2012 10:33:57 +0000</pubDate>
			<dc:creator>RichardE</dc:creator>
			<guid isPermaLink="false">10315@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ala42 : Downloaded it. Tried it. It worked! Thanks very much. Big help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ala42 on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10312</link>
			<pubDate>Sun, 22 Apr 2012 09:11:22 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">10312@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The maple Wire lib is buggy. Try &#60;a href=&#34;http://ala42.cdfreaks.com/AeroQuad/Wire.zip&#34; rel=&#34;nofollow&#34;&#62;http://ala42.cdfreaks.com/AeroQuad/Wire.zip&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardE on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10310</link>
			<pubDate>Sun, 22 Apr 2012 05:19:02 +0000</pubDate>
			<dc:creator>RichardE</dc:creator>
			<guid isPermaLink="false">10310@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Update: Tried the same code (more or less) on an Arduino. i.e. I wrote a message to the EEPROM and then read it back. It worked perfectly. Then reconnected the EEPROM to the Maple and ran the program again. Behaved in the same way except when it read the data back it got the message that had been written by the Arduino (&#34;Hello!&#34;). If I then changed the message the Maple was writing to &#34;ABCDEF&#34; and re-ran the program it still reports everything is fine but continues to read &#34;Hello!&#34;. So it looks like the reading works fine but the writing doesn't.&#60;/p&#62;
&#60;p&#62;Has anyone successfully written an I2C EEPROM using the Wire library?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardE on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10304</link>
			<pubDate>Sat, 21 Apr 2012 18:09:56 +0000</pubDate>
			<dc:creator>RichardE</dc:creator>
			<guid isPermaLink="false">10304@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Oh right. Didn't really think the Wire library could be that badly wrong. Must be something else then. Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ala42 on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10303</link>
			<pubDate>Sat, 21 Apr 2012 18:01:19 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">10303@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;&#38;gt; Is it possible to read from a pin that is configured as OUTPUT_OPEN_DRAIN?&#60;br /&#62;
Yes. You can even read the pin in push/pull mode.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10302</link>
			<pubDate>Sat, 21 Apr 2012 17:15:19 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">10302@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Had a quick look at the wirish_digital.cpp and found this: &#60;/p&#62;
&#60;p&#62;/**&#60;br /&#62;
 * Read a digital value from a pin.  The pin must have its mode set to&#60;br /&#62;
 * one of INPUT, INPUT_PULLUP, and INPUT_PULLDOWN.&#60;br /&#62;
 *&#60;br /&#62;
 * @param pin Pin to read from.&#60;br /&#62;
 * @return LOW or HIGH.&#60;br /&#62;
 * @see pinMode()&#60;br /&#62;
 */&#60;br /&#62;
uint32 digitalRead(uint8 pin);&#60;/p&#62;
&#60;p&#62;I haven't done much with the gpio yet, so I don't know exactly how they work in this situation, but it may be similar to AVR where the register you have to read to know the status of the bit is different from input to output mode. &#60;/p&#62;
&#60;p&#62;Have a go through the manual maybe and see the register description.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardE on "Reading from a pin configured as OUTPUT_OPEN_DRAIN."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1588#post-10300</link>
			<pubDate>Sat, 21 Apr 2012 13:35:48 +0000</pubDate>
			<dc:creator>RichardE</dc:creator>
			<guid isPermaLink="false">10300@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Is it possible to read from a pin that is configured as OUTPUT_OPEN_DRAIN?&#60;br /&#62;
The documentation would seem to suggest this is not possible. For digitalRead it says:&#60;/p&#62;
&#60;p&#62;uint32 digitalRead(uint8 pin)&#60;br /&#62;
Read a digital value from a pin.&#60;br /&#62;
The pin must have its mode set to one of INPUT, INPUT_PULLUP, and INPUT_PULLDOWN.&#60;/p&#62;
&#60;p&#62;The reason I ask is that I am trying to communicate with a serial EEPROM (Microchip 24AA512) using the Wire library and I seem to be able to write and read from the device. I always get an error code of SUCCESS when writing and when I ask to read back 6 bytes it returns a count of 6 bytes, but the data I read back always consists of set bits (so all bytes come back as 0xFF). These should have been re-programmed when writing the device.&#60;/p&#62;
&#60;p&#62;If I look at Wire.cpp it looks as though the two pins (SDA and SCL) are configured as open drain outputs when begin is called and then the pin mode is never changed. Doesn't this mean you can never read the state of the SDA line? Would this explain why I always get 0xFF?&#60;/p&#62;
&#60;p&#62;BTW. I have pullups on the SDA and SCL lines and the write protect pin is always low when writing to the device. I have tried various resistor values (2K7, 1K, 8K2) and I always get the same result.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
