IMX.6UL ADC example program

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX.6UL ADC example program

1,158 Views
jonasnyberg
Contributor III

Hi all,

We have a project that involves reading one ADC channel at a maximum ~1KHz rate.

Does anyone know of any example C code for this that utilizes the VF610_adc.c driver directly?

What I've understood is that reading the in_voltageX_raw file directly from Linux is slow and takes up a lot of resources.

Kind regards,

Jonas

Labels (1)
Tags (2)
4 Replies

534 Views
lategoodbye
Senior Contributor I

Hi Jonas,

it's correct reading the raw ADC values via sysfs isn't efficient. In case you use a newer kernel there is also the IIO buffer and IIO trigger interface which may fits better.

Regards

Stefan

0 Kudos

534 Views
jonasnyberg
Contributor III

Hi Stefan,

Thanks for your reply. My kernel version is 4.1.15, do you have any idea if this is new enough?

Where do I find the IIO buffer and trigger and how do I read them?

Thanks in advance,

Jonas

0 Kudos

534 Views
lategoodbye
Senior Contributor I

Yes, 4.1.15 should be sufficient. Please look at one of the many presentations about linux-iio. There are also example tools within the linux sources.

0 Kudos

534 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Jonas

please check FreeRTOS examples

Board Support Packages (7)
SDK2.2_iMX6UL_WIN(REV SDK2.2)
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-processors/i.mx-6-pr...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------