I'm using a script to read an ADC 1000 times:
root@imx6ul-var-dart:~# cat adc.sh
#!/bin/sh
for i in `seq 1 1000`;
do
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw > /dev/null
done
It takes just over 11 seconds to run so just under 100 samples per second.
root@imx6ul-var-dart:~# time ./adc.sh
real 0m 11.32s
user 0m 0.22s
sys 0m 1.08s
root@imx6ul-var-dart:~# time ./adc.sh
real 0m 11.34s
user 0m 0.21s
sys 0m 1.27s
I can cope with the slow sample rate but why does it take 10-20% cpu?
I found similar results using stdio to read in_voltageY_raw data from a c program.
Is there a less processor intensive way to read the ADC? It's currently consuming around 500k processor cycles to read a 12 bit number from hardware.
Hi Chris,
In you are using a Variscite board, you may consider directly contact them:
Variscite Support Center - Variscite
As complementary informaiton, you could take a look to the following threads:
Hope this will be useful for you.
Best regards!
/Carlos
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
-------------------------------------------------------------------------------