Advanced Search
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
May 20, 2012, 02:28:35 AM
Home
Help
Calendar
Login
Register
News
: Welcome to GLomation peer support forum
Glomation
»
Peer Support Forums
»
GESBC-9260
»
Setting GPIO output
« previous
next »
Pages: [
1
]
Topic Tools
Topic Tools
Send this topic
Print
July 28, 2011, 10:15:05 AM
#0
SteveMartins
SteveMartins
Show SteveMartins's last posts.
Show general stats for SteveMartins.
Super Hero
Posts: 27
Setting GPIO output
Hi,
I'm looking for a quick and easy way to change a GPIO input to output, drive it high, then set it back to input. and ideas?
thanks,
Steve
July 28, 2011, 05:26:37 PM
#1
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
Re: Setting GPIO output
Upgrade the kernel to 2.6.30 and up, use the built-in GPIO driver. Examples here
https://www.ridgerun.com/developer/wiki/index.php/How_to_use_GPIO_signals
September 07, 2011, 11:12:13 AM
#2
AwareWolf
AwareWolf
Show AwareWolf's last posts.
Show general stats for AwareWolf.
Super Hero
Posts: 16
Re: Setting GPIO output
I have upgraded to kernel 2.6.30, and am attempting to follow the instructions from the page you linked to, and have it a wall at step 1. Apparently there should be a folder at /sys/class/gpio with files in it. In my kernel, there is no folder called gpio under /sys/class. Did I build the kernel wrong?
September 07, 2011, 03:14:07 PM
#3
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
Re: Setting GPIO output
Check if sysfs option is enabled in kernel configuration.
September 12, 2011, 12:47:45 PM
#4
AwareWolf
AwareWolf
Show AwareWolf's last posts.
Show general stats for AwareWolf.
Super Hero
Posts: 16
Re: Setting GPIO output
Still struggling.
I now have a sys/class/gpio folder, with these contents:
export gpiochip32 gpiochip64 gpiochip96 unexport
I type echo 82 > /sys/class/gpio/export in the command prompt.
Nothing happens: I DON'T have a /sys/class/gpio/gpio82 folder.
I am using kernel version 2.6.30
Any help would be appreciated.
September 16, 2011, 08:17:17 AM
#5
AwareWolf
AwareWolf
Show AwareWolf's last posts.
Show general stats for AwareWolf.
Super Hero
Posts: 16
Re: Setting GPIO output
Still struggling.
I found that SOME of the GPIO pins will export. I tried every pin between 0 and 140, which is to say I did the equivalent of :
for (i=0, i<141, i++)
echo i > /sys/class/gpio/export
The result was that I got SOME folders, like /sys/class/gpio/gpio39. In total, I got 33 of them:
39, 42, 43, 55, 56, 57, 58, 59, 60, 61, 72, 73, 74, 75, 76, 77, 83, 84, 85, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 108, 109, 110, 111
So the first question is, why did some pins export but others not? Maybe the Kernel is using some and doesn't want to give them up?
The other question I have is, which GPIO pins correspond to which pins on the GESBC9260S J16 header? For instance, I have an LED on pin 13 of J13, which should be GPIO PB18, right? and PB18 should correspond with /sys/class/gpio/gpio82? (64 + 18 = 82).
Any insight would be appreciated.
September 16, 2011, 09:00:13 AM
#6
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
Re: Setting GPIO output
The Atmel processor has many peripherals mutiplexed on the GPIO pins. The kernel configuration plays an important part as which pin is available for GPIO. Upon receiving GPIO request the GPIO driver will check configuration register of the GPIO block to determine if a pin can be used as GPIO. The GESBC-9260S user's manual has a table listed the pins of the GPIO header and their multiplexed functionalities. Unfortunaltely the information does not translate directly into which kernel configuration item affects which pin. The easiest thing to do is to choose the GPIO pins that is already available with current kernel configuration. If more pins are needed then you need to dig into kernel source to find out which peripheral dirver uses which pin and disable that driver if it is not used in your application.
September 29, 2011, 02:43:18 PM
#7
AwareWolf
AwareWolf
Show AwareWolf's last posts.
Show general stats for AwareWolf.
Super Hero
Posts: 16
Re: Setting GPIO output
OK, I understand.
I've got almost all that I need; but would love to have PB16 (TK0 & TCLK3), PB17 (TF0 & TCLK4), and PB18 (TD0 & TIOB4). Is there anyone listening here who knows the right kernel config item to get those back? I'm using 2.6.30.
October 04, 2011, 07:31:38 PM
#8
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 342
Re: Setting GPIO output
Attached is a 2.6.38.4 version kernel that should have GPIO function working on PB16, PB17, and PB18.
uImage-2.6.38.4-10-5-2011
(1695.07 KB - downloaded 21 times.)
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Announcements
=> General Discussion
=> Programming Tips, Recommendded Readings, etc.
-----------------------------
Peer Support Forums
-----------------------------
=> GESBC-9302
=> GESBC-9260
=> GESBC-9G20
=> GESBC-2440
=> GESBC-9315
Loading...