In Arduino-ish programming, we can use Serial.print to access the UART of pcDuino. Many users are asking, how to directly manipulate the UART of pcDuino. In this post, we detail the steps needed to access UART under Linux.
First, we need to check if gpio driver is loaded:
$ls -l /sys/devices/virtual/misc/gpio/mode/gpio0
If gpio driver is not loaded, we can run the following command to load gpio driver:
$sudo modprobe gpio
If we are not using Arduino-ish programming, we need to do the following before using UART:
Configure GPIO0/GPIO1 to be UART mode:
$echo “3” > /sys/devices/virtual/misc/gpio/mode/gpio0
$echo “3” > /sys/devices/virtual/misc/gpio/mode/gpio1
Then we can use regular command to access /dev/ttyS1.
Leave a Reply
You must be logged in to post a comment.