
Shield pin configuration
11.4
Configure IO6 as a PWM output
To configure IO6 as a PWM output, do the following:
1.
Refer to Table 2 for the GPIO number. According to Table 2, the GPIO number for IO6 is 182.
2.
According to Table 4, GPIO 182 pin-mux must be set to ‘mode1’ to select PWM.
3.
According to Table 7, GPIO 254 must be set to 1 to enable the output direction for IO6.
4.
According to Table 7, GPIO 222 must be set as a high-impedance input to disable the pullup resistor for IO6.
5.
According to Table 6, the TRI_STATE_ALL signal is controlled by GPIO 214.
After you have gathered all of this information, enter the following commands in Linux:
# echo 254 > /sys/class/gpio/export
# echo 222 > /sys/class/gpio/export
# echo 214 > /sys/class/gpio/export
# echo high > /sys/class/gpio/gpio214/direction
# echo high > /sys/class/gpio/gpio254/direction
# echo in > /sys/class/gpio/gpio222/direction
# echo mode1 > /sys/kernel/debug/gpio_debug/gpio182/current_pinmux
# echo low > /sys/class/gpio/gpio214/direction
You should be able to use IO6 as a PWM output. For example:
# echo 2 > /sys/class/pwm/pwmchip0/export
# echo 2000000 > /sys/class/pwm/pwmchip0/pwm2/duty_cycle
# echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable
11.5
Configure IO14 as an ADC input
To configure IO14 as an ADC input, do the following:
1.
Refer to Table 2 for the GPIO number. According to Table 2, the GPIO number for IO14 is 44.
2.
According to Table 4, GPIO 200 must be set to 1 to select ADC.
3.
According to Table 7, GPIO 232 must be set to 0 to disable the output direction for IO14.
4.
Any GPIO lines directly connected to IO14 should be configured as high-impedance inputs to prevent
possible current leakage. According to Table 7, GPIO 208 is used to enable a pullup resistor for IO14.
5.
According to Table 6, the TRI_STATE_ALL signal is controlled by GPIO 214.
After you have gathered all of this information, enter the following commands in Linux:
# echo 200 > /sys/class/gpio/export
# echo 232 > /sys/class/gpio/export
# echo 208 > /sys/class/gpio/export
# echo 214 > /sys/class/gpio/export
# echo high > /sys/class/gpio/gpio214/direction
# echo high > /sys/class/gpio/gpio200/direction
# echo low > /sys/class/gpio/gpio232/direction
# echo in > /sys/class/gpio/gpio208/direction
# echo low > /sys/class/gpio/gpio214/direction
You should be able to use IO14 as an ADC input. For example:
# cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw
Note:
The default state of the mux switches and level-shifters for shield pins IO11 to 13 is inconsistent, and will
impair SPI communication to the ADC if not configured properly. Thus, we recommend following the
instructions elsewhere in this document to fully configure these pins for any of their functions (for
example, SPI or GPIO) before attempting to use the ADC.
Intel® Edison Kit for Arduino*
December 2014
Hardware Guide
Document Number: 331191-004
29