LeMaker Guitar:ADC

From BananaPro/Pi
Jump to: navigation, search

Other languages:
English • ‎中文(简体)‎

Description

There are two ADC channels on Guitar Base Board Rev.B: ADC0 and ADC_COM,the ADC converter module integrated into PMU(ATC2603C) chip.

The ADC hardware features

ADC resolution: 10 bit, as well as: 1/1024.
Analog input voltage range: 0 ~ +3.0V.
Sampling frequency: 3.2 kHz.
ADC.png

Pin on Board Pin definition Pin on Board Pin definition
J14-01 UART3_TX/GPIOD23 J14-02 ADC_COM
J14-03 UART3_RX/GPIOD22 J14-04 ADC0
J14-05 GND J14-06 GND

How to use the ADC

Step 1: Connect a stabilized voltage supply to ADC_COM or ADC0
Adc.jpg
Step 2: How to read the voltage value of ADC0.
Type the command below to read the value of ADC0_DATA

cat /sys/class/hwmon/hwmon0/device/aux0
1018 /1024      #ADC0_DATA = 1018

Then using the following formula to calculate the voltage value of ADC0(AnalogVol)

AnalogVol = 3.0/1024*(ADC0_DATA)

Step 3: How to read the voltage value of ADC_COM.
Type the command below to read the value of REM_CON_DATA.

cat /sys/class/hwmon/hwmon0/device/remote_control
982 /1024      #REM_CON_DATA = 982

Then using the following formula to calculate the voltage value of ADC_COM(AnalogVol)

AnalogVol = SVCC/1024*(REM_CON_DATA)

Note: The SVCC voltage value is set to 3.1V by default.