Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support high speed sampling on i.MX6ul ADCs #117

Open
markfeathers opened this issue Aug 16, 2024 · 3 comments
Open

Support high speed sampling on i.MX6ul ADCs #117

markfeathers opened this issue Aug 16, 2024 · 3 comments

Comments

@markfeathers
Copy link
Contributor

Test with example high speed ADC:
https://community.nxp.com/t5/i-MX-Processors/An-adc-using-an-imx6ull-processor-enables-continuous-acquisition/m-p/1719805

@ts-kris
Copy link
Contributor

ts-kris commented Aug 17, 2024

Looks like this is a module in both 5.10 and 6.6, in both full and minimal defconfigs, iio-trig-sysfs

Do we want to make it a builtin, or just document its use?

@markfeathers
Copy link
Contributor Author

Looks like I missed that, but we should test & document to get the higher speed ADC support.

@markfeathers markfeathers changed the title Add CONFIG_IIO_SYSFS_TRIGGER to 6ul defconfigs Support high speed sampling on i.MX6ul ADCs Oct 2, 2024
@markfeathers
Copy link
Contributor Author

Took a quick swing at this while testing another i.MX6ul ADC issue. This is sort of working, but has a surprising side effect. It only supports a single channel.

# Add trigger device
modprobe iio-trig-sysfs
echo 0 > /sys/bus/iio/devices/iio_sysfs_trigger/add_trigger
echo "206250" > /sys/bus/iio/devices/iio\:device2/in_voltage_sampling_frequency
iio_readdev -t trigger0 -s 1024 -b 1024 iio:device2 voltage0 > samples.bin

The iio interface should permit us to do this:

iio_readdev -t trigger0 -s 1024 -b 1024 iio:device2 voltage0 voltage1 voltage5 voltage8 voltage9 > samples.bin

But this fails with:

Unable to allocate buffer: Invalid argument (22)

Ultimately right now we cannot enable multiple channels as scan elements and I'm not sure why:

root@tsimx6ul:~# echo 1 > /sys/bus/iio/devices/iio\:device2/scan_elements/in_voltage0_en 
root@tsimx6ul:~# echo 1 > /sys/bus/iio/devices/iio\:device2/scan_elements/in_voltage1_en 
-bash: echo: write error: Invalid argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants