A Confusion of COM Ports

I like serial-port communications, but this is ridiculous.

Whenever a new USB serial device is connected to a Windows computer (and/or apparently whenever an existing USB serial device is moved to a new USB port), Windows assigns it a new COM port number. Back in the good old days, there was generally COM1 and COM2 — typically for a mouse and modem — and the addresses were set in hardware with jumpers or DIP switches.

Fast-forward to today’s environment, including Arduinos, Bluetooth serial devices, USB-to-serial cables, and others. I’m up to COM29 with no end in sight. Most of these are the ghosts of various devices plugged in to various USB ports. The drivers are all still installed, and they’ll be redetected when plugged back in.

Deleting unused COM ports in Windows isn’t as straightforward as perhaps it should be, since Device Manager doesn’t list non-present COM ports by default. Fortunately, an article on Microsoft’s Knowledge Base shows how to change this. Here’s how:

  • Open a command prompt
  • Type      set devmgr_show_nonpresent_devices=1    <enter>
  • Type      start devmgmt.msc  <enter> to start Device Manager
  • Click     View –> Show Hidden Devices.
  • The COM ports are listed under “Ports (COM & LPT).” Have at ’em!

Incidentally, this solved the mysterious   “avrdude: stk500_getsync(): not in sync: resp=0x86” error message I was getting when uploading an Arduino sketch. Apparently even the Arduino IDE had had enough.

 

This entry was posted in Arduino, HOW-TO, System Administration. Bookmark the permalink.

Leave a Reply