<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div>Hey Martin / all,<br><br></div>Oh there&#39;s much chin scratching and head shaking going on at our end atm...<br><br></div>Can we ask if we have the hardware configured correctly before moving onto software issues please:<br>
<br></div>Attached is the diagram of our 4051 mux&#39;er.<br><br></div>This is what we have and aren&#39;t sure if it&#39;s correct<br></div>16 to 3.3v RPi<br></div>14 to SCL (sensor 1)<br></div>13 to SCL (sensor 2)<br></div>
[Each SCL has 10k resistor and a feed of 3.3v from RPi]<br></div>11 to  P1-11 (GPIO 17) - RPi <br></div>10 to SDA (sensor 1)<br></div>9   to SDA (sensor 2)<br></div><div>7   to Ground<br></div>3   to SDA P1-03 (GPIO 0) - RPi<br>
<div><div><div><div><div><div><div><div><br></div><div>The power for the sensors is wired directly into 5v from the RPi.<br></div><div>The ground for the sensors is wired directly into the RPi.<br><br></div><div class="gmail_extra">
I&#39;m not sure if this has happened after running the code for the sensors but I&#39;m now unable to access the i2c busses:<br><br>cat /dev/i2c*<br>cat: /dev/i2c-0: Input/output error<br>cat: /dev/i2c-1: Input/output error<br>
<br></div><div class="gmail_extra">I note from the code that we&#39;re now using gpio17 instead of the i2c busses which would account for that error I guess?<br><br></div><div class="gmail_extra">Few more coding issues but feel like we could do with some confirmation that the hardware&#39;s correct before moving on?<br>
<br></div><div class="gmail_extra">Cheers,<br><br></div><div class="gmail_extra">Julian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 29 April 2013 16:38, Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca" target="_blank">martin.peach@sympatico.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Here&#39;s a patch to display data from two D6T sensors on the same I2C bus. The clock line is switched using a 4051 analog multiplexer. The control line is GPIO_17 of the Pi connected to A of the 4051 (B, C and Inhibit are at 0V). 10k resistors to 3.3V are on each sensor&#39;s clock line at X0 and X1 of the 4051 (I2C clock connects to X). Because the code accesses the GPIO file system it needs to be run as root. I have two different sensors so the code reads two different packet lengths. Just a proof of concept, there could be up to 8 identical sensors on the same bus with this setup.<span class=""><font color="#888888"><br>

<br>
Martin</font></span><div class="im"><br>
<br>
On 2013-04-25 20:04, Julian Brooks wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
Just spotted this:<br>
<a href="https://github.com/kadamski/i2c-gpio-param" target="_blank">https://github.com/kadamski/i2c-gpio-param</a><br>
Could be useful<br>
<br>
<br>
On 25 April 2013 15:54, Martin Peach &lt;<a href="mailto:martin.peach@sympatico.ca" target="_blank">martin.peach@sympatico.ca</a><br></div><div class="im">
&lt;mailto:<a href="mailto:martin.peach@sympatico.ca" target="_blank">martin.peach@sympatico.ca</a>&gt;&gt; wrote:<br>
<br>
    On 2013-04-25 10:37, Julian Brooks wrote:<br>
<br>
        &#39;Nother 2 dumb questions:<br>
        What&#39;s the difference between the ones that have<br>
        spider/centipede type<br>
        legs and the straight ones (which would be best to get).<br>
<br>
<br>
    The PDIP package is what you want, not the SOIC. The only difference<br>
    is size. DIP packages are human-friendly, surface mount is for robots.<br>
<br>
<br>
        And also are you attaching the MC14051 to any type of<br>
        board/adaptor or<br>
        just soldering straight on to the pins?<br>
<br>
<br>
    I have it in a breadboard right now, to make it more permanent I<br>
    would solder a socket to a prototyping board then (after verifying<br>
    the connections) plug the chip into the socket. Soldering to the<br>
    pins makes it difficult to replace the IC, and risks damaging it<br>
    with the heat if you&#39;re not good at soldering quickly and to the<br>
    point. A CD4051 would also work, it&#39;s basically the same circuit.<br>
<br>
    Martin<br>
<br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div></div></div></div></div></div></div></div></div>