I am interfacing a custom designed Arduino device with a third party serial based software that is outside of my control. The software is essentially a (very) commonly used data logger for this type of device. My device is built around an arduino pro micro, which of course has a 32u4.
The Arduino gets serial commands from the software that it needs to reply to, but the PC based software package sets DTR and RTS to low. I've learned that when a 32u4 based arduino has a low DTR, it refuses to output serial data, even though it is receiving data.
Research indicates I am not the only person with this problem, but the solution is to generally give on on the 32u4 Arduino's, and revert to a 328 based board. I don't have that option...I'm stuck with a 32u4 based device.
How, in software or firmware, can I hack a 32u4 based Arduino to ignore DTR being low, and spit out Serial data like FTDI arduino devices are happy to do? I'm open to hacks at this point, but it needs to be software/firmware based.
I don't know. To be clear, I am using the 32u4 vitual USB interface, and not the native serial interface. I don't believe there is a DTR pin exposed for the virtual USB to Serial interface...I think that's all inside the 32u4, but I could be wrong.
FTDI based (and similar) "USB Serial Ports" are happy to send data to PC applications regardless of whether the PC software they are talking to sets DTR (data terminal ready) to HIGH, indicating it is actually ready for data. Serial.print() from arduino works great regardless of DTR settings...and the PC software in question sets DTR to low (and can actually use a normal serial DTR wire for a non-standard purpose.)
Unlike FTDI based USB Serial devices, 32u4 based "USB Serial Ports" refuse to send data to the PC, unless DTR is set to high, which only the PC based software side can set. If the PC software does not set DTR to true (high?), then Serial.print() on Arduino goes into a black hole, and the software never gets the responses from the Arduino.
End result...the software can send commands to my board, but because the PC software does not set DTR, my Serial.print() responses are not received...the 32u4 essentially blocks the responses because DTR is low...even though serial is data is going TO the arduino.
That's all well and good, but he changed the PC side software, which I can't control.
This is only an issue on 32u4 based Arduino devices, as best as I can tell. The Uno style devices, and PIC based devices seem to send USB serial data regardless of DTR state.