Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge-2l:applications:gpio:adc

Differences

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

Link to this comparison view

Next revision
Previous revision
products:sbc:edge-2l:applications:gpio:adc [2025/11/25 04:21]
gray created
products:sbc:edge-2l:applications:gpio:adc [2026/05/11 02:07] (current)
nick ↷ Page moved from local:users:gray:products:sbc:edge-2l:applications:gpio:adc to products:sbc:edge-2l:applications:gpio:adc
Line 5: Line 5:
 ===== Introduction ===== ===== Introduction =====
  
-This documentation will introduce the usage of ADC on the Edge-2L IO board.+This document explains how to use the Analog-to-Digital Converter (ADCon the Edge-2L IO board.
  
 <WRAP important > <WRAP important >
-For Edge-2L, in order to use the ADC function, you need to attach the Edge-2L IO board.+To use the ADC functionality on the Edge-2L, you must attach the Edge-2L IO board.
 </WRAP> </WRAP>
  
-===== Hardware Information =====+===== Hardware information =====
  
-The ADC on the Edge-2L IO board is a 12-bit successive approximation register (SAR) A/D Converter.+The Edge-2L IO board includes a 12-bit Successive Approximation Register (SAR) ADC.
  
 ^  Pin  ^  Voltage  ^  Device Node                                       ^ ^  Pin  ^  Voltage  ^  Device Node                                       ^
Line 20: Line 20:
  
  
-===== Get Raw ADC Value =====+===== Reading the raw ADC value ===== 
 + 
 +Read the raw digital value from the ADC:
  
 ```shell ```shell
-$ cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw                                             +$ cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw  
 +``` 
 +Example output: 
 +```                                            
 4082                                                  4082                                                 
 ``` ```
- +Convert the raw 12-bit ADC reading to a voltage using the formula:
-Convert the raw ADC value to Voltage: +
 ''Voltage = (value / 4096) * 1.8V'' ''Voltage = (value / 4096) * 1.8V''
  
  
Last modified: 2025/11/25 04:21 by gray