OpenWrt Forum Archive

Topic: GPIO pin hunting

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Is there some method to the madness of finding a GPIO location on a board?

I have been trying to figure out if GPIO 2 & 3 are available on the WRTSL54GS board.

I've turned on all GPIO 0 through 7 and then gone hunting with my voltmeter looking for signal. There are pairs of contacts near the CPU like RA9 and RA10 that look like they could be... but no.

I was thinking it would be great to find these apparently unused lines and use say GPIO 2 for a 1-Wire interface, and maybe GPIO 3 for something else.

I do find it a bit odd though there's a USB LED at LEDC11 that stays lit all the time with OpenWRT v0.9 and it's apparently not regulated by a GPIO line, something else has it locked on.....  Perhaps this is one of my missing GPIO and it's been left high during initialization, or otherwise out of reach?  *sigh*

(Last edited by vincentfox on 9 Jun 2007, 09:26)

Follow up to my own question.

I brute-forced my way through it with a script that toggle all GPIO on for 5 seconds then off for 2 seconds. Probing around with a voltmeter I eventually found them.  I put the black lead into the GND of the serial port and poked at contacts with the red one.

The pattern seems to be look for open pairs of pins marked RA(number).  In my case I found them at locations on the back of the board:

GPIO2=RA59
GPIO3=RA60

Hi vincentfox,
can these GPIOs used as an inputs? Im novice, pls. help me with some C codes how to write and read from a GPIO.
tnx in advance.

If you look at the table here:
http://wiki.openwrt.org/OpenWrtDocs/Har … ea5c612fb4

You'll see at least pins 4 and 6 are already inputs.  I have no idea if you can use pins that are normally output, as input instead. Most people doing this before, were just doing the SD-card mod so they only needed a single input pin and would hijack one of the existing ones.

Many other routers there's not a full map, always a couple unknown.  I'm pleased at just having found all of them on this model.

If you want some code examples, I suppose the mmc.c code would be the place to start.  Or maybe look at the GPIO utility I used in the first place to find these points.  I am not a developer so I can't help you much.

(Last edited by vincentfox on 29 Jun 2007, 18:17)

You'll see at least pins 4 and 6 are already inputs.  I have no idea if you can use pins that are normally output, as input instead.

this is usually one of the distinctive features of gpio (yes, you can)

How the GPIO pins are set as Input or Output? Is there any configuration register?

MBM I need your help. can I use a single GPIO as input and as well as output on the fly?

Yes, you can.

All the GPIO pin on the board which can be controlled with software can do the input or output job as your mind.

Thanx. ghoulr
I'm new to this, can you help me with some C source codes smile

Is there anyone can help me in this regard?

Hi,

does it give News in this Topic?


By.

I think it might be useful to point out what GPIO stands for:  General Purpose Input/Output
I have been thinking that the "unfound" GPIO ports are actually used as UARTs to drive the serial connection, does anyone know if this is the case, or if the Broadcom BCM5352 has dedicated UART pins?
Side question, can anyone explain Broadcom's rationale behind not releasing the datasheet for this chip?  I absolutely don't understand why they don't want engineers to be able to get a hold of this and design systems using their chip.

The discussion might have continued from here.