Unable to change value of input GPIO on Beagleboard-xM with Tincantools Trainer board

I have a Beagleboard-xM with the Tincantools Trainer board. Using the
sysfs GPIO interface I can set for example GPIO 130 to output and
toggle a LED without problems. However when I make the GPIO input,
then even though I connect the pin to ground I still see a value of 1.
When I dump the mux settings in debugfs I see the following

/* gpio_130 */
OMAP3_MUX(SDMMC2_CLK, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4),

which as far as I can tell means what I'm trying should work. I'm not
an EE, but shouldn't connecting the input pin to ground at least cause
the value to go to 0?

Thanks,
Greg

Dear Greg,

If you check the schematic http://www.tincantools.com/assets/trainer_rev-b.pdf then you will see that there are level converters between the beagleboard GPIO’s and the pins on the trainer board.
You have the change not only the direction of the GPIO but also of the direction of the level converter on the trainer.
In this case you have to toggle GPIO pin 141 to make the pin an input on the trainer. (Actually you should make of GPIO 131 an input as well. to make sure that you don’t connect two output’s together.)

Greetings,
Han

Thanks Han for the reply. I figured it had something to do with the
level shifters since I tried it later without the Trainerboard and it
worked fine. I'm not sure how to interpret the schematic. When I
look at the pinmux for GPIO141 it is set to input. Do I need to
change it to output and then switch the value to 0 from 1 in order to
change the direction for GPIO 130?

Best regards,
Greg

If you check the schematic
http://www.tincantools.com/assets/trainer_rev-b.pdf then you will see that
there are level converters between the beagleboard GPIO’s and the pins on
the trainer board.
You have the change not only the direction of the GPIO but also of the
direction of the level converter on the trainer.
In this case you have to toggle GPIO pin 141 to make the pin an input on the
trainer. (Actually you should make of GPIO 131 an input as well. to make
sure that you don’t connect two output’s together.)

Greetings,
Han

Thanks Han for the reply. I figured it had something to do with the
level shifters since I tried it later without the Trainerboard and it
worked fine. I’m not sure how to interpret the schematic. When I
look at the pinmux for GPIO141 it is set to input. Do I need to
change it to output and then switch the value to 0 from 1 in order to
change the direction for GPIO 130?

Yes you have to make of GPIO 141 an output and configure a low level (0) to switch the direction of the level converter from the B-side to A-side. (At least if the following schematic is correct.)
You should also make sure that GPIO 131 is configured as an input as well. Both 130 and 131 are on the same direction selection of the level converter.
Configuring everything as input is a very safe default value: you cannot have a short of different outputs that are connected to each other. That is probably why it is configured as is…

Trainer_schematic.JPG

I gave that a try and it didn't work, but I did try it with GPIO 157
(the NINT pin on the Trainerboard) since the schematic shows that
direction as hardwired to input and that worked, so at least that will
allow me to get my interrupt from my I2C device.
There is something odd about the schematic in that there is no GPIO
140 or 141 on the expansion header according to the SRM. I think it
should be GPIO 144 and 145, but I think the pinmux is set up so that
those aren't GPIO pins, so I tried a different GPIO, 135, whose
direction is controlled by GPIO 136, and following your instructions
did work.

Thanks for your help,
Greg

Greg,

Did you ever make any progress with the other pins as inputs?

I’m having the same difficulty as you. I’m able to receive input changes from GPIO157 but all the others, they just don’t respond.

Jim