COM port on the Arduino Leonardo

Thread Starter

adam555

Joined Aug 17, 2013
858
I can't get my Arduino Leonardo to connect with a program via the COM port; as it seems that all serial USB communications go through a virtual COM port.

Is there any way to configure or program the Leonardo to use the hardware port for communications over USB?

Thank you in advance...
 

djsfantasi

Joined Apr 11, 2010
8,320
Have you investigated the SoftwareSerial library for the Arduino? It allows serial communication on other hardware pins. The reference page for the library is here.

Edit: I just re-read your post and saw that you were looking for a USB connection. Nevermind.
 

DerStrom8

Joined Feb 20, 2011
2,390
Check your device manager and expand the "Ports (COM & LPT)" section. This will tell you exactly which COM port the Arduino is using. I have never heard of them using virtual ports, but then again I only have an Arduino Uno and an Arduino Mega.
 

Brownout

Joined Jan 10, 2012
2,390
I can't get my Arduino Leonardo to connect with a program via the COM port; as it seems that all serial USB communications go through a virtual COM port.

Is there any way to configure or program the Leonardo to use the hardware port for communications over USB?

Thank you in advance...
In the many different posts I've read where you ask about this, it seems to me that you are getting COM and USB mixed up. COM refers to a simple serial interface, usually associated with the old RS-232 standard. USB is the newer interface used on most computers these days. You can't have USB go through a COM port on a microcontroller. But you can use a UBS-to-Rs-232 to communicate form your PC to the COM port on your microcontroller. If your controller doesn't have a lever converter, eg a MAX-232, they you need a USB-to-serial converter that has CMOS level signals on the serial side, eg the FTDI 232 chip.
 

DerStrom8

Joined Feb 20, 2011
2,390
In the many different posts I've read where you ask about this, it seems to me that you are getting COM and USB mixed up. COM refers to a simple serial interface, usually associated with the old RS-232 standard. USB is the newer interface used on most computers these days. You can't have USB go through a COM port on a microcontroller. But you can use a UBS-to-Rs-232 to communicate form your PC to the COM port on your microcontroller. If your controller doesn't have a lever converter, eg a MAX-232, they you need a USB-to-serial converter that has CMOS level signals on the serial side, eg the FTDI 232 chip.
I want to say the Arduino does the conversion itself already. It connects to a COM port through a USB connection to your PC.
 

Brownout

Joined Jan 10, 2012
2,390
I think the Arduino uses the FTDI chip to do comm through USB. So in that case, it makes a virtual COM port. So, in order to use it, you would program the UC to use the built in COM or serial port, and the external chip does the conversion. You never need to think about or program USB. For all your concern, you are using and programming the COM serial port.

If the Arduino doesn't have a native serial connector, I wasn't aware of that.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I've been reading that only 2 Arduinos have this problem, or lets say feature, the Arduino Micro and the Arduino Leonardo (the one I'm using). They have a hardware port -which is used exclusively by the bootloader on connection- and a virtual port for communications over USB. All other Arduino boards use the hardware COM port for communications.

When you first connect one of these 2 boards, the bootloader opens the first COM port available (e.g. COM port 3 in my case), and when it finishes, creates a virtual COM port (number 4 in my case) for serial communications.

Now, the software I'm trying to connect to receives data through the hardware COM port (I know because if I set the software to the COM 3, I see data coming when the bootloader port is open), but cannot connect to the virtual port (nothing comes in through COM port 4).

Said that, I know that I can send and receive data over the hardware port -by simply using "Serial1" instead of "Serial", but this only transmits over Pins 0 and 1 (Pins RX1 and TX1), and not through the USB cable connection.

What I need to do is to keep the hardware port open (the first COM port that is used by the bootloader) and send the data to that port, through the USB cable, into the COM port 3 on computer, and into the software.
 
Last edited:

shteii01

Joined Feb 19, 2010
4,644
I've been reading that only 2 Arduinos have this problem, or lets say feature, the Arduino Micro and the Arduino Leonardo (the one I'm using). They have a hardware port -which is used exclusively by the bootloader on connection- and a virtual port for communications over USB. All other Arduino boards use the hardware COM port for communications.

When you first connect one of these 2 boards, the bootloader opens the first COM port available (e.g. COM port 3 in my case), and when it finishes, creates a virtual COM port (number 4 in my case) for serial communications.

Now, the software I'm trying to connect to receives data through the hardware COM port (I know because if I set the software to the COM 3, I see data coming when the bootloader port is open), but cannot connect to the virtual port (nothing comes in through COM port 4).

Said that, I know that I can send and receive data over the hardware port -by simply using "Serial1" instead of "Serial", but this only transmits over Pins 0 and 1 (Pins RX1 and TX1), and not through the USB cable connection.

What I need to do is to keep the hardware port open (the first COM port that is used by the bootloader) and send the data to that port, through the USB cable, into the COM port 3 on computer, and into the software.
Have you tried closing Arduino IDE and using terminal program to receive data from the board?
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Have you tried closing Arduino IDE and using terminal program to receive data from the board?
Yes, the other programs work fine; for example: with a serial monitor I can see the data in/out fine through the virtual COM port 4. It's only the software I'm targetting that requires COM port 3, and listen to this... only for input (output works fine on COM port 4).
 
Top