Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-28 Thread Robert Nelson
On Mon, Mar 28, 2016 at 5:05 PM, Audrey wrote: > Hi, > > So I finally had the time to upgrade my beaglebone, and it now has this > kernel: 4.1.18-ti-r53 > > However, now, a lot of the directories and stuff have changed. I can't even > enable the adc (echo cape-bone-iio > /sys/devices/bone_capemgr.

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-28 Thread Audrey
Hi, So I finally had the time to upgrade my beaglebone, and it now has this kernel: 4.1.18-ti-r53 However, now, a lot of the directories and stuff have changed. I can't even enable the adc (echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots) because there is no longer any folder called bon

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-23 Thread Audrey
Thanks! On Monday, March 21, 2016 at 4:06:10 PM UTC-4, RobertCNelson wrote: > > On Mon, Mar 21, 2016 at 2:52 PM, Audrey > > wrote: > > Thanks John, do you know where to get kernel 4.1? This is the only place > I > > know that has beaglebone images, but they don't specify which kernel > each

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-21 Thread Robert Nelson
On Mon, Mar 21, 2016 at 2:52 PM, Audrey wrote: > Thanks John, do you know where to get kernel 4.1? This is the only place I > know that has beaglebone images, but they don't specify which kernel each > version has: http://beagleboard.org/latest-images Fresh as of yesterday: 4.1.18-ti-r53 http://

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-21 Thread Audrey
Thanks John, do you know where to get kernel 4.1? This is the only place I know that has beaglebone images, but they don't specify which kernel each version has: http://beagleboard.org/latest-images I know that my beaglebone has the image BBB-eMMC-flasher-debian-7.8-lxde-4gb-armhf-2015-03-01-4g

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-20 Thread John Syne
What is your kernel version? Regards, John > On Mar 18, 2016, at 1:22 PM, Audrey wrote: > > It says: > root@beaglebone:/# echo 1 > > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en > -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No such > file or directo

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread John Syne
root@beaglebone:/sys/bus/iio/devices/iio:device0# tree . ├── buffer │ ├── enable │ ├── length │ └── watermark ├── dev ├── in_voltage0_raw ├── in_voltage1_raw ├── in_voltage2_raw ├── in_voltage3_raw ├── in_voltage4_raw ├── in_voltage5_raw ├── in_voltage6_raw ├── name ├── of_node -> ../../../.

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread Audrey
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 > buffer/enable I'm assuming that I should be able to see in_voltage0_en and buffer in the folder /sys/bus/iio/devices/iio:dev

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread John Syne
It is a driver, so you can open, poll and read from /dev/iio:device0 For a quick test, do the following: After you enable the various scan_channels, start the buffer and then do the following: dd if=/dev/iio:device0 of=~/test.txt Press ctrl-C to stop capture. Use hexdump to view the file. Re

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread John Syne
The buffer is available here: /dev/iio:device0 Because the driver uses interrupts, you won’t get the speed you want. The driver has to be updated to use DMA if you want to use full speed. Reading from the buffer will reduce your CPU load compared to using LDR_PATH because this interface blocks

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread John Syne
Yeah, that is what I thought. IIO on the 3.8 kernel didn’t have a lot of features and this is why you are having difficulty using it. I would recommend upgrading to the 4.1 kernel or even the 4.4 kernel. I personally use the 4.1 kernel, but I back ported IIO from the IIO-next kernel so that I am

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread John Syne
> On Mar 18, 2016, at 1:06 PM, Audrey 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 >From memory, echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_v

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread Audrey
Hi William, I did read that article you sent me. I was unable to follow the Driver Configuration bit, but as far as the continuous mode is concerned, after careful re-reading of the article, I think I understand that you are trying to tell me that I should be in the /dev/iio:device0 directory to

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread William Hermans
Audrey, Please read the link I gave you a couple weeks ago . . . http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#Continuous_Mode Everything you need to know to use the ADC is explained on this page. But from your last post, and the paths you've shown us. You're in the wrong dire

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread Audrey
It says: root@beaglebone:/# echo 1 > /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en -bash: /sys/bus/iio/devices/iio:device0/scan_element/in_voltage0_en: No such file or directory and I can't find scan_elements in sys/bus/iio/devices/iio:device0 root@beaglebone:/sys/bus/iio/devices/

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-19 Thread Audrey
It says: root@beaglebone:/dev# cd iio:device0 -bash: cd: iio:device0: Not a directory root@beaglebone:/dev# cat iio:device0 cat: iio:device0: Invalid argument On Friday, March 18, 2016 at 3:25:13 PM UTC-4, john3909 wrote: > > The buffer is available here: > > /dev/iio:device0 > > Because the driv

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-18 Thread John Syne
Where do you get the concept that there are two paths? From everything I know about IIO, there is only one path, /sys/bus/iio/devices/iio:deviceX, were X is the number assigned to each IIO driver loaded. There is no one-shot or continuous mode for this driver. I believe mode was removed from IIO

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-18 Thread William Hermans
Audrey, Also, if you need your samples to be taken precisely at apart. You'll have to use a PRU - Period. Linux is good for determinism at around 200ms, which often times Linux *is* faster, but it's not guaranteed, The PRU's on the other hand run outside of Linux( bare metal essentially ), and ca

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-18 Thread John Syne
Again this is wrong. The scan cycle determines the sampling rate and these samples are then fed to the fifo. As long as the interrupt services the 64 sample fifo before it overflows, then no samples are lost. In essence, the driver can easily keep up. Regards, John > On Mar 18, 2016, at 3:

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-10 Thread John Syne
> On Mar 10, 2016, at 12:51 AM, William Hermans 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

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-10 Thread William Hermans
*Question:* *So just to clarify, reading from /sys/bus/iio/devices/iio:devic**e0/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 i

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread John Syne
> On Mar 9, 2016, at 2:17 PM, William Hermans wrote: > > 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 O

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread William Hermans
> > *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 i

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread John Syne
Look at AM3358 TRM Figure 12-3 on Page 1497 Regards, John > On Mar 9, 2016, at 1:04 AM, William Hermans wrote: > > John, also Audry asked what the values of that device tree fragment mean, not > what the code was. As in Audry wants and explanation of the values: > >

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread John Syne
http://events.linuxfoundation.org/sites/events/files/slides/lceu15_baluta.pdf Regards, John > On Mar 9, 2016, at 12:58 AM, William Hermans wrote: > > Now if you want to convey more information that is actually *

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread John Syne
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-

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread William Hermans
John, also Audry asked what the values of that device tree fragment mean, not what the code was. As in Audry wants and explanation of the values: ti,chan-step-avg = <0x16 0x16 0x16 0x16 0x16 0x16 0x16>; ti,chan-step-opendelay = <0x98 0x98 0x98 0x98 0x98 0x98 0x98>; ti,chan-step-sampledelay = <0x0

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread William Hermans
Now if you want to convey more information that is actually *useful* to anyone reading this post. You can say that both voltageX_raw, and iio:deviceX are buffers. With voltageX_raw being a single value buffer that gets updated only once every open() call on it's file descriptor. Where iio:deviceX

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread William Hermans
what the hell does what you've said there even mean John ? voltagex_raw is one shot mode, iio:deviceX is continuous mode. What you said above only serves to confuse the situation. On Wed, Mar 9, 2016 at 1:32 AM, John Syne wrote: > /* > * Copyright (C) 2012 Texas Instruments Incorporated - http

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-09 Thread John Syne
/* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ /dts-v1/; /plugin/; / {

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-08 Thread William Hermans
> > *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. continu

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-08 Thread Audrey
Thanks for the reply John. Could you perhaps explain how to modify the oversample, open delay time, and sample time in greater detail in the BB-ADC overlay? I do not see these variables in the dto in github (https://github.com/beagleboard/devicetree-source/blob/master/arch/arm/boot/dts/BB-ADC-00

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-06 Thread John Syne
That is because you are doing this wrong. Reading attributes via sysfs is slow and not meant for this purpose. With IIO, you enable a scan element (echo 1 > in_voltage0_en) and then you enable the buffer (echo 1 > buffer/enable)and then you read the values from /dev/iio:device0. In the BB-ADC ov

Re: [beagleboard] bbb Internal ADC configuration settings?

2016-03-06 Thread Dieter Wirz
On Sun, Mar 6, 2016 at 9:19 AM, Audrey wrote: > Where can I find it (and set it)? > > I'm right now trying to collect voltage readings using beaglebone's internal > adc using a bash script and a while loop. Right now the data collection is > clocking at around 33 microseconds, but I know that the

[beagleboard] bbb Internal ADC configuration settings?

2016-03-06 Thread Audrey
Where can I find it (and set it)? I'm right now trying to collect voltage readings using beaglebone's internal adc using a bash script and a while loop. Right now the data collection is clocking at around 33 microseconds, but I know that the internal adc should be able to collect data as fast a