Resources » Pololu Orangutan SVP User's Guide »9. Using the TTL Serial PortThe Orangutan SVP’s USB Connection provides a serial port called the Pololu Orangutan SVP TTL Serial Port 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 Section 8). 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). To use the TTL Serial Port, you must first determine what port name the operating system has assigned it. To determine the port name in Microsoft Windows, open the Device Manager, expand the “Ports (COM & LPT)” list, and look for the Pololu Orangutan SVP TTL Serial Port 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 Section 5.a).
To determine the port name in Linux, type To determine the port name in Mac OS X, type After determining the port name, you can use any serial port software to communicate on that port. There are many free terminal programs available, including PuTTY (Windows or Linux), Tera Term (Windows), and Br@y Terminal (Windows). To use any of these terminal programs, you must specify the port name determined above, and the baud rate.
If you need to send and receive non-ASCII bytes, you can use the Pololu Serial Transmitter Utility for Windows. Advanced users developing scripted applications may prefer the free terminal program kermit (Windows or Linux). You can also write a computer program to use the serial port. The freely available Microsoft .NET framework for Windows contains a SerialPort 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:
// 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();
|
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|