Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:applications:gpio:adc

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:edge2:applications:gpio:adc [2022/12/06 03:54]
nick
products:sbc:edge2:applications:gpio:adc [2022/12/06 21:03] (current)
hyphop [Hardware Information]
Line 5: Line 5:
 ===== Introduction ===== ===== Introduction =====
  
-The previous part of this page introduces ADC related information.The second part guides you to obtain ADC conversion values.+This documentation will introduce the usage of ADC on the Edge2 IO board.
  
 <WRAP important > <WRAP important >
-For Edge2, in order to use the ADC function, you need to attach the IO extension board. +For Edge2, in order to use the ADC function, you need to attach the Edge2 IO board.
 </WRAP> </WRAP>
  
-===== ADC Information =====+===== Hardware Information =====
  
-<WRAP info > +The ADC on the Edge2 IO board is 12-bit successive approximation register (SAR) A/D Converter.
-The ADC is an 12-bit Successive Approximation Register (SAR) A/D Converter.+
  
-</WRAP>+^  Pin  ^  Voltage  ^  Device Node                                       ^ 
 +|  9    |  0~1.8V   |  /sys/bus/iio/devices/iio:device0/in_voltage4_raw  |
  
  
-|            ADC        PIN  ^   GPIO Name  ^ 
-^  Edge2    |  ADC_CH2        SARADC_IN4  | 
  
-===== ADC conversion ===== +===== Get Raw ADC Value =====
- +
-Use the following command to view the device node and read the ADC conversion value.+
  
 ```shell ```shell
-$ cd && ls /sys/bus/iio/devices/iio:device0 
-buffer           in_voltage2_raw  in_voltage6_raw   of_node        trigger 
-dev              in_voltage3_raw  in_voltage7_raw   power          uevent 
-in_voltage0_raw  in_voltage4_raw  in_voltage_scale  scan_elements 
-in_voltage1_raw  in_voltage5_raw  name              subsystem 
 $ cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw                                              $ cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw                                             
-                                                +4082                                                  
 +```
  
-```+Convert the raw ADC value to Voltage: 
 + 
 +''Voltage = (value / 4096) * 1.8V''
  
  
Last modified: 2022/12/06 03:54 by nick