Serial issues with the Arduino Pro Micro

The Arduino Compatible Pro Micro and the Arduino Leonardo both use the ATmega32u4, which has built-in USB communications. While this eliminates the need for a secondary processor or UART chip, it allows the Leonardo to appear to a connected computer as a USB device, such as a mouse or keyboard, in addition to the virtual (CDC) serial/COM port.

While this sounds really useful, I was having a weird issue using a Pro Micro as a serial device with my ROV hardware, where, despite explicitly stating the baud rate and being able to turn on and off outputs while manually connected to it via the Arduino IDE Serial Terminal, at any baud rate and not the one set.

I was speaking to Nick Charlton whom I know from TermiSoc. He is trying to communicate between two Arduinos using RS485 on non-standard ports via software serial; it wasn’t until he shared the following image that I realised my issues may not be just related to my poor coding.

Serial issues with the Arduino Pro Micro and Arduino Leonardo
Serial issues with the Arduino Pro Micro and Arduino Leonardo

One of his Arduinos is a Leonardo that, like the pro-micro, uses the ATmega32u4 as its processor; this showed that I was not alone in having weird issues with serial.

I suspected the issue was related to how the lack of explicitly stating the baud rate allows for it to work; however, the problem is more specific than that. The ATmega32u4 requires that DtrEnable be set when opening the serial connection (on the PC end). The Arduino IDE Serial Monitor does that. However, most applications do not. Including my serial Python code.

A suggested fix for this issue is to edit the file “Arduino\hardware\arduino\cores\arduino\CDC.cpp”, which I would very much like to avoid, as editing core Arduino code is a quick way to break bigger things.

Another possible option is adding the line ”serialPort.DtrEnable = true” just before ”serialPort.Open()” but I have not tested that either.

My fix will be to skip using Arduino Pro Micros and use Arduino Uno R3S, which uses the ATmega328 processor for development. Once I have working code, I will reassess my choices, but chances are I will use an Arduino Mega 2560, which uses the ATmega2560 microcontroller.

Leave a comment

Your email address will not be published. Required fields are marked *

The maximum upload file size: 20 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop files here

7 thoughts on “Serial issues with the Arduino Pro Micro”