Hardware Reference
In-Depth Information
providing this function in some organizations. I don't personally have an extra Cisco device at home; also my rack space
is limited, just like all space in Hong Kong. Because of this I take a very different approach to building a serial server on
my home network.
First, the extra serial ports are provided by a PCI card with a four-port fan out cable and not via
an async port on a router.
Second, I don't have the ability to use Cisco's software so I have used an open source project
called ser2net ( http://ser2net.sourceforge.net/ ) . This little open source project is one of
my favorites: it's lightweight, easy to build, and functions exactly like its description says.
I have used ser2net for years now so don't be put off by its simple web page; it may be a simple application but it
works very well. What ser2net will do is translate a physical serial port address into a TCP port socket and give you
a few other nice features that I will talk about later on. This chapter will show you two main concepts. The first concept
will be accessing the Raspberry Pi's serial console and the second concept will be using a USB universal asynchronous
receiver/transmitter (UART) port to access another device's serial port via TCP/IP. This chapter will also introduce you
to a device called a line-level converter because the UART ports on the Raspberry Pi don't work exactly the same as
a normal PC's serial port would.
Serial Port, What Serial Port?
Serial ports are becoming harder and harder to find on pretty much any new computer you may come across. After
all it's not like you need a serial port to read your e-mail or browse the web. Thankfully the Raspberry Pi comes
with two hardware UART ports on board. What exactly is a UART? It is a hardware function that converts between
parallel and serial data formats. The UART will take bytes of data and transmit them in sequential manner. On the
other side of the connection, the UART will reassemble the bytes in the correct order. Think this sounds like the
shift register from Chapter 4? Well, yes, all UARTs include a shift register integrated circuit (IC) to perform the basic
function of converting the data. UARTs are used with a communication standard protocol, which is what defines
how and when the UART can transmit the data. These standards are known as registered standards. You would
have heard of RS-232, RS-485, or RS-422; these are the registered standards for serial communications, hence the
RS in the name. How very original!
i use only rS-232: that's what all of my serial devices use and most likely yours do too. these days you find
rS-485 and rS-422 on only serial installations that need to span long distances.
Note
The one thing most people seem to forget when they talk about UARTs is that a UART is never directly receiving
or transmitting signals. Its job is only to convert, sort, and store the data in the correct format. You would never plug a
serial cable directly into a UART, for example. If you did, you would see a nice puff of magic smoke. After all, an RS-232
connection could have up to a potential of 15 V running across it and a UART normally operates with a maximum
voltage range of 5 V. So if the UART is not what you connect to, what are you connecting to when you plug in a serial
cable? Directly behind the physical interface you will need an IC called a logic-level shifter. This IC's job is to convert
the low-level logic voltage from the UART into the correct voltage levels depending on what RS standard you are using.
Most often, it will be RS-232. Take a look at Figure 9-1 to see a high-level overview of a common serial port.
 
 
Search WWH ::




Custom Search