USB Serial.rts() and Serial.dtr()

garyfk

New member
These should not both be read-only as one comes from the DTE and the other from the DCE. So, one should be a write-only. Which one depends on whether the Teensy acts like the DCE or DTE.
Gary
 
These are both effectively read-only. They are functions which return the current value of these virtual signals. They're not variables you can write, or read directly. Reading is done by calling the function.

To the extent DTE & DEC terminology can apply to USB virtual serial, the USB host (your PC or Mac) acts in the DTE role and the USB device (Teensy) acts in the DCE role. Since the DTE outputs signals DTR & RTS, on the DCE side (Teensy USB device) these virtual signals are indeed read-only.

On a side note... just imagine how much more confusing USB protocol would be if everything had similar-looking 3 letter acroymns rather than regular word names like host, device, bulk, control, isochronous, endpoint, descriptor, etc...
 
Last edited:
Paul,
You are right, my mistake. I would have hoped that the Teensy could be made the DTE. In any case, I was wanting to use a T4.0 as a radio-controlling CAT device but needed at least one serial port control signal. All CAT controllers treat the radio as DCE and use RTS and DTR signals to control time-sensitive things like CW key, RTTY shift and PTT.
Gary
 
I would have hoped that the Teensy could be made the DTE.

We do have a USB host port on Teensy 4.1. I'm not sure if we ever really implemented these virtual modem control signals in USBHost_t3. But if not, they certainly could be made to work with some amount of code added to that library.

Of course the host port and USBHost_t3 can only work if the radio you wish to use is a USB device. And if your radio is a USB device (meant to be connected to a PC or other USB host) it could not possibly work connected to Teensy's main USB device port. USB device never talk to each other. They only talk to a USB host.

What you can't do is make the USB host act as DCE, nor can a USB device act as DTE. That's not anything specific to Teensy, it's simply how the USB serial protocols are defined.
 
Back
Top