Jump to content

Dobrica Pavlinušić

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Dobrica Pavlinušić reacted to badrianiulian in DS18B20 temperature sensor in Lamobo R1   
    OK
    So here's what I did:
    - used a 4,7k resistor between data pin and +3,3v pin on the DS18B20.
    - used the same pin (12) in /boot/bin/lamobo-r1.bin (bin2fex, edit, fex2bin):
    [w1_para] gpio = 12 - converted the /boot/dtb/sun7i-a20-lamobo-r1.dtb for editing
    dtc -I dtb -O dts -o sun7i-a20-lamobo-r1.dts sun7i-a20-lamobo-r1.dtb - search for the next section to add the lines below (no need for comments):
    led_pins@0 { allwinner,pins = "PH24"; allwinner,function = "gpio_out"; allwinner,drive = <0x0>; allwinner,pull = <0x0>; linux,phandle = <0x46>; phandle = <0x46>; }; + + w1_pin@0 { + allwinner,pins = "PH2"; + allwinner,function = "gpio_in"; + allwinner,drive = <0x0>; + allwinner,pull = <1>; + linux,phandle = <0x48>; /# X = incremented (hex) by searching the hole dts file for phandles #/ + phandle = <0x48>;  /# X = same incremented value #/ + }; }; timer@01c20c00 { compatible = "allwinner,sun4i-a10-timer"; reg = <0x1c20c00 0x90>; interrupts = <0x0 0x16 0x4 0x0 0x17 0x4 0x0 0x18 0x4 0x0 0x19 0x4 0x0 0x43 0x4 0x0 0x44 0x4>; clocks = <0xa>; };   - go to next section and add the next lines (no need for comments):
    ps2@01c2a400 { compatible = "allwinner,sun4i-a10-ps2"; reg = <0x1c2a400 0x400>; interrupts = <0x0 0x3f 0x4>; clocks = <0x37 0x7>; status = "disabled"; }; + + onewire_device { + compatible = "w1-gpio"; + gpios = <0x22 0x7 0x2 0x0>; /# 0x22 value is taken from below, similar to the initial uploaded dtb (zador's); #/ /# the rest are the same as the initial uploaded dtb (zador's) #/ + pinctrl-names = "default"; + pinctrl-0 = <0x48>; /# X = same incremented value #/ + status = "okay"; + }; }; ahci-5v { compatible = "regulator-fixed"; pinctrl-names = "default"; pinctrl-0 = <0x42>; regulator-name = "ahci-5v"; regulator-min-microvolt = <0x4c4b40>; regulator-max-microvolt = <0x4c4b40>; regulator-boot-on; enable-active-high; gpio = <0x22 0x1 0x3 0x0>; status = "okay"; linux,phandle = <0x30>; phandle = <0x30>; }; usb0-vbus { compatible = "regulator-fixed"; pinctrl-names = "default"; pinctrl-0 = <0x43>; regulator-name = "usb0-vbus"; regulator-min-microvolt = <0x4c4b40>; regulator-max-microvolt = <0x4c4b40>; enable-active-high; gpio = <0x22 0x1 0x9 0x0>; status = "okay"; linux,phandle = <0x2b>; phandle = <0x2b>; }; - reconverted the new /boot/dtb/sun7i-a20-lamobo-r1.dts
    dtc -I dts -O dtb -o sun7i-a20-lamobo-r1.dtb sun7i-a20-lamobo-r1.dts - in /etc/modules added:
    w1-therm w1-gpio  - now finnaly something appears in /sys/bus/w1/devices
     
    Thanks for the dtb... very usefull
     
     
    ---
    A patch I made to speed up the dtb patching of the new 5.25 jessie mainline armbian : https://www.dropbox.com/sh/ciiun8n56c46q2n/AACUw3qe981xrnoCWR7vgJ0ga/w1-temp.tar.gz?dl=0
    ---
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines