<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[i2c Word Addressing?]]></title><description><![CDATA[<p dir="auto">Greetings.</p>
<p dir="auto">I've followed instructions from <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/4416">@UFD</a> to fix the built-in i2c routines and instead allow bit-banged i2c read and write.  Thanks for all the work which went in to that post.</p>
<p dir="auto"><img src="/assets/uploads/files/1520301771842-i2cdetect.png" alt="0_1520301636644_i2cdetect.png" class="img-responsive img-markdown" /></p>
<p dir="auto">I'm attempting to read and write to a 24c512 EEPROM.  Its device address is 0b101000. Per the datasheet the device is expecting a 16 bit address for reading and writing. Best I can tell, command line tools i2cget and i2cset are only sending 8 bits worth.</p>
<p dir="auto">Here's a capture of me reading from device address 0x50, memory location 0x02.  The stored data should be 0xAA.</p>
<p dir="auto"><img src="/assets/uploads/files/1520301666543-i2cdatasheet.png" alt="0_1520301531234_i2cdatasheet.png" class="img-responsive img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1520301614273-i2read-resized.png" alt="0_1520301479029_i2read.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Is there a way to force these in-built routines to use a word-sized address?I've looked here already without seeing anything obvious:</p>
<p dir="auto"><a href="https://docs.onion.io/omega2-docs/i2c-python-module.html" rel="nofollow">https://docs.onion.io/omega2-docs/i2c-python-module.html</a></p>
<p dir="auto">Thanks for your time.</p>
]]></description><link>http://community.onion.io/topic/2764/i2c-word-addressing</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 14:22:02 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/2764.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Mar 2018 02:07:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to i2c Word Addressing? on Tue, 06 Mar 2018 03:57:19 GMT]]></title><description><![CDATA[<p dir="auto">Greetings.</p>
<p dir="auto">I've followed instructions from <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/4416">@UFD</a> to fix the built-in i2c routines and instead allow bit-banged i2c read and write.  Thanks for all the work which went in to that post.</p>
<p dir="auto"><img src="/assets/uploads/files/1520301771842-i2cdetect.png" alt="0_1520301636644_i2cdetect.png" class="img-responsive img-markdown" /></p>
<p dir="auto">I'm attempting to read and write to a 24c512 EEPROM.  Its device address is 0b101000. Per the datasheet the device is expecting a 16 bit address for reading and writing. Best I can tell, command line tools i2cget and i2cset are only sending 8 bits worth.</p>
<p dir="auto">Here's a capture of me reading from device address 0x50, memory location 0x02.  The stored data should be 0xAA.</p>
<p dir="auto"><img src="/assets/uploads/files/1520301666543-i2cdatasheet.png" alt="0_1520301531234_i2cdatasheet.png" class="img-responsive img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1520301614273-i2read-resized.png" alt="0_1520301479029_i2read.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Is there a way to force these in-built routines to use a word-sized address?I've looked here already without seeing anything obvious:</p>
<p dir="auto"><a href="https://docs.onion.io/omega2-docs/i2c-python-module.html" rel="nofollow">https://docs.onion.io/omega2-docs/i2c-python-module.html</a></p>
<p dir="auto">Thanks for your time.</p>
]]></description><link>http://community.onion.io/post/16192</link><guid isPermaLink="true">http://community.onion.io/post/16192</guid><dc:creator><![CDATA[peanut]]></dc:creator><pubDate>Tue, 06 Mar 2018 03:57:19 GMT</pubDate></item><item><title><![CDATA[Reply to i2c Word Addressing? on Tue, 06 Mar 2018 03:57:01 GMT]]></title><description><![CDATA[<p dir="auto">After a few hours of banging around, here are some breadcrumbs for the next soul who wanders this way:</p>
<ol>
<li>
<p dir="auto">The built-in routines only support 8 bit addressing.  Full stop.</p>
</li>
<li>
<p dir="auto">However, there's a <a href="http://smbus2.py" rel="nofollow">smbus2.py</a> library which can handle larger writes.  I grabbed it from here and installed it in the python2.7 directory:</p>
</li>
</ol>
<p dir="auto"><a href="https://pypi.python.org/pypi/smbus2/0.2.0" rel="nofollow">https://pypi.python.org/pypi/smbus2/0.2.0</a></p>
<ol>
<li>Then, these folks wrote simple <a href="http://read-eeprom16.py" rel="nofollow">read-eeprom16.py</a> and <a href="http://write-eeprom16.py" rel="nofollow">write-eeprom16.py</a> files, based on smbus which seem stable enough.  The reference is halfway down the page:</li>
</ol>
<p dir="auto"><a href="https://medium.com/@rxseger/i2c-interfacing-on-the-bus-pirate-and-raspberry-pi-to-serial-eeproms-for-a-hat-c776ea50f8f4" rel="nofollow">https://medium.com/@rxseger/i2c-interfacing-on-the-bus-pirate-and-raspberry-pi-to-serial-eeproms-for-a-hat-c776ea50f8f4</a></p>
<p dir="auto">I renamed 'smbus' as 'smbus2' in the two files like this:</p>
<p dir="auto"><strong>import sys<br />
import smbus2<br />
import time<br />
bus = smbus2.SMBus(1)</strong></p>
<p dir="auto">That said, as written it does <em>not</em> currently support page read / page write, merely 16 byte chunks.  So it's very slow.  I'll see what I can do to speed things up.</p>
]]></description><link>http://community.onion.io/post/16193</link><guid isPermaLink="true">http://community.onion.io/post/16193</guid><dc:creator><![CDATA[peanut]]></dc:creator><pubDate>Tue, 06 Mar 2018 03:57:01 GMT</pubDate></item><item><title><![CDATA[Reply to i2c Word Addressing? on Tue, 06 Mar 2018 04:39:32 GMT]]></title><description><![CDATA[<p dir="auto">This is all for tonight... I edited line 33 in <a href="http://write-eeprom.py" rel="nofollow">write-eeprom.py</a> like this:</p>
<p dir="auto"><strong>#	time.sleep(0.1) # needs some time to finish write, or fails [Errno 5]<br />
time.sleep(0.004)  # datasheet calls for ~ 5 ms wait</strong></p>
<p dir="auto">Which gives at 32k write time of ~16 seconds.</p>
<p dir="auto">Sorting out the page write function will make a big difference as well.</p>
<p dir="auto"><img src="/assets/uploads/files/1520311156388-shortchunk.png" alt="0_1520311019301_shortchunk.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://community.onion.io/post/16194</link><guid isPermaLink="true">http://community.onion.io/post/16194</guid><dc:creator><![CDATA[peanut]]></dc:creator><pubDate>Tue, 06 Mar 2018 04:39:32 GMT</pubDate></item></channel></rss>