# 4.5. Determining serial port names

The USB interface of the Pololu USB AVR Programmer v2.x provides two virtual serial ports: the programming port and the TTL serial port. To use either of these serial ports, you will usually have to know the name assigned to the serial port by the operating system (e.g. “COM6”).

The easiest way to find the serial port names is to run the configuration software we provide. You can run the Pololu USB AVR Programmer v2 Configuration Utility and look in the upper left corner to see the serial port names. In a command prompt, you can run pavr2cmd -s to see the port names. With either of these two methods, a port name will be displayed as “(unknown)” if it cannot be determined.

You can also run pavr2cmd --prog-port or pavr2cmd --ttl-port in a command prompt. Each of these commands simply prints the name assigned to the corresponding serial port. These commands are useful if you want to write a script that connects to one of the programmer’s serial ports but you do not know ahead of time what name it will have. These commands will print an error message on the standard error pipe if anything goes wrong.

In Windows, you can also determine the COM port names by looking in the Device Manager. Usually, both ports will be displayed in the “Ports (COM & LPT)” category. The descriptive name of the port (e.g. “Pololu USB AVR Programmer v2 Programming Port”) will be displayed, followed by the COM port name in parentheses. If the descriptive name is just “USB Serial Device” for both of the programmer’s ports, then you can identify the two ports by double-clicking on each one and looking at the “Hardware Ids” property in the “Details” tab. The programming port will have the ID USB\VID_1FFB&PID_00B0&MI_01, while the TTL serial port will have the ID USB\VID_1FFB&PID_00B0&MI_03. If you have trouble finding the ports in the Device Manager, see the USB driver troubleshooting tips in Section 4.1.

In Linux, the programmer’s two serial ports should show up as devices with names like /dev/ttyACM0 and /dev/ttyACM1. The name with the lower number usually corresponds to the programming port. You can run ls /dev/ttyACM* to list those ports. These serial port names are not generally reliable, because if /dev/ttyACM0 is already in use when the programmer gets plugged in, then its ports will be assigned to higher numbers. If you want more reliable names for the serial ports, you can use the symbolic links in the /dev/serial/by-id/ directory. The links for the programmer ending with if01 are for the programming port, while the links ending with if03 are for the TTL serial port. For example, the programming port of a programmer with serial number 00001234 would be something like:

/dev/serial/by-id/usb-Pololu_Corporation_Pololu_USB_AVR_Programmer_v2_00001234-if01

In Mac OS X, the programmer’s two serial ports will have names like /dev/cu.usbmodem00022331. The name with the lower number usually corresponds to the programming port. You can run ls /dev/cu.usbmodem* to list those ports. You can also find these names by running ioreg -trc IOSerialBSDClient. The output from this command is somewhat complicated, but you should see entries for the Pololu USB AVR Programmer v2.x. An entry for the programmer with IOUSBHostInterface@2 in it corresponds to the programming port, while an entry with IOUSBHostInterface@4 in it corresponds to the TTL serial port.

## Related Products

(702) 262-6648
Same-day shipping, worldwide