Breadcrumbs

AIN

The AIN connector in the node can be added in the device tree of the KCH Control ARM VFP Linux.

image2021-2-16_10-51-42.png

Parameters

Parameter

Description 

Name

Linux Device File Path of ain port (see HW chapter)

max resolution

max resolution of channel for V caclulation (default: 522)

max voltage

max voltage of channel for V caclulation (default: 3.3)

With the new AIN node the values can directly mappt to variables.


Variables mappt

Parameter

Description 

in raw

Raw Value of AIN Channel

  • The "in raw" value is always taken directly from the adc

  • The standard resolution is between 0 to 4095 at 0 to 3.3 V with an imx6ul/ull. 

in calc V 

Calculated Value in V of Channel depending on max. resolution and max. Voltage

(in calc V:= in raw* (max voltage / max resolution)

  • The standard resolution is between 0 to 4095 at 0 to 3.3 V with an imx6ul/ull. 

  • The parameters (max resolution, max voltage) can be adjusted if there is used a custom circuit on the input of adc for other voltage ranges (ex. voltage divider).

  • ex. imx6ul/ull eval baord

    • Max Resolution: 4096

    • Max Voltage: 25.8

    • image2022-2-1_8-22-20.png

    • image2022-2-1_8-25-14.png

Hardware

SOM Evalboard:

HW Port

CODESYS Device Name

AIN1  (X19)

'/sys/bus/iio/devices/iio\:device0/in_voltage3_raw'

AIN2  (X19)

'/sys/bus/iio/devices/iio\:device0/in_voltage8_raw'

Additionaly AIN Channels can be added on a custom SOM Board modifing the Device Tree File.

Remarks

Use a seperate Buscycle for the AIN, the reading in the BusCycle can lead to jitter.