Support » Pololu Orangutan SVP User’s Guide »
9. Using the TTL Serial Port
<p>The Orangutan SVP’s USB Connection provides a serial port called the <strong>Pololu Orangutan SVP TTL Serial Port</strong> which allows two-way communication between a personal computer and TTL-level serial devices at baud rates between 300 bps and 115200 bps. This serial port can be used for communication between a computer and an external serial device besides the AVR. It can also be used to debug the serial communication between the AVR and an external serial device. If you want to communicate directly between the AVR and a computer, we recommend using the USB Communications Port (see <a href="/docs/0J39/8">Section 8</a>).</p>
<p>The bytes sent from the computer on this serial port will be transmitted on the TX line. Bytes received on the D/RX line will be sent back to the computer. The bytes are sent and received eight bits at a time, non-inverted, with no parity and one stop bit (8N1).</p>
<p>To use the TTL Serial Port, you must first determine what port name the operating system has assigned it.</p>
<p>To determine the port name in Microsoft Windows, open the Device Manager, expand the “Ports (COM & LPT)” list, and look for the <strong>Pololu Orangutan SVP TTL Serial Port</strong> entry. The port name will be at the end of this line in parentheses (e.g. “COM4”). In Windows, a given device will always be associated with the same port unless you manually change its port assignment in the Device Manager (see <a href="/docs/0J39/5.a">Section 5.a</a>).</p>
<table class="picture_with_caption center"><tr><td style="max-width: 540px"><img alt="" class="" data-gallery-pictures="[{"id":"0J1834","caption":"\u003cp\u003eWindows 8 device manager showing the Pololu Orangutan SVP.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1834.98x98.jpg?625e50c004d2cd7b89d0a98fc871490c","url_medium":"https://a.pololu-files.com/picture/0J1834.600x480.jpg?625e50c004d2cd7b89d0a98fc871490c","url_full":"https://a.pololu-files.com/picture/0J1834.1200.png?625e50c004d2cd7b89d0a98fc871490c","longest_side":432}]" data-picture-id="0J1834" data-picture-longest_side="432" src="https://a.pololu-files.com/picture/0J1834.540.png?625e50c004d2cd7b89d0a98fc871490c" /></td><p></tr><tr><th style="max-width: 540px"><p>Windows 8 device manager showing the Pololu Orangutan SVP.</p></th></tr></table></p>
<p>To determine the port name in Linux, type <code>ls /dev/ttyACM*</code>. The port name will be one of the devices listed there. If there are only three ports, then the TTL Serial Port will be <b>/dev/ttyACM2</b> (the programmer will be <b>/dev/ttyACM0</b> and the USB communications port will be <b>/dev/ttyACM1</b>). If you see more than three ports, then you should look at the output from <code>dmesg</code> when you plug in the Orangutan SVP to see which three ports are created; the third port is the TTL Serial Port. In Linux, the port name depends on how many other devices are using the USB CDC ACM driver to create virtual serial ports at the time the Orangutan SVP is plugged in.</p>
<p>To determine the port name in Mac OS X, type <code>ls /dev/tty.usb*</code>. There should be three entries for the Orangutan SVP, and the TTL Serial Port should be the last one.</p>
<p>After determining the port name, you can use any serial port software to communicate on that port.</p>
<p>There are many free terminal programs available, including <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> (Windows or Linux), <a href="http://hp.vector.co.jp/authors/VA002416/teraterm.html">Tera Term</a> (Windows), and <a href="https://sites.google.com/site/terminalbpp/">Br@y Terminal</a> (Windows). To use any of these terminal programs, you must specify the port name determined above, and the baud rate.</p>
<table class="picture_with_caption center"><tr><td style="max-width: 498px"><img alt="" class="" data-gallery-pictures="[{"id":"0J1363","caption":"\u003cp\u003ePuTTY is a free Windows terminal program that can send and receive bytes on a serial port.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J1363.98x98.jpg?e2c92da2678acf9014b9077174c0aaf9","url_medium":"https://a.pololu-files.com/picture/0J1363.600x480.jpg?e2c92da2678acf9014b9077174c0aaf9","url_full":"https://a.pololu-files.com/picture/0J1363.1200.png?e2c92da2678acf9014b9077174c0aaf9","longest_side":498}]" data-picture-id="0J1363" data-picture-longest_side="498" src="https://a.pololu-files.com/picture/0J1363.498.png?e2c92da2678acf9014b9077174c0aaf9" /></td><p></tr><tr><th style="max-width: 498px"><p>PuTTY is a free Windows terminal program that can send and receive bytes on a serial port.</p></th></tr></table></p>
<p>If you need to send and receive non-ASCII bytes, you can use the <a href="/docs/0J23">Pololu Serial Transmitter Utility for Windows</a>.</p>
<p>Advanced users developing scripted applications may prefer the free terminal program <a href="http://www.columbia.edu/kermit/">kermit</a> (Windows or Linux).</p>
<p>You can also write a computer program to use the serial port. The freely available Microsoft .NET framework for Windows contains a <em>SerialPort</em> class that makes it easy to read and write bytes from a serial port. Here is some example C# .NET code that uses the TTL Serial Port:</p>
<pre name="code" class="c">
// Choose the port name and baud rate.
// Port name must be determined from the Device Manager.
System.IO.Ports.SerialPort port = new System.IO.Ports.SerialPort("COM4", 115200);

// Connect to the port.
port.Open();

// Transmit two bytes: 0x61, 0x62
port.Write(new byte[]{0x61, 0x62}, 0, 2);

// Wait for a byte to be received on the RX line.
int response = port.ReadByte();

// Show the user what byte was received.
MessageBox.Show("Received byte: " + response);

// Disconnect from the port so that other programs can use it.
port.Close();</pre>