IntroductionIntel Galileo board features three serial ports:
Note: I will use UART (Universal Asynchronous Receiver/Transmitter) as a name for for the hardware inside the Quark SoC that provides serial port functionality. GPIO ConfigurationThere are several GPIOs that control multiplexing of pins 0, 1, and enable a level shifter that need to be set in order to enable serial port on Arduino pins 0 and 1:
root@clanton:~# echo -n "4" > /sys/class/gpio/export root@clanton:~# echo -n "40" > /sys/class/gpio/export root@clanton:~# echo -n "41" > /sys/class/gpio/export root@clanton:~# echo -n "out" > /sys/class/gpio/gpio4/direction root@clanton:~# echo -n "out" > /sys/class/gpio/gpio40/direction root@clanton:~# echo -n "out" > /sys/class/gpio/gpio41/direction root@clanton:~# echo -n "strong" > /sys/class/gpio/gpio40/drive root@clanton:~# echo -n "strong" > /sys/class/gpio/gpio41/drive root@clanton:~# echo -n "1" > /sys/class/gpio/gpio4/value root@clanton:~# echo -n "0" > /sys/class/gpio/gpio40/value root@clanton:~# echo -n "0" > /sys/class/gpio/gpio41/value root@clanton:~# echo -n "4" > /sys/class/gpio/unexport root@clanton:~# echo -n "40" > /sys/class/gpio/unexport root@clanton:~# echo -n "41" > /sys/class/gpio/unexport Once serial port is configured it can be accessed using /dev/ttyS0 device just as any other serial port. One possible use is to run getty on it for an additional serial console. This can be done by adding the following string to /etc/inittab: S0:2345:respawn:/sbin/getty 115200 ttyS0 And then reloading init configuration using: root@clanton:~# kill -1 1 RS-232 Level Shifter HardwareGalileo uses a logic-level signals (either 5V or 3.3V level). For connecting Galileo to another device with an RS-232 serial port, signals need to be converted to RS-232 levels. There are several shields and converters available that implement this functionality, for example this RS232 shield sold by SparkFun. Alternatively it is possible to build a level shifter using ICs like MAX232 (Maxim Integrated, Texas Instruments), MAX3232 (Maxim Integrated, Texas Instruments), or similar. Or use a serial to USB converter such as FTDI DB9-USB-D5-M module. |
Home > Sergey's Blog >