Go Down

Topic: How to get 32u4 arduino to ignore DTR for USB Serial? (Read 1 time) previous topic - next topic

starvingmind

Sep 11, 2014, 09:55 pm Last Edit: Sep 11, 2014, 10:03 pm by starvingmind Reason: 1
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.




CrossRoads

Can you just not connect those 2 lines? Only hook up, Rx, Tx, Gnd to the appropriate pins.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

starvingmind

#2
Sep 11, 2014, 10:02 pm Last Edit: Sep 11, 2014, 10:04 pm by starvingmind Reason: 1
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.

CrossRoads

No, you're correct. I didn't it had flow control built in.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Please go thru Section 22 of the 32U4 data sheet and explain the DTR/RTS concept in USB terms. I am not following what you are saying.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

starvingmind

#6
Sep 11, 2014, 10:25 pm Last Edit: Sep 11, 2014, 10:29 pm by starvingmind Reason: 1
I'll explain differently, then go read sheet.

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.


starvingmind

I don't see any reference to DTR in the 32u4 datasheet.

As one point of reference to this problem...
http://forum.arduino.cc/index.php/topic,119557.0.html
"DTR must be set to ON and RTS must be OFF. I changed the code in my Serial class and voila: it works fine"

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.

CrossRoads

Well, we can't help with the PC software side much.
I don't know anything about the 32U4's USB software, never dug into that code.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up