# GPIO on Turbot



## Phishfry (Nov 25, 2016)

MINNOWBOARD TURBOT LSE EXPANSION HEADER TO BYTGPIO.C DRIVER PIN TRANSLATION
Minnowboard calls thier 26pin expansion header "Low Speed Expansion"
pin 1, pin 25 and pin 26 are marked on board.

This device uses three gpio busses. gpioc0,gpioc1,gpioc2

I had to turn off several settings in the firmware to get all the pins exposed.
Still missing two pins.

LSE PIN 1--NEGATIVE
LSE PIN 2--NEGATIVE
LSE PIN 3--POSITIVE 3.3V
LSE PIN 4--POSITIVE 5V
LSE PIN 5--GPIOCTL GPIOC0 66
LSE PIN 6--GPIOCTL GPIOC0 71
LSE PIN 7--GPIOCTL GPIOC0 67
LSE PIN 8--GPIOCTL GPIOC0 70
LSE PIN 9--GPIOCTL GPIOC0 68
LSE PIN10--GPIOCTL GPIOC0 73
LSE PIN11--GPIOCTL GPIOC0 69
LSE PIN12--GPIOCTL GPIOC0 72
LSE PIN13--GPIOCTL
LSE PIN14--GPIOCTL GPIOC0 62
LSE PIN15--GPIOCTL
LSE PIN16--GPIOCTL GPIOC0 63
LSE PIN17--GPIOCTL GPIOC0 75
LSE PIN18--GPIOCTL GPIOC0 65
LSE PIN19--GPIOCTL GPIOC0 74
LSE PIN20--GPIOCTL GPIOC0 64
LSE PIN21--GPIOCTL GPIOC2 00
LSE PIN22--GPIOCTL GPIOC0 94
LSE PIN23--GPIOCTL GPIOC2 01
LSE PIN24--GPIOCTL GPIOC0 95
LSE PIN25--GPIOCTL GPIOC2 02
LSE PIN26--GPIOCTL GPIOC0 99


----------



## Phishfry (Nov 25, 2016)

The two missing pins are the I2C pins. I don't think the 2 -I2C lines can be switched to GPIO.
I give up at 20 of 22. I had to build some scripts to help me with this.
I used an LED for finding pinouts. I did notice the pin voltage was 1.75 when set high.
There is a pin that works with a simple command, no change needed. Already set as output.
`gpioctl 99 0`
`gpioctl 99 1`
This turns pin 26 off and on. A simple output test.
Pin 26 is the only pin with output enabled by default. The rest on the list are default inputs.
Setting to output goes like this `gpioctl -c 94 OUT`
Some pins will require deep digging in the bios under LPSS. Turning off pwm and both uarts and more.

Bus commands on gpioc2 have a flaw with usb keyboard ejecting. SSH and Serial console still work.
With 17 GPIO's on gpioc0 that should be plenty.


----------



## Phishfry (Nov 26, 2016)

One of my first scripts: This blinks pin 99

```
#!/bin/sh
while true
do
  gpioctl 99 0
  sleep 0.5
  gpioctl 99 1
  sleep 0.5
done
```


----------

