Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18599

Re: How to enable PIN0/PIN1 for UART usage (TX/RX)

$
0
0

Hi Wenlong,

 

The following commands should set up the correct pin multiplexing  to enable serial mode on Pins 0 an 1. The key part is the echo of 'mode1' into 'current_pinmux', as that sets the pins into UART mode, otherwise that may be in GPIO mode.

echo 214 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio214/direction

echo low > /sys/class/gpio/gpio214/direction

 

echo 131 > /sys/class/gpio/export 2>&1

echo mode1 > /sys/kernel/debug/gpio_debug/gpio131/current_pinmux

echo 249 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio249/direction

echo 1 > /sys/class/gpio/gpio249/value

echo 217 > /sys/class/gpio/export 2>&1

echo high > /sys/class/gpio/gpio217/direction

echo 1 > /sys/class/gpio/gpio217/value

echo out > /sys/class/gpio/gpio131/direction

echo 0 > /sys/class/gpio/gpio131/value

 

 

echo 130 > /sys/class/gpio/export 2>&1

echo mode1 > /sys/kernel/debug/gpio_debug/gpio130/current_pinmux

echo 248 > /sys/class/gpio/export 2>&1

echo low > /sys/class/gpio/gpio248/direction

echo 0 > /sys/class/gpio/gpio248/value

echo 216 > /sys/class/gpio/export 2>&1

echo in > /sys/class/gpio/gpio216/direction

echo in > /sys/class/gpio/gpio130/direction

 

echo high > /sys/class/gpio/gpio214/direction

 

 

   Pins 0 and 1 on the Arduino baseboard are at /dev/ttyMFD1, and a getty can be enabled to give a longin prompt on this port by editing /etc/inittab and adding the following line:

T1:23:respawn:/sbin/getty -L ttyMFD1 115200 vt100

 

Then, using a USB to serial cable, you can connect to the board and log in using minicom or putty, e.g.:

minicom -b 115200 -D /dev/ttyUSBx

Of course, you don't have to set up a getty, if you simply want to talk to another device serially.

 

Hope this helps,

Dave.


Viewing all articles
Browse latest Browse all 18599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>