How do I use UART serial port on the Pi-2 bus?
#3
(12-08-2016, 10:08 PM)psychedup Wrote: >$ screen /dev/ttyS2 115200

If you're using a USB UART adapter make sure it's set up to run on 3.3 volts.

I will add :
  uart2:  /dev/ttyS2
  uart3:  /dev/ttyS3
  uart4:  /dev/ttyS4

You will probably want to do one of the following:

   sudo chmod 0777 /dev/ttyS2

or

   sudo usermod -aG dialout  username

The pl2303 cable from ada fruit is pre-set to 3v3.  Other cables like the cp2102 based TTL usb serial bridge are switch or jumper selectable 3v3 or 5v;  make sure yours is set to 3v3.  This is VERY important.

screen works well,  as well minicom,  and  cu  is another option;  although  cu  does not work well with all TTL serial bridge cables ( my CH340G does not work with cu ). 

uart3 and uart4  are on the euler bus.  uart1 is on the wifi bus , and uart2 is on the pi bus.

Note:  a neat trick is to do a loop-back  , or sometimes referred to a wrap-plug;  that is on uart2 you jumper across Rx--Tx.

First start screen:

sudo screen /dev/ttyS2 115200     (connect nothing to uart2  leave Rx and Tx open)

... then type in the screen... it will appear as though nothing is happening... characters are going out Tx and into oblivion.

... now, jumper across Rx -- Tx.   Again, type on the keyboard in screen...  this time the characters that you type will appear in your window;  the characters are going out Tx and then right back into Rx;  wrap, or loopback.

You can use this trick to test your uartx ports, test your comm package, and make sure things are working before you try to connect the uart2 in a project where other factors will complicate debugging.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
RE: How do I use UART serial port on the Pi-2 bus? - by MarkHaysHarris777 - 12-08-2016, 11:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pine64 / V 13x Serial Port wrong permissions /ttyUSB0 maxtox 1 3,330 10-14-2016, 11:33 PM
Last Post: MarkHaysHarris777

Forum Jump:


Users browsing this thread: 1 Guest(s)