VF61 ADC Driver

Hi,

I´m planning to use ADC0 channel 8 and ADC1 channel 8 to sample voltage and current waveforms. Under directory /sys/bus/iio/devices/iio:device/scan_elements/ I have several files including in_voltage8_en. I think that I have to write 1 in this file to enable sampling in channel 8 but when I try do write 1 I get the following error message:

root@colibri-vf:/# echo 1> /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage8_en

-sh: echo: write error: Invalid argument

The only value that I can write whithout error is 0 but even when I write 0 to this channel I’m still able to read samples in voltage_8_raw. It´s seems that the pin is always enabled. Is this correct ?

Thanks

Daniel

The error was solved by adding a space between 1 and > signal. Sorry for the inconvinience.

Thanks for clearing that up. It is kind of a ugly part of the command line syntax. 1> is actually valid, and redirects stdout to stdout… What in the end happens is that a newline character gets written into that sysfs file, which seem to be an invalid argument… :slight_smile:

How can I enable more than one channel to scan? Every time that I try to enable more than one channel I got na error.

Thanks

Hm, I am not entirely clear why that fails. Could you create a new question and provide some additional information such as how you enable more then one channel and what error you receive? Thanks!