Help please with connect DS2450 to Omega-2 +



  • I want connect DS2450 (Analog digital converter) to my Omega-2 + through 1-Wire so I can connect analog sensors.

    Firstly, I registered the master 1-Wire on 19 pin:
    insmod w1-gpio-custom bus0=0,19,0

    Further, I connected DS2450 to Omega-2 + according to this diagramm:
    As an analog sensor, I use a photoresistor
    Since Omega pins are not tolerant to 5 volts, I use a level converter.
    0_1532794954701_Безымянный.png

    After that, I check to see if there are 1-Wire connections:

    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/w1_master_slave_count
    1
    

    I output the addresses of the connected devices:

    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/w1_master_slaves
    20-0000000a2208
    

    But when I try to read data from the device, an error occurs:

    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/20-0000000a2208/w1_slave
    cat: can't open '/sys/devices/w1_bus_master1/20-0000000a2208/w1_slave': No such file or directory
    

    What I do wrongly?



  • To troubleshoot, I'd suggest breaking the diagnosis into two (or three) steps:

    1. use a 3.3V friendly 1-wire slave device (say a simple iButton ID device) to verify your software/driver/kernel module is working
      <-- (to me, that custom w1 driver seems to be just a shim and still need the core 1-wire library)

    2. if and only if (1) works...
      use a 3.3V 1-wire slave device that is externally powered (i.e., not powered via 1-wire) and repeat test #1 again

    3. if and if if test 1 and 2 passed,
      now add the level-shifter and try your system again
      (timing and 1-wire half duplex turn-around topics)

    ccshello



  • @ccs-hello
    Thanks for the advice. I turn to the verification of the first paragraph. As I understand it, you recommend connecting to Omega-2 other 1-wire device at 3.3 volts. Unfortunately, now I do not have ID andButton. Is it possible to connect the temperature sensor DS18B20?



  • Yes, DS18B20, if using local power (as opposed to parasite power thru 1-wire), min voltage is 3V. Thus should work with a 3.3V 1-wire system, either in local power or parasite power configuration.



  • @ccs-hello
    Temperature sensor DS18B20 perfectly shows the temperature:

    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/28-0000053f2316/w1_slave
    9e 01 4b 46 7f ff 02 10 56 : crc=56 YES
    9e 01 4b 46 7f ff 02 10 56 t=25875
    

    or

    root@Omega-D90D:~# awk -F= '/t=/ {printf "%.03f\n", $2/1000}' /sys/devices/w1_bus_master1/28-0000053f2316/w1_slave
    25.937
    

    Thus, paragraph 1 has been verified. What should I do next?



  • Are you supplying Vdd (3.3V) power to DS18B20 (test #2) or
    just using parasitic power (test #1)?



  • @ccs-hello
    I supplying DS18B20 power 3.3 v. No parasitic power.



  • Now it's the hardware thing.
    I'd recommend PCA9306 and using its SDA (bidirectional) channel.
    MOSFET based level shifter is just a hack.



  • @ccs-hello
    I connected the DS18B20 according to this diagram:
    0_1532930527932_1532795134455-безымянный.png
    And everything works.

    So, the problem in the DS2450?



  • Figure 1 in post 1 needs a 4k7 pull up resistor on A/D's 1-wire data pin.
    1-wire is using open-drain bus for communications.



  • @ccs-hello
    I added a 4.7-kOm resistor to the circuit, Omega sees the ADC, but does not read the data from it. Maybe the data should be read somehow differently?

    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/w1_master_slaves
    20-0000000a2208
    root@Omega-D90D:~# cat /sys/devices/w1_bus_master1/20-0000000a2208/w1_slave
    cat: can't open '/sys/devices/w1_bus_master1/20-0000000a2208/w1_slave': No such file or directory
    


  • One thought:
    find a 5V I/O tolerable Linux box (full fledged LINUX implementation would be better), retest the 1-wire code on that A/D chip.

    No 5V - 3.3V bi-direction level shifter in the interconnect.

    ===
    Or ask the author of the custom 1-wire code.



  • @ccs-hello
    In datasheet on DS2450 written different commands. But I do not know how to introduce them.



  • @CAP-33 In WHAT?



  • @William-Scott
    In datasheet


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.