GPIO Speed

111 views
Skip to first unread message

freddyglima

unread,
Apr 6, 2010, 5:51:56 AM4/6/10
to Beagle Board
Hello everybody!

I have got a blinking LED program for beableboard in the folowing
website:
http://blog.makezine.com/archive/2009/02/blinking_leds_with_the_beagle_board.html

I have done small changes. I remove, for example, the "sleep 1"
between echo "high" and echo "low". That way, I thought the frequency
would increase. It does increase but it still too low. It is only a
125Hz pulse clock in the expansion pin 168.

Is there anyway to increase this speed?

The program used is:


#!/bin/sch
#
# Blink the onboard LED
# GPIO=$1
cleanup() { #Release the GPIO port
echo 168 > /sys/class/gpio/unexport
exit
}

# Open the GPIO port
#
echo 168 > /sys/class/gpio/export
#trap cleanup SIGINT # call cleanup on Crtl-C

# Blink forever
while [ "1" = "1" ]; do
echo "high" > /sys/class/gpio/gpio168/direction
echo "low" > /sys/class/gpio/gpio168/direction
done
cleanup # call the cleanup routine


Thanks!

Michael Zucchi

unread,
Apr 6, 2010, 8:47:36 AM4/6/10
to beagl...@googlegroups.com
On 6 April 2010 19:21, freddyglima <fredd...@googlemail.com> wrote:

> Is there anyway to increase this speed?

> #!/bin/sch

Err, don't use a shell script and file i/o to talk to the hardware?
You've probably chosen the slowest and least appropriate language
imaginable to try to do anything fast.

I'm not sure if you have to go to the kernel or can just mmap the i/o
space and write to it directly, but you should be able to get mhz out
of it using C. Even python or just about anything else would probably
be faster than what you have.

What for anyway? Just to see if it can be done, or to do real stuff with it?

!Z

吴臻志

unread,
Apr 6, 2010, 11:41:40 AM4/6/10
to beagl...@googlegroups.com
freddyglima:
 
I have done a test just like your's by controlling GPIO using register direct access under DSP in OMAP3530. I just using a for loop to pull up and pull down the pin. It shows square waveform about more than 1Mhz  on oscillometer. You can also do that thing at the linux kernel and it'll be same.
 
Best wishes.

             
2010/4/6 Michael Zucchi <not...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagl...@googlegroups.com.
To unsubscribe from this group, send email to beagleboard...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.


Reply all
Reply to author
Forward
0 new messages