Problem with GPIO on Beagle Board

Hi,

It is strange that when I try to access the GPIO-136,156,157,158,159
which are on expansion connector pin no. 9, 20, 22, 12, 8.

I find that pin no. 9 is logic low and the corresponding GPIO register
bit shows 1. The opposite goes with the rest of the four pins and
registers i.e. pin shows logic high and the bits show low. even when i
try to short them to ground I do not find any change in the GPIO
register bit values. Why these pins are not getting controlled.

The program to use these pins is on the following guidance :

http://linuxjunk.blogspot.com/2009/01/beagleboard-gpio-input-driverless.html

Has any one else seen this before? Please reply

regards

Mohit

Hi mohit,
Do you know about pinMuX?
Do we need to set the pinmux before using a gpio as i/o ?
Even i wrote a following this site…
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#Getting_access_to_a_GPIO
try this and tell me if it is working for you… its very simple…

The example that I have shown uses pin mux in the configuration parameters …

In my example the driver is avoided so all those settings are to be done…

regards

mohit

Hello Mohit,
the value 0x011C011C has its meaning described in the "Table 7-7 - Pad
Configuration Register Functionality" of BB's processor datasheet from
TI.
Bits 4 and 20 of the registers define if the GPIO will be pullup or
pulldown. So, if you set them all the same, they should all be the
same.
The bits of GPIO5 can be set as outputs using register 0x49056034
(GPIO_OE) and to control the values, you can use register 0x4905603C
(GPIO_DATAOUT).
Regards,
Frederico

Hi Frederico,

the value 0x011C011C means both the pull bits are 1 which means that : Pullup selected and activated if pin is NOT configured as
OUTPUT

Now I am configuring it as input only through my code… If you look carefully into the code in the link :

http://linuxjunk.blogspot.com/2009/01/beagleboard-gpio-input-driverless.html

you will find that if pin 3 is shorted then

gpio[0x6038/4] == 201390076 = 0X0C00F7FC

or else

gpio[0x6038/4] == 201392124 = 0x0C00FFFC

But in both the cases :

bit 31,30,28 and 28 even though being pulled up show “0000” … I dont understand this… I have seen it on minicom

regards

mohit

Hello Mohit,
that is right! All the ones WHICH WERE SET were set as pullup.

you will find that if pin 3 is shorted then
gpio[0x6038/4] == 201390076 = 0X0C00F7FC
or else
gpio[0x6038/4] == 201392124 = 0x0C00FFFC

That is correct! I have just check that here...

But in both the cases :
bit 31,30,28 and 28 even though being pulled up show "0000" ... I dont
understand this...

If you are using the code which you have mentioned on the website. You
have never set bits 31, 30 and 28. They are PINs 18, 12 and 22 in the
expansion header respectively. So, I can't say the value that they
will show.
That is what you have set, isn't?

// Configure Expansion header pins as input.
  pinconf[0x2158/4] = 0x011C011C; //gpio 131 & 130 = PINS 19 & 21
  pinconf[0x215C/4] = 0x011C011C; //gpio 133 & 132 = PINS 15 & 17
  pinconf[0x2160/4] = 0x011C011C; //gpio 135 & 134 = PINS 11 & 13
  pinconf[0x2164/4] = 0x011C011C; //gpio 137 & 136 = PINS 7 & 9
  pinconf[0x2168/4] = 0x011C011C; //gpio 139 & 138 = PINS 3 & 5
  pinconf[0x216C/4] = 0x011C011C; //gpio 141 & 140 => not in the
expansion header
  pinconf[0x2170/4] = 0x011C011C; //gpio 143 & 142 => 143 = PIN 8
  pinconf[0x2188/4] = 0x011C011C; //gpio 155 & 154 => not in the
expansion header

I hope that helps you.
Regards,
Frederico

Hi Frederico,

Thanks a lot for pointing my mistake. I will make the corrections and let you know.

Thanks again

regards

Mohit