Ibutton - onewire W1 in imx6ul

cancel
Showing results for 
Search instead for 
Did you mean: 

Ibutton - onewire W1 in imx6ul

Jump to solution
1,451 Views
jareyes
Contributor II

Hi,

I am currently trying to connect an iButton to my imx6ul based board. This is the schematic:

ibutton.pngIn the device tree I have enabled the pin as onewire:

         onewire {
               compatible = "w1-gpio";
               gpios = <&gpio3 3 GPIO_ACTIVE_HIGH>;
               status = "okay";
               };

and configured the pin with:

         MX6UL_PAD_LCD_VSYNC__GPIO3_IO03         0x1a8b1

I also have enabled every 1wire driver in the kernel:

CONFIG_W1=y
CONFIG_W1_CON=y

#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_DS2490=y
CONFIG_W1_MASTER_DS2482=y
CONFIG_W1_MASTER_MXC=y
CONFIG_W1_MASTER_DS1WM=y
CONFIG_W1_MASTER_GPIO=y

#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=y
CONFIG_W1_SLAVE_SMEM=y
CONFIG_W1_SLAVE_DS2408=y
CONFIG_W1_SLAVE_DS2408_READBACK=y
CONFIG_W1_SLAVE_DS2413=y
CONFIG_W1_SLAVE_DS2406=y
CONFIG_W1_SLAVE_DS2423=y
CONFIG_W1_SLAVE_DS2431=y
CONFIG_W1_SLAVE_DS2433=y
CONFIG_W1_SLAVE_DS2433_CRC=y
CONFIG_W1_SLAVE_DS2760=y
CONFIG_W1_SLAVE_DS2780=y
CONFIG_W1_SLAVE_DS2781=y
CONFIG_W1_SLAVE_DS28E04=y
CONFIG_W1_SLAVE_BQ27000=y

When I boot my board up I can see (my kernel does not use modules):

root@ep100:/# dmesg | grep w1
DS1WM w1 busmaster driver - (c) 2004 Szabolcs Gyurko
root@ep100:/# dmesg | grep Dallas
Driver for 1-wire Dallas network protocol.
root@ep100:/# ls /sys/bus/w1/devices/
w1_bus_master1

With an oscilloscope to see the pin behaviour I can ensure the pin is searching for devices:

osc.png

But there is no new devices in /sys/bus/w1/devices/. ¿What am I doing wrong?

Thanks

Labels (1)
Tags (2)
1 Solution
596 Views
jareyes
Contributor II

Hi,

I have been working on it and I solved it. It was the SION bit. 

MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 must be set to 0x4001a8b1 instead of 0x1a8b1. So the device tree is:

 

/ {

onewire {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&w1_gpio_pins>;
status = "okay";
gpios = <&gpio3 3 0>;
linux,open-drain;
};

&iomuxc {

...

w1_gpio_pins: w1gpio {
fsl,pins = <
MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x4001a8b1
>;
};

...

};

};

 

Thank you!

View solution in original post

3 Replies
596 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Juan ,

     Try the code below, please!   ( in imx6ul-14x14-evk.dts)

&iomuxc {
...
        w1_gpio_pins: w1gpio {
            fsl,pins = <
                MX6UL_PAD_LCD_VSYNC__GPIO3_IO03         0x1a8b1
            >;
        };

        pinctrl_dvfs: dvfsgrp {
            fsl,pins = <
                MX6UL_PAD_SNVS_TAMPER3__GPIO5_IO03    0x79
            >;
        };
...
}

onewire@0{
        compatible = "w1-gpio";
        pinctrl-names = "default";
        pinctrl-0 = <&w1_gpio_pins>;
        status = "okay";
        gpios = <&gpio3 3 0>;
        linux,open-drain;
}

Have a nice day!

TIC Weidong Sun

0 Kudos
596 Views
jareyes
Contributor II

Thank you very much,

I have applied the change you suggested: adding  linux,open-drain; to onewire. (MX6UL_PAD_SNVS_TAMPER3__GPIO5_IO03 does not have to do with one wire in our board) and now I can see the difference in oscilloscope:

osc.pngI have tried with an iButton and with a ds18b20 and in both cases dmesg is claiming for unknown device:

w1_master_driver w1_bus_master1: Family 0 for 00.d00000000000.57 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.300000000000.be is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.b00000000000.32 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.700000000000.f8 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.f00000000000.74 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.080000000000.c2 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.880000000000.4e is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.480000000000.84 is not registered.
w1_master_driver w1_bus_master1: Family 0 for 00.c80000000000.08 is not registered

Where can the missundestanding be?

Thank you

597 Views
jareyes
Contributor II

Hi,

I have been working on it and I solved it. It was the SION bit. 

MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 must be set to 0x4001a8b1 instead of 0x1a8b1. So the device tree is:

 

/ {

onewire {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&w1_gpio_pins>;
status = "okay";
gpios = <&gpio3 3 0>;
linux,open-drain;
};

&iomuxc {

...

w1_gpio_pins: w1gpio {
fsl,pins = <
MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x4001a8b1
>;
};

...

};

};

 

Thank you!

View solution in original post