gdt: Kangaroo road sign (Default)
[personal profile] gdt

www.modmypi.com/shop/gpio-accessories/USB-to-TTL-Serial-Cable-Debug-Console-Cable-for-Raspberry-Pi

The USB adapter has four wires with header sockets. The purpose of the wires is

Red. VBUS (+5.0VDC 500mA) power from PC USB port.

Black. Ground for USB VBUS and PL2303's TXD and RXD.

White. RXD. Receive data (in to PL2303 USB/RS-232 adapter). Using 3.3V logic not RS-232 logic.

Green. TXD. Transmit data (out of PL2303 USB/RS-232 adapter). Using 3.3V logic not RS-232 logic.

The RPi has a set of header pins marked P1 (under pin 1 of the header). This header predominantly contains GPIO pins, but also gives an alterative to the Micro USB connector when supplying power to the Rasberry Pi. When the RPi is booted two of the GPIO pins are connected to the inbuilt UART which is used by the Linux system as a console.

Pin 6. Ground.

Pin 8. UART0_TXD using 3.3V logic not RS-232 logic, alternatively GPIO14.

Pin 9. Ground.

Pin 10. UART0_RXD using 3.3V logic not RS-232 logic, alternatively GPIO15.

Pin 11. UART0_RTS using 3.3V logic not RS-232 logic, alternatively UART1_RTS or GPIO17.

So assuing we don't want to power the RPi from this connection then we hook up the wires to the header as follows:

GPIO header USB converter
Pin 6 Black
Pin 8 White
Pin 10 Green
n.c. Red

Note that these pins are adjacent.

Plug the pins in with the RPi off. These are 3.3V logic, and they are not as robust as RS-232 logic: you can't short them or drive two loads from them like you can with RS-232 logic.

Plug the USB port into your PC. This will create a /dev/USB0 (or another number if you already have a USB character device like a 3G modem plugged in). Start up your favorite terminal emulator (minicom, screen, etc) and set the port to: 115000bps, no parity bit, 8 data bits, 1 stop bit-time, no hardware handshaking (sometimes called RTS/CTS handshaking), no software handshaking (sometimes called XON/XOFF handshaking), ignore modem status signals (such as DSR and DCD). Emulate a terminal in the VT100 or ANSI families.

When you connect the lack of modem handshaking will mean that no "login" prompt appears. Press Enter and you should see a short message and the offer to login. Otherwise check the cabling and the terminal emulator settings. Also due to the lack of modem handshaking a session will not automatically clear down when you disconnect, so remember to always log out (which us old-timers do by pressing Ctrl+D half a dozen times).

When you boot the RPi you see the Linux kernel messages but not the init system messages. If you want these to appear on the serial console then swap the order of the "console=" statements in /boot/cmdline.txt. It is the last-named console which receives the init system messages. The phrase in cmdline.txt which makes the serial port a console is:

console=ttyAMA0,115200

If you want to see messages from the system logger on the console then modify /etc/rsyslog.conf. It's a sort of damned-if-you-do, damned-if-you-don't configuration. If you don't you'll miss messages about some system catastrophe which explains why the system is misbehaving. If you do then those messages will pepper your editor session as you attempt to fix the fault. If you are in the "do" camp then you want a line like:

*.err   -/dev/console

The Linux kernel will do it's hardest to get these messages out the serial port. That causes a performance reduction. So if you are using the RPi for production work rather than for development then it is wise to limit use to infrequent and interesting messages.

Profile

gdt: Kangaroo road sign (Default)
Glen Turner

September 2021

S M T W T F S
   1234
567891011
121314151617 18
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2026-01-01 07:25
Powered by Dreamwidth Studios