As a quick speed comparison on the BeagleBone Black.
If you program a GPIO line to just toggle up and down in a loop .

In Python, using the file system I/O, the line will toggle up and down at 
about 6 kHz.

If you program in C, under Debian, using a tight loop to toggle the line up 
and down
on memory mapped I/O, the line will toggle up and down at about 2.2 MHz.
Almost a 3 orders of magnitude improvement.

I have read, that in assembler on the PRU, you can get it to toggle at 200 
MHz, another
two orders of magnitude.

So, if you are doing something where response time in the milliseconds is 
good enough
then Python is great.  If you are teaching kids to program, then Python 
seems great.

If you are looking for response times in the microseconds, then
you need to be closer to the metal with something like C.

If you are looking for an example of a C I/O library for BBB GPIO,
and some off the peripherals, including the ADC, then look at:

https://github.com/VegetableAvenger/BBBIOlib

--- Graham



On Sunday, November 2, 2014 5:10:18 PM UTC-6, Curt Carpenter wrote:
>
> Hello.
>
> I am trying to figure out how to use I/O with my BBB running Debian, but 
> the more I try the more confused I get.  For example:  I try to read the 
> analog inputs using information I find on the web.  Per instructions, I 
> enter
>
> echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots
>
> which indeed adds something to slots.  Then the instructions say to enter 
>
> cat /sys/devices/ocp.2/helper.11/AIN1
>
> but I discover that there is no directory named "ocp.2" in /sys/devices, or 
> anywhere else that I can
> find.  There is an ocp.3, but it doesn't contain "helper.11" ...  and so on.
>
> 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.
>
> 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?  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?
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to