Difference between revisions of "Tty setup"

From SingletonMillerWiki
Jump to: navigation, search
(Added some info about TTY, serial and RS232.)
 
(Built in UART: Added more information.)
 
Line 5: Line 5:
 
= Hardware =
 
= Hardware =
 
== Built in UART ==
 
== Built in UART ==
The built in UART is connected to the GPIO connector P1. NOTE: These signals are unbuffered 3.3v logic and NOT RS232 OR 5v TTL compatible. To use the built in UART to a standard RS232 device a MAX RS232 chip is required. The MAX3232 is a commonly used chip. The chip itself can run at 3.3 and 5v. You MUST run it off the 3.3v supply if it is connected to the RPi.
+
The built in UART is connected to the GPIO connector P1. NOTE: These signals are unbuffered 3.3v logic and NOT RS232 OR 5v TTL compatible. To use the built in UART to a standard RS232 device a MAX RS232 chip is required. The MAX3232 is a commonly used chip. The chip itself can run at 3.3 and 5v. You MUST run it off the 3.3v supply if it is connected to the RPi. A MAX3232 can be purchased already mounted with the external components. This is simpler and possibly cheaper than mounting the chip yourself.
 +
 
 +
Modules, such as [[GPS]], often use standard digital signals rather than RS232 voltages. Check their specs carefully. Some are 3.3v based. Others are 5V but you may find the output is 3.3v "compatible". If it is 5v and does not mention 3.3v compatibility, do not connect it directly to the Pi. It is always wise to add some buffering to the Pi's IO as it is unprotected. See the buffer board as an example.
  
 
== USB to RS232 ==
 
== USB to RS232 ==

Latest revision as of 08:18, 15 October 2012

Configuring a TTY serial port

tty devices are found in the /dev directory. If you use a USB adapter it will appear as /dev/ttyusb0.

Use the stty command to configure tty devices.

Hardware

Built in UART

The built in UART is connected to the GPIO connector P1. NOTE: These signals are unbuffered 3.3v logic and NOT RS232 OR 5v TTL compatible. To use the built in UART to a standard RS232 device a MAX RS232 chip is required. The MAX3232 is a commonly used chip. The chip itself can run at 3.3 and 5v. You MUST run it off the 3.3v supply if it is connected to the RPi. A MAX3232 can be purchased already mounted with the external components. This is simpler and possibly cheaper than mounting the chip yourself.

Modules, such as GPS, often use standard digital signals rather than RS232 voltages. Check their specs carefully. Some are 3.3v based. Others are 5V but you may find the output is 3.3v "compatible". If it is 5v and does not mention 3.3v compatibility, do not connect it directly to the Pi. It is always wise to add some buffering to the Pi's IO as it is unprotected. See the buffer board as an example.

USB to RS232

Successful

A PL-2303 based USB to RS2323 adapter work on my Raspbian based Pi without installing additional drivers, although it was not a fully clean install.

Recommended

I have used FTDI devices with other projects, these are also discussed in many Pi forums. I (BillyBag2) have not used these on a Pi myself. These tend to be more expensive.

Not successful

The cheapest adapters are "340" based. HOWEVER I (BillyBag2) was unable to get these to work fully.