How to program GPIO in BBxm

Hi ,
I buy a new BB xm,but Iam a new software guide. I would like to know
how to program any GPIO high or low in BB.
Thanks!

Duncan

Hi Duncan,

I buy a new BB xm,but Iam a new software guide. I would like to know
how to program any GPIO high or low in BB.

The first advise is to read this: How To Ask Questions The Smart Way

The second advise is google for beagleboard and GPIO. You will find a
lot of useful information.

The third advise is to formulate your question more precise. What
exactly do you understand by "program"? What are your requirements or
use-case? How often do you want to turn it on and off? How precise
should it be? What language do you want to use for it? Will shell
script be enough?

Finally, recently I was dealing with the similar topic and write an
article about my findings:

Hi Andrey,
Thanks for your support!
I just want to practice a simple software code relative to
hardware,because I am a hardware engineer.
This is the first time that I modify a software code to control
hardware signal.
I hope I can fully understand all of the software control flow from
driver to applivation program.
I will study hard to understand how to control SOC from software
driver.
I am glad to get any suggestion from you.
Thanks!

Duncan

Hi Duncan,

I just want to practice a simple software code relative to
hardware,because I am a hardware engineer.

As a hardware engineer you will probably know exactly what kind of
signals you want to generate with GPIO. So I still suggest to
formulate your requirements more precisely to find the most
appropriate solution.

Maybe the following example will help you to start:
http://blog.makezine.com/archive/2009/02/blinking-leds-with-the-beagle-board.html

Regards,
Andrey.

Hi Andrey,
I got the GPIO source code in the path arch/arm/plat-omap/gpio.c,
But the content doesn’t describe the GPIO of DM3730.
It just describe the GPIO of OMAP processor.
How do I get the GPIO source code of DM3730?

Thank you for your help!

Duncan

2011/9/30 Andrey Nechypurenko <andreynech@googlemail.com>

Hi Duncan,

I got the GPIO source code in the path arch/arm/plat-omap/gpio.c,
But the content doesn't describe the GPIO of DM3730.
It just describe the GPIO of OMAP processor.
How do I get the GPIO source code of DM3730?

The only thing I can suggest here is to look at corresponding
documentation and find out which OMAP pins are exposed on the board. I
personaly never worked with DM3730.

Regards,
Andrey.

Hi Andrey,
Okay,Thanks!

Duncan

2011/10/17 Andrey Nechypurenko <andreynech@googlemail.com>

Hi Duncan,

If you intended to write your own driver to control the the GPIO on
the BB-xM, then I can give a few advices since I just did that and
it's still fresh in my memory, these are the few steps to output
something at GPIO_139, pin3 of main expansion header of BB-xM:

1. choose the GPIO you want from the beagle board datasheet:
http://beagleboard.org/static/BBxMSRM_latest.pdf
I used the Main Expansion Header from Figure 51. Main Expansion Header
Processor Connections
. Referring to Table 22. Expansion Connector Signals, you know that
pin 3 is connected to GPIO_139.

2. Now we need to study on how to play with GPIO_139, so download the
Technical Reference Manual of DM3730: http://www.ti.com/litv/pdf/sprugn4n.

3. GPIO_139 share pin with other functions. So read on how to
configure the pad multiplexing register to set GPIO_139 as
GPIO(Mode4), 13.4.4 Pad Functional Multiplexing and Configuration.

4. Read on how to configure the GPIO to output some data. Chapter 25
General-Purpose Interface.

Also, you need to learn about the basics on writing a device driver:
http://tldp.org/LDP/lkmpg/2.6/html/
http://lwn.net/Kernel/LDD3/

Hope this helps..

Hi Noge,
Thank you very much!
I will study the information.
Thanks again!

Duncan

2011/10/18 Noge <tanjunrong@gmail.com>