Jump to content
  • 0

reading XADC from user space


HelplessGuy

Question

Hello everyone,

I am having a Zybo Z7-20 Board and I want to read from the XADC the digitalized voltages as fast as possible in my embedded linux (petalinux 2018.2)-environment.

In my eyes I should read the voltages directly from user space. My problem now, if I read with my application code from /dev/iio:deviceX I only get rubbish or nothing.

I know that it is necessary to add sometimes librarys to read from user space. Is it also in this case possible and if yes which library do I have to add? Or is there a much more simple way?

Btw I already created a driver and it is working, but to slow because opening/closing is taking in my case to much time.

 

Thanks for every help!

Greetings from the helpless guy

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi @HelplessGuy,

My understanding is after you have a working hardware platform you then use the same version of petalinux as your Vivado/SDK to convert the project into a petalinux platform. The PetaLinux Tools Documentation Reference Guide should be a helpful pdf.  Are you able to use the XADC for the Zybo-Z7-20 in vivado/sdk? Here is a thread that does this for the Zybo which should be the same process for the Zybo-Z7-20. The Petalinux Support for Digilent Boards table also has completed petalinux projects for the Zybo-Z7-20 that should be helpful references.

thank you,

Jon

 

 

 

 

Link to comment
Share on other sites

>> because opening/closing is taking in my case to much time.

This just as an unspecific comment: A common solution for being able to start data acquisition "immediately" is to keep it running continuously, e.g. into a circular buffer. The start time then just becomes an index into the buffer. With typical industrial test equipment, it goes as follows:

- I arm the instrument. It starts sampling into a buffer
-Once sufficient pre-trigger samples are available, the instrument returns it's ready to accept a trigger
-I trigger the measurement
-internally, it looks back in time , according to its own processing delay etc and calculates the index into the buffer that corresponds to the trigger time

We're not exactly beating causality but it's the next best thing...

Also, I would think twice before using Linux for a problem that may turn out to be hard real-time. Those issues can become nasty when it looks like a sporadic glitch that I can solve later, and finally realize it's conceptual. At least study the capabilities of the IP / libraries you intend to use. The XADC itself is a fairly precise piece of hardware.

Link to comment
Share on other sites

Hi @xc6lx45 @jpeyron

to explain my problem specific. I made some experiments and found out that the cycle for opening and closing the file (created through the driver in /sys/bus/iio/devices/iio:deviceX) is taking about 60us. But I want to read the voltages with 6.42us. This is absolutly to slow. So I am looking for another way to read these voltages out.

That there are much more problems with an Embedded Linux system in hard real-time, I know but I find nowhere informations doing this.

Especially reading from /dev/iio:deviceX isn't delivering right informations. Also loading configurations of the XADC to this directory is not working. Is there something like a library missing. Or do I have to enable in the Petalinux Configurations something more than the XADC?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...