[PD] Sensors GPIO Raspberry Pi Pd

Julian Brooks jbeezez at gmail.com
Fri May 3 18:34:50 CEST 2013


Ok - thanks for that, makes more sense now.

When I run the C code this happens:

"./jb_d6t_reader_ic3 0
...export file accessed, new pin now accessible
...direction set to output
./jb_d6t_reader_ic3: initialized:0
Write failed (5)
>> Input/output error <<
...unexport file accessed, pin now inaccessible"

I've done my best to go through the code and make changes where appropriate.

Replaced D6T8L with DRT44L2 and changed packet size.
Altered all references for 2nd sensor to DRT44L2 and also changed i2c-1 to
0 for rev1 board.

Weirdly I can't access the i2c bus anymore?
cat /dev/i2c*
cat: /dev/i2c-0: Input/output error
cat: /dev/i2c-1: Input/output error

Tried to follow the code to figure where it's falling down but I'm not
getting it.

Also do I still need 1 or 0 after './jb_d6t_reader_ic(n)? 1 seems to make
it to go into PEC spiral with no readings.

Read failed (5)
>> Input/output error <<
D6T_checkPEC says 0x8F
Read failed (5)
>> Input/output error <<
D6T_checkPEC says 0x8F
Read failed (5)
>> Input/output error <<
D6T_checkPEC says 0x8F
Read failed (5)
>> Input/output error <<
D6T_checkPEC says 0x8F
Read failed (5)
>> Input/output error <<
D6T_checkPEC says 0x8F
Read failed (5)
>> Input/output error <<

etc etc.

i2cdetect -y 0 also draws a blank.

Very best wishes,

Julian




On 3 May 2013 16:31, Martin Peach <martin.peach at sympatico.ca> wrote:

> On 2013-05-03 10:26, Julian Brooks wrote:
>
>> Hey Martin / all,
>>
> ..
>
>> This is what we have and aren't sure if it's correct
>>
>
> Yes it's a bit wrong...
>
>
>  16 to 3.3v RPi
>> 14 to SCL (sensor 1)
>>
>
> Yes, pin 3 is connected through to pin 13 when pin 11 is low, and to pin
> 14 when 11 is high. So it's actually sensor 2 on pin 14.
>
>
>  13 to SCL (sensor 2)
>>
>
> Is actually sensor 1
>
>
>  [Each SCL has 10k resistor and a feed of 3.3v from RPi]
>> 11 to  P1-11 (GPIO 17) - RPi
>>
>
> Yes, 11 selects which channel. 9,10, and 11 make up a 3-bit address which
> selects which of the 8 output channels is connected to the input on pin 3.
> If you only have 2 sensors the two extra selector pins must be set low.
>
>
>  10 to SDA (sensor 1)
>>
>
> 10 to Ground or another selector pin if you have more than 2 sensors
> The sensor data pins are connected directly to the RPi SDA pin, only the
> SCL line goes through the 4051.
>
>
>  9   to SDA (sensor 2)
>>
>
> 9 to Ground or another selector pin
>
>  7   to Ground
>>
>
> Also, 6 (Inhibit) must be low for the chip to function (this permits
> expanding to more than 8 channels by using more 4051s)
> Pin 8 to Ground
>
>
>  3   to SDA P1-03 (GPIO 0) - RPi
>>
>
> 3 to SCL RPi, you're switching the clock line, not the data
>
>
>
>> The power for the sensors is wired directly into 5v from the RPi.
>> The ground for the sensors is wired directly into the RPi.
>>
>>
> Martin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130503/c0aa0057/attachment.htm>


More information about the Pd-list mailing list