--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also another conceptual question, can you explain what exactly is in_voltage0_raw and iio:device0? I know it's not a folder, and I interact with it by using cat. So is it just like a text file or something?
William,Rather you should not comment on my replies. If I say white, you say black even when you know you are wrong.
If you look at the DT overlay the OP referenced, the additional entries don’t exist and that is why I posted an updated DT overlay. Reading in_voltagex_raw like your beaglebone-black-adc example was never meant for high speed capture. In fact you are just reading the same sample over and over again.
Reading the buffer via /dev/iio:device0 is how you are supposed to read IIO ADC samples.
If you want to understand oversampling, open delay, sample delay, then read the AM3358 TRM.
On Mar 9, 2016, at 2:17 PM, William Hermans <yyr...@gmail.com> wrote:So in other words, you do not know. But again, this is not a question i asked for myself. It's the question I interpreted Audry asking to which you completely blew off.William,Rather you should not comment on my replies. If I say white, you say black even when you know you are wrong.That's funny I was thinking the same, except your answer is wrong.If you look at the DT overlay the OP referenced, the additional entries don’t exist and that is why I posted an updated DT overlay. Reading in_voltagex_raw like your beaglebone-black-adc example was never meant for high speed capture. In fact you are just reading the same sample over and over again.
http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#One-shot_Mode No one said anything about high speed capture. But have you actually ever used one shot mode ? It is *NOT* reading the same sample over and over again. But you do have to open / close the file every time you do want a new reading. That's how it's supposed to work.Reading the buffer via /dev/iio:device0 is how you are supposed to read IIO ADC samples.
No one ask that question.If you want to understand oversampling, open delay, sample delay, then read the AM3358 TRM.
So just to clarify, reading from /sys/bus/iio/devices/iio:device0/in_voltage0_raw reads attributes using sysfs, while reading from /dev/iio:device0 reads the values using IIO? Also another conceptual question, can you explain what exactly is in_voltage0_raw and iio:device0? I know it's not a folder, and I interact with it by using cat. So is it just like a text file or something?
in_voltage0_raw == one shot mode.
/dev/iio:device0 == continuous mode.
continuous mode is only really useful if you need more than 3-4 thousand samples a second. Otherwise one shot mode will possibly work just fine. It really how much you're trying to do all at once.
Reading from /sys/bus/iio/devices/iio:device0/in_voltage0_raw is reading and attribute of the IIO driver. Reading from /dev/iio:device0 is reading from the same IIO driver, but in this case you are reading from the buffer which stores samples defined in the DT overlay above.Regards,John
On Mar 10, 2016, at 12:51 AM, William Hermans <yyr...@gmail.com> wrote:Question:So just to clarify, reading from /sys/bus/iio/devices/iio:device0/in_voltage0_raw reads attributes using sysfs, while reading from /dev/iio:device0 reads the values using IIO? Also another conceptual question, can you explain what exactly is in_voltage0_raw and iio:device0? I know it's not a folder, and I interact with it by using cat. So is it just like a text file or something?
My answer:in_voltage0_raw == one shot mode.
/dev/iio:device0 == continuous mode.
continuous mode is only really useful if you need more than 3-4 thousand samples a second. Otherwise one shot mode will possibly work just fine. It really how much you're trying to do all at once.John's answer:Reading from /sys/bus/iio/devices/iio:device0/in_voltage0_raw is reading and attribute of the IIO driver. Reading from /dev/iio:device0 is reading from the same IIO driver, but in this case you are reading from the buffer which stores samples defined in the DT overlay above.Regards,JohnTotal bullshit answer John. Which is getting to be common place from you. Sure iio:deviceX is a buffer, for continuous mode operation but in_voltageX_raw is not an fscking attribute. It's a single value buffer. What's more, your timing is impeccable. Bullshit answer right after I've already explained it. You tell me what I'm supposed to think about that.
Additionally, you go about spouting complete FUD saying that one shot mode only gives the same value over, and over again. It's very obvious you have no personal hands on knowledge here. in_voltageX_raw is refreshed every time the pseudo file is opened. That means, if you open the file, you *must* close it , then reopen in order for the value to refresh. I'll also give you another clue. In continuous mode, you have to read above 200Ksps from a single ADC channel before you start getting redundant data. So what makes you think that a very slow operation such as opening a file before reading a value is going to make the ADC's maximum samples / second any slower ? Bonus hint: it wont.
Anyway, I'm starting to feel like a 5 year old fighting over something incredibly stupid. So I'm done with this conversation. However, again. Stop spreading FUD about stuff you obviously know nothing about, and I'll stop putting it back into your face. It surely seems like you know what the iio buffer is and does, and you know what some obscure device tree values for the ADC are ( I never even knew of those ). But you definitely have no clue about one shot mode.
/** Simple LDR Reading Application
* Written by Derek Molloy for the book "Exploring BeagleBone: Tools and
* Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014
* ISBN 9781118935125. Please see the file README.md in the repository root
* directory for copyright and GNU GPLv3 license information. */
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
using namespace std;
#define LDR_PATH "/sys/bus/iio/devices/iio:device0/in_voltage"
int readAnalog(int number)
{
stringstream ss;
ss << LDR_PATH << number << "_raw";
fstream fs;
fs.open(ss.str().c_str(), fstream::in);
fs >> number;
fs.close();
return number;
}
int main(int argc, char* argv[])
{
cout << "Starting the readLDR program" << endl;
int value;
int i=1;
while (true)
{
float value = (float)readAnalog(0)/4095*1.8;
cout <<"V= " << value << endl;
cout << i << endl;
i++;
}
return 0;
}
root@beaglebone:/sys/bus/iio/devices/iio:device0# ls -l
total 0
-r--r--r-- 1 root root 4096 Mar 1 20:51 dev
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage0_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage1_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage2_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage3_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage4_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage5_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage6_raw
-rw-r--r-- 1 root root 4096 Mar 1 22:03 in_voltage7_raw
-r--r--r-- 1 root root 4096 Mar 1 20:51 name
drwxr-xr-x 2 root root 0 Mar 1 20:51 power
lrwxrwxrwx 1 root root 0 Mar 1 20:50 subsystem -> ../../../../../bus/iio
-rw-r--r-- 1 root root 4096 Mar 1 20:50 uevent
On Mar 18, 2016, at 1:06 PM, Audrey <ao...@smith.edu> wrote:Hm.Sorry, but unfortunately I'm still quite a bit lost. What should I be doing to dev/iio:device0 (open?) in order to do the following:echo 1 > in_voltage0_en
echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enableecho 1 > buffer/enable
Regards,John
Regards,John
John
<span style="font-family:He
Regards,John
Regards,John
John
<span style="font-family:He