I just started working with VoCore2 and I really like it. I would like to use GPIO 19, 20, 21 and GPIO 39, 40 and 41 as Output. Most of the mentioned GPIOs are working fine, but not GPIO 20 (Output is always high, +3,3V) and not GPIO 21 (Output is always +0.5V).
I tried different VoCore2 because my first guess was that the GPIOs are defect. But it's always the same behavior.
What am I doing wrong? I guess the GPIOs are still configured as PWM Output, am I right? Please find the test script and and the terminal output below.
Many thanks in advance and kind regards,
Markus
- Code: Select all
#!/bin/bash
echo 19 > /sys/class/gpio/export
echo 20 > /sys/class/gpio/export
echo 21 > /sys/class/gpio/export
echo 39 > /sys/class/gpio/export
echo 40 > /sys/class/gpio/export
echo 41 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio19/direction
echo out > /sys/class/gpio/gpio20/direction
echo out > /sys/class/gpio/gpio21/direction
echo out > /sys/class/gpio/gpio39/direction
echo out > /sys/class/gpio/gpio40/direction
echo out > /sys/class/gpio/gpio41/direction
echo "..."
cat /sys/kernel/debug/gpio
echo "..."
while true; do
echo 0 > /sys/class/gpio/gpio19/value
echo 0 > /sys/class/gpio/gpio20/value
echo 0 > /sys/class/gpio/gpio21/value
echo 1 > /sys/class/gpio/gpio39/value
echo 0 > /sys/class/gpio/gpio40/value
echo 0 > /sys/class/gpio/gpio41/value
sleep 2
echo 0 > /sys/class/gpio/gpio39/value
echo 1 > /sys/class/gpio/gpio40/value
echo 0 > /sys/class/gpio/gpio41/value
sleep 2
echo 0 > /sys/class/gpio/gpio39/value
echo 0 > /sys/class/gpio/gpio40/value
echo 1 > /sys/class/gpio/gpio41/value
echo 1 > /sys/class/gpio/gpio19/value
echo 1 > /sys/class/gpio/gpio20/value
echo 1 > /sys/class/gpio/gpio21/value
sleep 2
done
root@OpenWrt:~# /bin/ash /noser/gpio_testscript.sh
...
GPIOs 0-31, platform/10000600.gpio, 10000600.gpio:
gpio-4 (scl ) in hi
gpio-5 (sda ) in hi
gpio-19 (sysfs ) out lo
gpio-20 (sysfs ) out lo
gpio-21 (sysfs ) out lo
GPIOs 32-63, platform/10000600.gpio, 10000600.gpio:
gpio-39 (sysfs ) out lo
gpio-40 (sysfs ) out lo
gpio-41 (sysfs ) out lo
GPIOs 64-95, platform/10000600.gpio, 10000600.gpio:
...