Thank you for the detailed reply Joshua.  

I'm still mystified by the documentation, and come to the BBB from OS-free 
environments where everything is done at the register level, and almost 
everything one needs to know is in the data sheet/TRM.  I'd like to impose 
on you with one more question if I can
(this is not a rant!  Trying to get organized).

I found (stumbled on) an article on reading the analog inputs on the web 
that works:

   echo BB-ADC > /sys/devices/bone_capemgr.*/slots
   cd /sys/bus/iio/devices/iio:device0
   cat in_voltage0_raw

Am I correct in understanding that there is no documentation that would 
have pointed me to the /sys/bus/iio/devices/iio:device0
directory and given me some guidance on what it contained?   

I have the feeling that the docs ARE there, I just haven't located the 
mother ship yet :-)

I haven't tried python or bonescript:  sticking with C/C++ until I learn my 
way around the BBB first before I tackle the added complication of a new 
language.  If I were to shift to python though, is there any particular doc 
I would read to learn how to do something like use the device tree and the 
A/Ds?  If so, I might abandon C just in the interest of working on a 
stable, documented software platform.  

Appreciate your help and advice.
Regards,
Curt

  

On Monday, November 3, 2014 9:17:01 AM UTC-6, Joshua Datko wrote:
>
>
>
> Curt Carpenter <[email protected] <javascript:>> writes: 
>
> > I keep searching for some sort of definitive guide to using the IO 
> > capabilities of the board, but have had no luck.  There is nothing on 
> > software in the SRM, and memory-mapping to the registers described in 
> > the data sheet seems to be frowned upon. 
>
> I know of no definitive guide. There are some well written blog posts 
> but as with anything on the Internet, it's important to consider the 
> date it was published. 
>
> The bonescript analogRead module can handle this, so you could do all 
> this from the Cloud9 browser IDE. If you want to use javascript that is, 
> I prefer python (see next question). 
>
> > 
> > Can anyone point me to an entry point into all these mysteries? 
> > Where do I go to find the definitive guide to reading the analog 
> > inputs under Debian, for example? 
>
> Anytime I've done ADC on the Bone I've used this python library: 
> https://github.com/alexanderhiam/PyBBIO. 
>
> The python snippet is something like this: 
>
> import Adafruit_BBIO.ADC as ADC 
> ADC.setup() 
> ADC.read(self.pin) 
>
> > What commands are available?  Why 
> > would anyone want to use file IO to do simple GPIO operations when it 
> > is so much faster to just memory-map the GPIO registers? 
>
> This question seems to arise quite often and there are a few "right" 
> answers. To me, directly using memory-map regions breaks down a certain 
> level of software and Linux abstractions. An analogous question, 
> perhaps, is: Why not just run everything as root? By using Linux from 
> userspace, you are sacrificing some of the performance but you gain the 
> ability to use a myriad of third-party libraries and your choice of 
> programming language. 
>
> You probably would get better performance if you made your own kernel 
> module for whatever you were trying to do, but that may not be the 
> easiest route if you just want to read an analog value. 
>
> Hope some of this helps, 
>
> Josh 
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to