# GPIO pins - how do they work

**URL:** <https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199>\
**Category:** GameShell\
**Tags:** tinkering\
**Created:** [February 20, 2018, 2:08pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199 "2018-02-20T14:08:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitdweller](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@bitdweller](https://forum.clockworkpi.com/u/bitdweller)\
**Post date:** [February 20, 2018, 2:08pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/1 "2018-02-20T14:08:41Z")

</div>

Noob warning! 🙂

How does the 14pin UART/I2C/SPI/GPIO work?  
Can I get dome GPIO board/pins and hooked them to the GameShell, is that it?

Thanks!

---

<div class="post-metadata">

**Author:** ![Godzil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/godzil/32/60_2.png) [@Godzil](https://forum.clockworkpi.com/u/Godzil)\
**Post date:** [February 20, 2018, 2:44pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/2 "2018-02-20T14:44:00Z")

</div>

Well we will need to have the hardware to be able to answer that.

Some of them will probably be available using /sys/\*/gpio interface, hard to say right now to be honest

---

<div class="post-metadata">

**Author:** ![aewens](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/aewens/32/39_2.png) [@aewens](https://forum.clockworkpi.com/u/aewens)\
**Post date:** [February 20, 2018, 3:41pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/3 "2018-02-20T15:41:13Z")

</div>

I messaged Clockwork about this during the campaign. What I was told is that the GameShell would come with a manual detailing the specs of the cable that comes with it for that port and what the pins can be used for. As @Godzil said, we need to wait for the device to be shipped to us to know the specifics on this.

---

<div class="post-metadata">

**Author:** ![Godzil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/godzil/32/60_2.png) [@Godzil](https://forum.clockworkpi.com/u/Godzil)\
**Post date:** [February 20, 2018, 4:37pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/4 "2018-02-20T16:37:09Z")

</div>

Or for clockwork to give more documentation before the hardware release

---

<div class="post-metadata">

**Author:** ![aewens](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/aewens/32/39_2.png) [@aewens](https://forum.clockworkpi.com/u/aewens)\
**Post date:** [February 20, 2018, 4:54pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/5 "2018-02-20T16:54:07Z")

</div>

![2018-02-20_10%3A47%3A42](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/clockworkpi/original/1X/bce9eac560fa77cc7f14229151184e61a0bc50cb.png)

Supposedly it’s online somewhere / will be online at some point.

---

<div class="post-metadata">

**Author:** ![Godzil](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/godzil/32/60_2.png) [@Godzil](https://forum.clockworkpi.com/u/Godzil)\
**Post date:** [February 20, 2018, 5:00pm UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/6 "2018-02-20T17:00:46Z")

</div>

At least they will provide a cable which is good!

---

<div class="post-metadata">

**Author:** ![uncannyFlanigan](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/uncannyflanigan/32/4438_2.png) [@uncannyFlanigan](https://forum.clockworkpi.com/u/uncannyFlanigan)\
**Post date:** [February 17, 2019, 3:16am UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/7 "2019-02-17T03:16:52Z")

</div>

I’m trying to control the pins through `/sys/class/gpio`

for any pin N, I get

```nohighlight
cpi@clockworkpi:~$ cd /sys/class/gpio
cpi@clockworkpi:/sys/class/gpio$ su root
Password:
root@clockworkpi:/sys/class/gpio# ls
export gpiochip0 gpiochip352 unexport
root@clockworkpi:/sys/class/gpio# echo N > export
root@clockworkpi:/sys/class/gpio# ls
export gpioN gpiochip0 gpiochip352 unexport
root@clockworkpi:/sys/class/gpio# cat gpioN/direction
in
root@clockworkpi:/sys/class/gpio# echo out > gpioN/direction
bash: echo: write error: Unknown error 517
root@clockworkpi:/sys/class/gpio#

```

Sadly I get that error when I try to set pins to output mode. It may be possible to read the values of the pins. But how are the pins numbered? Looking at the [mainboard schematic](https://github.com/clockworkpi/GameShellDocs/blob/master/clockwork_Mainboard_Schematic.pdf) I believe our gpio diagram is the part called “debug.” I probed the gpios with a multimeter and the 3 and 5 volt levels correspond to the diagram. I don’t dare short two pins together to test if it’s reflected in `cat gpioN/value`.

What’s the next step in unlocking the secrets of clockwork pi gpio?

---

<div class="post-metadata">

**Author:** ![guu](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@guu](https://forum.clockworkpi.com/u/guu)\
**Post date:** [February 17, 2019, 7:25am UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/8 "2019-02-17T07:25:35Z")

</div>

[https://github.com/clockworkpi/GameShellDocs](https://github.com/clockworkpi/GameShellDocs)

`clockwork_Mainboard_Schematic.pdf`

search Debug UART  
 ![debug](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/clockworkpi/original/2X/e/efc8919156426d69e65a7e895d0495cc8cf16e8d.png)

and here is the order in reality  
reference picture

![IMG_20190217_145232R](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/clockworkpi/original/2X/a/a80b7701697832026c9decb253df9dacaacf0e46.jpeg)

from left to right is

blue green yellow white  
1, 2, 3, 4…

in above Mainboard Schematic Layout

so if you want a usb-uart connector, just **leave the blue alone** and connect the  
green(rx) yellow(tx) ,white(GND) and it will be done

---

<div class="post-metadata">

**Author:** ![rickyzhang](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/rickyzhang/32/1931_2.png) [@rickyzhang](https://forum.clockworkpi.com/u/rickyzhang)\
**Post date:** [March 5, 2019, 2:41am UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/9 "2019-03-05T02:41:54Z")

</div>

GPIO should be here. But Gods know how PIN match the wire color.

![56%20PM](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/4/45d21a518ea0b2599723b915e2c12377cfc277ac.png)

You can map those pin to [Allwinner R16 spec page 18](https://linux-sunxi.org/images/b/b3/R16_Datasheet_V1.4_%281%29.pdf)

Note that they claim this is open source hardware. But the info on the hardware is not fully public. I will wait till they open all and see their limitation before click the pay button.

---

<div class="post-metadata">

**Author:** ![guu](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@guu](https://forum.clockworkpi.com/u/guu)\
**Post date:** [March 5, 2019, 5:59am UTC](https://forum.clockworkpi.com/t/gpio-pins-how-do-they-work/199/10 "2019-03-05T05:59:22Z")

</div>

of course it’s opensource

**READ the github documents**

I think you are looking for the `clockwork_Mainboard_Schematic.pdf`

> **[clockworkpi/GameShellDocs](https://github.com/clockworkpi/GameShellDocs)**
>
> GameShell Documents. Contribute to clockworkpi/GameShellDocs development by creating an account on GitHub.

the gpio in back 14 pins is in the **DEBUG** section of the schematic pdf
