Difference between revisions of "Hardware-set-ups"

From Wiki at Neela Nurseries
Jump to: navigation, search
m
m (^ Serial port loopback test on Linux: - minor formatting.)
Line 34: Line 34:
  
 
Invocation of stty is:
 
Invocation of stty is:
 
  
 
   stty -F /dev/ttyUSB4 -echo -onlcr
 
   stty -F /dev/ttyUSB4 -echo -onlcr
 
  
 
Reference:  https://super-unix.com/unixlinux/unexpected-results-testing-serial-loopback-using-echo-and-cat/
 
Reference:  https://super-unix.com/unixlinux/unexpected-results-testing-serial-loopback-using-echo-and-cat/
  
 
<!-- comentario -->
 
<!-- comentario -->

Revision as of 19:43, 4 October 2022

(1) Rpi RP2040 DEV-18288 set up 2022 Q2:

On Rpi Sparkfun board, DEV-18288 have an LED connected from GPIO p0_7, through 22kOhm resistor to plus rail pin left of the USB-C connector.

   +---------+
   |        9|     ^^
   |        8|    //
   |        7|---|>|---/\/\/---+
   |        6|          22k    |   
   |        5|                 |
   |        4|                 |
   |        3|                 |
   |        2|                 |
   |3V3   GND|                 |
   |RST   GND|                 |
   |GDN    RX|                 |
+--|+      TX|                 |
|  +---------+                 |
|                              |
+------------------------------+



^ Serial port loopback test on Linux

In two terminal windows, programs `echo` and `cat` can be used to test a serial port connected to a loopback cable. This testing also effectively demonstrates the working of serial drivers under Linux. Works for USB-based FTDI cables which convert USB to a serial link. Works for the much older 16550 based serial port peripheral chips.

A third and precursor command, `stty` is also needed to configure given serial port for sane operation during these tests. A couple of options to `stty` utility disable a default echoing behavior on given serial port. Another option suppresses a conversion or handling of carriage return bytes, e.g. stops serial port driver at some level from converting CR to CRLF.

Invocation of stty is:

 stty -F /dev/ttyUSB4 -echo -onlcr

Reference: https://super-unix.com/unixlinux/unexpected-results-testing-serial-loopback-using-echo-and-cat/