Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:gpio:1wire

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:common:applications:gpio:1wire [2022/07/13 23:30]
nick [Table]
products:sbc:common:applications:gpio:1wire [2023/11/07 04:59] (current)
nick old revision restored (2023/11/07 04:42)
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-This document mainly introduces the usage of 1-Wire bus on [[products:sbc:common:applications:gpio:40pin-header|40-Pin Header]].+This page introduces the usage of 1-Wire bus on [[products:sbc:common:applications:gpio:40pin-header|40-Pin Header]].
  
 ===== 1-Wire Information ===== ===== 1-Wire Information =====
Line 9: Line 9:
 You can find the default PIN used for ''1-Wire'' bus from the table below. You can find the default PIN used for ''1-Wire'' bus from the table below.
  
-|            PIN  ^  GPIO(#number)   ^ Number   DT Overlays Node  ^  Device Node          ^ +|            PIN  ^  GPIO Name   DT Overlays Node  ^  Device Node          ^ 
-^  VIM1/   37    GPIOH_5(#421)   | 421     |  onewire            /sys/bus/w1/devices +^  VIM1/   37    GPIOH_5    |  onewire            /sys/bus/w1/devices 
-^  VIM3/3L  |  15    GPIOH_6(#433)   | 433     | :::                | :::                   | +^  VIM3/3L  |  15    GPIOH_6    | :::                | :::                   | 
-^  VIM4      37    GPIOT_19(#465)  465     | :::                | :::                   | +^  VIM4      37    GPIOT_19   | :::                | :::                   | 
-^  Edge1    |  30    GPIO4_A0(#128)  128     | :::                | :::                   |+ VIM1S     36    GPIOZ_8    | :::                | :::                   | 
 +^  Edge1    |  30    GPIO4_A0   :::                | :::                   | 
 +|                             | :::                | :::                   |
  
 ===== Enable 1-Wire Bus ===== ===== Enable 1-Wire Bus =====
Line 27: Line 29:
 ```shell ```shell
 overlays=onewire overlays=onewire
 +```
 +<tabbox VIM3 with 5.15 kernel>
 +
 +Edit ''/boot/dtb/amlogic/kvim3.dtb.overlay.env'' to add onewire node to ''fdt_overlays'' node if it doesn't exist.
 +
 +
 +e.g. To enable onewire, you need to add ''onewire'' to node ''fdt_overlays'' if it doesn't exist.
 +
 +```shell
 +fdt_overlays=onewire
 +
 +```
 +
 +<tabbox VIM3L with 5.15 kernel>
 +
 +Edit ''/boot/dtb/amlogic/kvim3l.dtb.overlay.env'' to add onewire node to ''fdt_overlays'' node if it doesn't exist.
 +
 +
 +e.g. To enable onewire, you need to add ''onewire'' to node ''fdt_overlays'' if it doesn't exist.
 +
 +```shell
 +fdt_overlays=onewire
 +
 ``` ```
  
Line 34: Line 59:
  
  
-e.g. Enable onewire, you need to add ''onewire'' to node ''fdt_overlays'' if it doesn't exist.+e.g. To enable onewire, you need to add ''onewire'' to node ''fdt_overlays'' if it doesn't exist.
  
 ```shell ```shell
Line 40: Line 65:
  
 ``` ```
 +<tabbox VIM1S>
  
 +Edit ''/boot/dtb/amlogic/kvim1s.dtb.overlay.env'' to add onewire node to ''fdt_overlays'' node if it doesn't exist.
 +
 +
 +e.g. To enable onewire, you need to add ''onewire'' to node ''fdt_overlays'' if it doesn't exist.
 +
 +```shell
 +fdt_overlays=onewire
 +
 +```
 </tabbox> </tabbox>
  
 <WRAP tip > <WRAP tip >
-Reboot to effect.+Reboot the system for this change to take effect.
 </WRAP> </WRAP>
  
-===== Disable 1-Wire to Use GPIO ===== 
- 
-If you want to use normal GPIO instead of 1-Wire, you can remove the 1-Wire node in device tree overlays configration file.  
  
 ===== Get Sensor Data ===== ===== Get Sensor Data =====
Line 75: Line 107:
 b1 01 4b 46 7f ff 0c 10 d8 t=27062 b1 01 4b 46 7f ff 0c 10 d8 t=27062
 ``` ```
 +
 +
 +===== Disable 1-Wire to Use GPIO =====
 +
 +If you want to use normal GPIO instead of 1-Wire, you can remove the 1-Wire node in [[products:sbc:common:configurations:device-tree-overlay|Device Tree Overlay]]. 
Last modified: 2022/07/13 23:30 by nick