Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Raw USB Serial

  1. #1
    Member
    Join Date
    Nov 2012
    Location
    Santa Fe, New Mexico, USA
    Posts
    32

    Raw USB Serial

    I built a Teensy USB MIDI project years ago for interfacing a morse code key to a PC, it works great, but some people just can't figure out MIDI.

    It turns out that there is another way to interface a morse code key to a PC over a serial port. It toggles CTS and DSR in one direction and RTS in the other. I've got a working example on my desk using a USB<->Serial converter connecting to a morse code program running in Wine on my Ubuntu laptop. It would be neat if I could extend the morse MIDI interface widget to support the morse Serial interface as a second option.

    I've looked through the Teensy USB Serial code but I haven't found any sign of the full set of RS232 control signals. Is there any way to get at these signals in a Teensy implementation of USB Serial?

  2. #2
    Member
    Join Date
    Nov 2012
    Location
    Santa Fe, New Mexico, USA
    Posts
    32
    It looks like there is a notification defined in the CDC documentation for SERIAL_STATE which is intended to communicate UART bits, though it doesn't list CTS among the mapped UART signals. Sending a notification to the host appears to require setting up a notification specific interrupt endpoint in the usb serial interface, the management endpoint is receive only on the Teensy. And implementing additional capabilities would require fiddling with capability bits in the interface descriptor.

    I'm confused by the status of CTS. I've got two programs that can see CTS changing state on /dev/ttyUSB0, and both programs call out the signal by that specific name, but the USB standard never mentions that signal by name. It must be defined in the FTDI drivers somewhere.

    Oh, that's interesting, the FTDI chip is a vendor class device, it has no management endpoints at all, it's just bulk data endpoints, the UART bits must be free riding somewhere in the data protocol.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,282
    Teensy's USB serial code has functions you can call to query the RTS and DTR (virtual) signals sent by the PC. They're documented here:

    https://www.pjrc.com/teensy/td_serial.html

    The code we publish does not provide any API for signals in the Teensy-to-PC direction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •