Page 1 of 1

sama5d27 som ek1 operate ADC at lower sampling frequency

Posted: Thu Jun 18, 2020 9:55 am
by yawimiki
Hi everyone,
I have atsama5d27-som1-ek1 development board. I am trying to capture 2kHz sinusoidal signal with lowest sampling frequency with one channel. so, this is how I configured my adc channel_6 to do the job,

Code: Select all

"echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage6_en"
"echo fc030000.adc-dev0-external_rising > /sys/bus/iio/devices/iio:device0/trigger/current_trigger"
"echo 200000 > /sys/bus/iio/devices/iio\:device0/sampling_frequency"
"echo 1024 > /sys/bus/iio/devices/iio:device0/buffer/length"
"echo 128 > /sys/bus/iio/devices/iio\:device0/buffer/watermark"

"echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable"
since I am using DMA, I configure the continuous mode

Code: Select all

"devmem2 0xfc0300C0 w 0x6"
I save all the data in memory first for short period of time and I save them in text file, but with this configuration, I cannot get a clean sinusoidal signal,please refer Image image,

But, if I change the configuration of ADC as follow, I get clean sinusoidal signal, please refer good image.

Code: Select all

"echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage6_en
echo fc030000.adc-dev0-external_rising > /sys/bus/iio/devices/iio:device0/trigger/current_trigger
echo 20000000 > /sys/bus/iio/devices/iio\:device0/sampling_frequency
echo 409600 > /sys/bus/iio/devices/iio:device0/buffer/length
echo 16384 > /sys/bus/iio/devices/iio\:device0/buffer/watermark
echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable
devmem2 0xfc0300C0 w 0x6"
Please tell me if I have missed something here, I need to capture this signal at 200khz sampling frequency.
Thank you,