<?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: I2C - Wire versus HardwareI2C versus Arduino Uno</title>
		<link>http://forums.leaflabs.com/topic.php?id=2855</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:04 +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=2855" rel="self" type="application/rss+xml" />

		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22864</link>
			<pubDate>Mon, 11 Mar 2013 15:40:40 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">22864@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The Soft I2C is using DigitalWrite instead of using direct IO manipulations, there possible is a few other bottle necks as well. It's something I need to fix as well as some other bugs (which I have forgotten about which were found in this thread). The Software I2C is running about 88 kHz off the top of my memory. Since I have a logic analyser now, I can give a more precise measurement.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22863</link>
			<pubDate>Mon, 11 Mar 2013 10:51:18 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22863@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;manitou - &#60;em&#62;&#34;there are URL's to the test code in the first posting of this thread&#34;&#60;/em&#62;.&#60;br /&#62;
Ooops - Thanks!-)&#60;/p&#62;
&#60;p&#62;It might make it easier for folks to use your test code (for example if they want to improve code) if the code were in one of your github repos. Just a thought.&#60;/p&#62;
&#60;p&#62;I am still puzzled why the Maple soft I2C is so much slower than hardware I2C. I'd expect the software and hardware I2C read times to be similar because I am pretty sure Maple can bit-bang at a lot better than 400kHz. However, I'm not going to worry about it; I'm confident someone will explain :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22862</link>
			<pubDate>Mon, 11 Mar 2013 10:17:17 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">22862@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;there are URL's to the test code in the first posting of this thread ...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22861</link>
			<pubDate>Mon, 11 Mar 2013 10:12:33 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22861@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;manitou - that is a pretty interesting set of stats. Do you intend to publish the programs used to get the I2C measurements?&#60;/p&#62;
&#60;p&#62;I am a bit surprised about Maples slow software I2C. I'd expect it to pump bytes into an EEPROM at 100kHz as quickly as hardware I2C (using a lot more CPU cycles).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bnewbold on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22859</link>
			<pubDate>Mon, 11 Mar 2013 09:32:33 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">22859@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;IIRC we have a patch floating around for faster libmaple SPI speeds; mbolivar would know better but he's away this week.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22856</link>
			<pubDate>Mon, 11 Mar 2013 08:33:26 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">22856@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ooops, good eyes.  I failed to edit buffer size in read block for 100Khz DUE test.  git page has been updated.&#60;/p&#62;
&#60;p&#62;thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855&amp;page=2#post-22850</link>
			<pubDate>Sun, 10 Mar 2013 20:42:42 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">22850@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Yeah, that's the values I'm talking about. It's very strange if the read values for 100kHz are that consistant regardless of the actual data being sent. It's something I'm wondering if it was a bug or whether there was a mistake of some description. If it's a bug, I might take a look.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-22849</link>
			<pubDate>Sun, 10 Mar 2013 20:39:12 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22849@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;crenn - are you talking about the values in I2Cperf.txt? Yes I agree with you.&#60;/p&#62;
&#60;p&#62;The Due seems to be within 2% of Maple for 400kHz, which seems reasonable, but the 100kHz read for 10 and 20 bytes are exactly the same number (3124), and much bigger than seems reasonable.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;arduino        UNO                          DUE
           100KHz          400KHz         100Khz      400Khz
Bytes   write   read    write  read    write read   write read (microseconds)
10       1340   1480     448   504      1197 3124    308   338
20       2340   2500     780   840      2104 3124    540   571
30       3360   3512    1112  1176      3014 3127    775   806&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-22846</link>
			<pubDate>Sun, 10 Mar 2013 20:06:03 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">22846@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Are those read values for the Due at 400kHz correct? Something doesn't seem right with that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-22841</link>
			<pubDate>Sat, 09 Mar 2013 13:00:27 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">22841@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I hacked maple-ide-v0.0.12/hardware/leaflabs/cores/maple/i2c.c to add DMA to I2C read and write.  The DMA doesn't really speed up the I2C at either 100KHz or 400KHz, but I guess it would free up the CPU to do other things.  I only did limited testing with I2C EEPROM.&#60;/p&#62;
&#60;p&#62;Just for the record, the I2C results noted earlier in this thread (and other tests for maple/DUE/teensy/UNO) are now on github,&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/manitou48/DUEZoo&#34; rel=&#34;nofollow&#34;&#62;https://github.com/manitou48/DUEZoo&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-14115</link>
			<pubDate>Fri, 14 Sep 2012 23:20:09 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">14115@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I will possibly patch up the library so that cannot occur (ie a transmit must be setup before endTransmission works).&#60;br /&#62;
Also, I'm wondering if the I2C buffers should be bumped upto 64 bytes instead of the 32 bytes they are currently, it takes up a bit more RAM but I feel that could be quite helpful.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-14083</link>
			<pubDate>Fri, 14 Sep 2012 14:41:43 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">14083@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;For your amusement, here are some more I2C EEPROM block write/read times&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Beaglebone  I2C @ 100Khz
bytes   write   read   (microseconds)
10       1320   1669
20       2245   2559
30       3128   3374

 Raspberry Pi  I2C @ 100KHz
10       1268    1449
20       2185    2357
30       3074    3268

  Parallax STAMP PBASIC bit banging and SHIFTOUT (16KHz)
10    47400  37800
20    82200  63000
30   117600  87600

  Parallax propeller  bit-banging
          spin            PASM
10    8147    5815     393   425
20   11797    9273     649   689
30   15447   13491     913   953&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The PASM is tunable to faster than 400KHz, values above were with default delay of 52 cycles.&#60;/p&#62;
&#60;p&#62; Of course the Beaglebone and Raspberry use the Linux metaphor, &#34;everything is a file&#34;, so I2C access is with file read/write.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-14058</link>
			<pubDate>Fri, 14 Sep 2012 09:25:04 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">14058@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks.  Who knew?  Removing the extra endTransmission() fixed the strange read values in the latter passes of the loop.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-14005</link>
			<pubDate>Fri, 14 Sep 2012 04:40:55 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">14005@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;This is the output I got for TwoWire (consistently except for the timings which varied between tests of course.) Maybe write 0xFF in the first few blocks and test again?&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;&#60;code&#62;hit a key&#60;br /&#62;
Memory written&#60;br /&#62;
blk write 1968&#60;br /&#62;
74&#60;br /&#62;
this is data from the eeprom&#60;br /&#62;
68&#60;br /&#62;
69&#60;br /&#62;
blk read 1786&#60;br /&#62;
loop read 3603&#60;br /&#62;
74&#60;br /&#62;
this is data from the eeprom&#60;br /&#62;
68&#60;br /&#62;
69&#60;br /&#62;
blk read 1785&#60;br /&#62;
loop read 3601&#60;/code&#62;&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;I also found there was a small problem with the i2c_eeprom_read_buffer function in that it read the data twice (as there was an extra I2cPort.endTransmission() at the end of the function). These are the results I got from testing with a Microchip 24FC1025.&#60;br /&#62;
&#60;code&#62;crenn's I2c standard     fast  (TwoWire mode)&#60;br /&#62;
Bytes   write   read      write  read   (microseconds)&#60;br /&#62;
10       1558   1466        778  764&#60;br /&#62;
20       2735   2415       1376  2403&#60;br /&#62;
30       3916   3365       1968  1786&#60;/p&#62;
&#60;p&#62;hardware I2c 100KHz     400KHz  (crenn's HardWire)&#60;br /&#62;
Bytes   write   read      write  read   (microseconds)&#60;br /&#62;
10       1199   1316        310   346&#60;br /&#62;
20       2103   2226        540   581&#60;br /&#62;
30       3009   3136        770   816&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;And this is the code I've been using:&#60;br /&#62;
&#60;a href=&#34;http://pastebin.com/EmNcWsDB&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/EmNcWsDB&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "I2C - Wire versus HardwareI2C versus Arduino Uno"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2855#post-13889</link>
			<pubDate>Thu, 13 Sep 2012 19:05:42 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">13889@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I found out yesterday I do have a 24FC1025 which should work (mostly) the same as the 24LC128 so I hope to run a test tonight to find out what is happening.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
