An Analog-to-Digital Converter (ADC) is a device that translates an analog voltage to a digital value that a microprocessor can understand.
On the ConnectCore 6 system-on-module there are:
-
11 ADC channels available from the DA9063 PMIC.
The Dialog DA9063 PMIC provides a 10-bit general purpose ADC with track and hold circuitry and an analog input multiplexer that allows the conversion of up to nine different inputs.
The ADC measures the following inputs:
-
Channel 0: VSYS_RES - measurement of the system VDD (2.5 - 5.5V)
-
Channel 1: ADCIN1_RES - high impedance input (0 - 2.5V)
-
Channel 2: ADCIN2_RES - high impedance input (0 - 2.5V)
-
Channel 3: ADCIN3_RES - high impedance input (0 - 2.5V)
-
Channel 4: Tjunc - measurement of internal temperature sensor
-
Channel 5: VBBAT - measurement of the backup battery voltage (0 - 5.0V)
-
Channel 8: MON_A8_RES - group 1 internal regulators voltage (0 - 5.0V)
-
Channel 9: MON_A9_RES - group 2 internal regulators voltage (0 - 5.0V)
-
Channel 10: MON_A10_RES group 3 internal regulators voltage (0 - 5.0V)
Kernel configuration
You can manage the hardware monitor support device driver through the following kernel configuration option:
-
Dialog Semiconductor DA9063 (
CONFIG_SENSORS_DA9063
)
This option is enabled as built-in on the ConnectCore 6 SBC kernel configuration file.
Kernel driver
The hardware monitor support device driver for Dialog DA9063 is located at drivers/hwmon/da9063-hwmon.c
.
Device tree bindings and customization
The PMIC ADC device tree binding is documented at Documentation/devicetree/bindings/hwmon/da9063-hwmon.txt
.
The device tree node for the hardware monitor support device driver is defined in the ConnectCore 6 device tree.
hwmon {
compatible = "dlg,da9063-hwmon";
dlg,tjunc-offset = <(-5)>
}
Using the ADCs
The ADC driver is designed as a hardware monitor (HWMON) device driver that can be accessed from the sysfs or from user applications.
Sysfs access
You can access the ADC values through the sys file system:
# cd /sys/class/hwmon/hwmon0/device
# ls
driver in0_label in2_input in3_label modalias subsystem uevent
hwmon in1_input in2_label in4_input name temp1_input
in0_input in1_label in3_input in4_label power temp1_label
# cat in0_label in0_input
VSYS
4968
# cat in1_label in1_input
ADCIN1
1124
# cat in2_label in2_input
ADCIN2
2096
# cat in3_label in3_input
ADCIN3
1632
# cat in4_label in4_input
VBBAT
425
# cat temp1_label temp1_input
TJUNC
50
Sample application
An example application called apix-adc-example
is included in the dey-examples-digiapix recipe (part of dey-examples package) of the meta-digi layer.
This application shows how to access the ADCs using Digi APIx library on the ConnectCore 6 platform.
Go to GitHub to see the application instructions and source code.
See ADC API for more information about the ADC APIx.