Page 1 of 1

how to add push button to GPIO?

PostPosted: Mon Aug 13, 2018 1:39 pm
by parallella-project
could anyone show me how to connect a push button to one of the GPIO ports? is there any schematic available for this?

Re: how to add push button to GPIO?

PostPosted: Mon Aug 13, 2018 5:54 pm
by parallella-project
The other important point is that the GPIO ports are differential. so what should I do with the other dual GPIO port in the case of using push button? I mean where should I connect the dual GPIO port?

Re: how to add push button to GPIO?

PostPosted: Fri Aug 17, 2018 1:57 am
by olajep
I don't have access to a Parallella board and it's been a while since I tried this so please bare with me.

The GPIO ports on the Parallella board are single-ended in the default bitstream. Not differential.

Porcupine pinout: ... /

There's some tools in parallella-utils you can try to use to manipulate the gpio pins: ... aster/gpio ... r/gpio_dir

From here you can defer the pin ordering on the porcupine board: ... pp#L45-L51

And here we can see that the offset is 54 to GPIO pin 0 on the porcupine ... .h#L56-L60

Now the manual way:
Code: Select all
$ sudo su
$ cd /sys/class/gpio
# export porcupine gpio pin 0 to user space
$ echo 54 > export
# export porcupine gpio pin 1 to user space. see first link for offsets
$ echo 56 > export
# set direction of pin 0 to output
$ echo out > gpio54/direction
# set value=0 to pin 0
$ echo 0 > gpio54/value
# set direction of pin 1 to input (default)
$ echo in > gpio56/direction
# CONNECT A (physical) WIRE BETWEEN PIN 0 and 1
# read value from pin 1
$ cat gpio56/value
# set pin 0 value to 1
$ echo 1 > gpio54/value
# read pin 1 again
$ cat gpio56/value

If you use this configuration you can just connect the push button between pin 0 and pin 1.
The output current on the GPIO pins is limited to 8mA which the input can handle. ... gpio.v#L74

A proper circuit with a current limiting resistor can be seen here: ... y-pi-gpio/

One end is connected to VGP (VDD_GPIO in schematics) on J6
and the other to a gpio pin.