<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=17&amp;t=4321" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2009-11-03T09:38:31+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=17&amp;t=4321</id>
<entry>
<author><name><![CDATA[roboard]]></name></author>
<updated>2009-11-03T09:38:31+01:00</updated>
<published>2009-11-03T09:38:31+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22576#p22576</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22576#p22576"/>
<title type="html"><![CDATA[Re: i2c on linux: intterrupted system call]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22576#p22576"><![CDATA[
i2c_Initialize() employs the linux times(...) call for time delays. You can call roboio_GetErrMsg() to see what error happens when i2c_Initialize() fails.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1542">roboard</a> — Tue Nov 03, 2009 9:38 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[maestro]]></name></author>
<updated>2009-11-02T16:09:00+01:00</updated>
<published>2009-11-02T16:09:00+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22566#p22566</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22566#p22566"/>
<title type="html"><![CDATA[i2c on linux: intterrupted system call]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=4321&amp;p=22566#p22566"><![CDATA[
Hi,<br /><br />I'm using roboard and the roblib to obtain some i2c values.<br /><br />Sometimes reading values works just fine, but sometimes I get the following errors_<br />Can't open I2c<br />Interrupted system call<br />It means, that ii2c_Initialize() fails while initializing the i2c bus. Which system (which can be interrupted) are used in i2c_initialize()?  Can I write a more reliable function to obtain the i2c_values? <br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>int ADin::MCP3221getADvalue&#40;&#41; &#123;<br />   unsigned char highByte, lowByte;<br /><br />   if &#40;i2c_Initialize&#40;I2CIRQ_DISABLE&#41; == false&#41; &#123;<br />      Logger::error &lt;&lt; __func__ &lt;&lt; &quot;: Can't open I2c&quot; &lt;&lt; std::endl;<br />      Logger::error &lt;&lt; strerror&#40;errno&#41; &lt;&lt; std::endl;<br />      return -5;<br />   &#125;<br /><br />   if &#40;i2c0_SetSpeed&#40;I2CMODE_STANDARD, 100000L&#41; == 0&#41; &#123;<br />      Logger::error &lt;&lt; __func__ &lt;&lt; &quot;: Can't set speed: &quot;<br />            &lt;&lt; roboio_GetErrMsg&#40;&#41; &lt;&lt; std::endl;<br />   &#125;<br /><br />   //START with address 0x40 to write 1 byte<br />   if &#40;!i2c0master_Start&#40;MCP3221, I2C_READ&#41;&#41; &#123;<br />      Logger::error &lt;&lt; __func__ &lt;&lt; &quot;: START fail &#40; &quot; &lt;&lt; roboio_GetErrMsg&#40;&#41;<br />            &lt;&lt; &quot;&#41;... try again&quot; &lt;&lt; std::endl;<br />      if &#40;!i2c0master_Start&#40;MCP3221, I2C_READ&#41;&#41; &#123;<br />         Logger::error &lt;&lt; __func__ &lt;&lt; &quot;: START fail again &#40; &quot;<br />               &lt;&lt; roboio_GetErrMsg&#40;&#41; &lt;&lt; &quot;&#41;&quot; &lt;&lt; std::endl;<br />         i2c_Close&#40;&#41;;<br />         return -4;<br />      &#125;<br />   &#125;<br /><br />   highByte = i2c0master_ReadSecondLast&#40;&#41;;<br /><br />   lowByte = i2c0master_ReadLast&#40;&#41;;<br /><br />   i2c_Close&#40;&#41;;<br />   return highByte * 256 + lowByte;<br /><br />&#125;</code></dd></dl><br /><br />Thanks for any suggestions. [/list]<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1606">maestro</a> — Mon Nov 02, 2009 4:09 pm</p><hr />
]]></content>
</entry>
</feed>