An adc using an imx6ull processor enables continuous acquisition through a buffer at a fixed frequen

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

An adc using an imx6ull processor enables continuous acquisition through a buffer at a fixed frequen

1,249 Views
hyw666
Contributor I

We want to use ADC for fixed-frequency downsampling, and we want to use IIO buffer interface to meet our requirements. After the CONFIG_IIO_SYSFS_TRIGGER=y is enabled in the kernel configuration, the corresponding interface appears. As shown in the picture below:

1.png

After our tests, the cache is now available, and the maximum available sampling frequency provided by the system is 206250, as shown in the figure below:

2.png

But now we need a higher sampling frequency. Through reading the manual, we know that the maximum sampling frequency of the development board is 1MHZ. How should we set this?

3.png

 The current device tree configuration is as follows:

4.png

5.png

 Thank you!

0 Kudos
Reply
4 Replies

1,163 Views
jimmychan
NXP TechSupport
NXP TechSupport

could you tell me which version of BSP are you using?

0 Kudos
Reply

1,014 Views
hyw666
Contributor I

# The test procedure is as follows:

# Test buffer cache for ADC continuous acquisition
# First make sure iio_sysfs_trigger is enabled by the kernel
# The sampling frequency available in the driver is as follows:
206250 58098 29676 15000 7541

Currently test 58098 29676 15000 7541 available, 206250 will cause a stuck situation.

# The test procedure is as follows:
# 1. Jump to devices
cd /sys/bus/iio/devices

# 2. Create a trigger
echo 0 > iio_sysfs_trigger/add_trigger

# 3. trigger write
cat trigger0/name > iio:device0/trigger/current_trigger

# 4. Check the trigger
cat iio:device0/trigger/current_trigger

# 5. Enter the iio device
cd iio:device0

# 6, Change the sampling frequency (default sampling frequency is 58098)
echo 206250 > in_voltage_sampling_frequency

# 7. Check the sampling frequency
cat in_voltage_sampling_frequency

# 8. Enable scanning
echo 1 > scan_elements/in_voltage3_en

# 9. Check the scan
cat scan_elements/in_voltage3_en

# 10. Cache size settings
echo 1024 > buffer/length

# 11. Enable cache
echo 1 > buffer/enable

# 12. Close the cache
echo 0 > buffer/enable

# 13. Check available data
cat buffer/data_available

# 14. Print data
hexdump -e '"iio0 :" 8/2 "%04x " "\n"' /dev/iio:device0

0 Kudos
Reply

990 Views
hyw666
Contributor I

We are based on nxp's uboot version 2020.10, kernel version 4.19.35, and debian system customized by the image-builder project.

Item description Address:

23. 构建野火鲁班猫镜像 — [野火]嵌入式Linux镜像构建与部署——基于LubanCat-i.MX6ULL-MP157开发板 文档 (embedfire.com)

Project source code:
https://gitee.com/Embedfire/ebf-image-builder.git

Kernel source address:

Embedfire/ebf_linux_kernel at ebf_4.19.35_imx6ul (github.com)

Uboot source address:
Embedfire/ebf_linux_uboot at ebf_v2020_10_imx (github.com)

0 Kudos
Reply