The Serial TTL connector we deserve

(kohlschuetter.github.io)

38 points | by kohlschuetter 2 days ago

11 comments

  • foresto 1 hour ago
    FTDI (the company practically synonymous with TTL serial adapters) uses 3.5mm tip-ring-sleeve connectors for this. In other words, a common headphone jack.

    I added one to my single-board computer enclosure, following FTDI's wiring. Now I can easily connect whenever I need to use the serial console, and a standard 3.5mm audio extension cable will let me reach across the room without moving my main computer. Replacement parts, if I ever need them, are cheap and easy to find.

    Here's the pinout:

    https://www.ftdichip.com/Support/Documents/DataSheets/Cables...

    • eqvinox 1 hour ago
      That really sucks for hotplugging since TRS connectors sliding in basically make random connections before seating properly.

      Granted, you shouldn't hotplug TTL serial, but everyone™ does it anyway. (In some situations you're even forced to, to avoid reverse powering something.)

      • foresto 1 hour ago
        They're not random connections; they're predictable. I'm not worried about Tx briefly touching Rx or ground in these devices.
        • eqvinox 1 hour ago
          Random in the time sense. You'll get junk on your serial line, depending on the scenario that can matter a lot.
          • foresto 55 minutes ago
            My scenario is connecting terminal emulators to getty or u-boot, which I think is a common one. A blip of line noise here would be barely considered an annoyance, easily cleared by pressing Backspace.

            But yes, if someone happens to be using their serial line for some kind of sensitive signaling, then I would agree that choosing a more isolated connector (or avoiding hotplug) would make sense.

            • eqvinox 52 minutes ago
              Thing is, for a serial TTL connector to become ubiquitous, it needs to cover at least something like 99% of scenarios. Or maybe 95%. 3.5mm TRS ain't that, and thus just increases general diversity in connectors.
              • exmadscientist 20 minutes ago
                In my experience noise on hot-plugging the serial adapter is a complete nonissue. I'm sure it matters for you, sometimes. But for this kind of embedded work, I'd say it's important far, far less than 1% of the time.
  • exmadscientist 15 minutes ago
    > I assume that all connections use 3.3V signal levels. Should I ever come across 5V signals, I would probably use a larger Julet M8 for differentiation. OpenWrt writes that some routers already ship with incompatible 1.8V or 2.5V logic. Should the time arrive that I need to work with those, I would probably use this little fella called Micro Q ....

    At that point please, please, please just switch to the 4-wire configuration exposing V_IO (aka V_target aka ...). So many problems go away when you have that available. It's nice to have at 3.3V as well, but a lot of OTS 3.3V adapters aren't configured to make use of it.

  • Aloha 1 hour ago
    I would tell anyone who is doing a new traditional serial connector/cable to add the following -

    1. Automatic DCE-DTE detection and an interface which will rewire itself as needed to be the correct way, or you automatically know DCE vs DTE by connector gender.

    2. Automatic Voltage Detection - 232 levels, TTL 5v, TTL 3v - and interfaces that are isolated enough to deal with the wrong voltage (clamping diodes or whatever), or different cable sizes for each.

    3. Automatic type detection - TTL/RS-232, RS-422, RS-485, or different connector types by each.

    Ideally I'd do this on a 8p8c or 10p10c connector, because of ease of making cables, with various resistance values across pins 1-8, or 1-10 to tell you what kind of interface it was.

    • eqvinox 1 hour ago
      At that point it's not a debug connector anymore. Note there's a pseudo-standard for V.24/RS232 on RJ45 already, and nobody uses it for debug connectors since (a) you'd need a RS232 transceiver and (b) RJ45 connectors are honking huge.

      The point is to shave off the last cent, which is why you get a possibly-unpopulated 1×4 or 1×3 2.54mm header. Bonus points if the manufacturer designed series resistors into the board (let's say 0402 or even 0201) and left those out too to save the last 0.01 cent.

      • Aloha 21 minutes ago
        I'm open to other options, the biggest things is DTE-DCE auto detection
    • Geof25 1 hour ago
      What you are describing is going to be nightmare to work with - i.e. when you will have automatic detection of levels and it will decide to push RS232 into 3V3 MCU then you will have dead, maybe one of the kind prototype or dead expensive production device
      • Aloha 38 minutes ago
        Depends on what you make the default as.
  • m3galinux 1 hour ago
    I mostly just go with 3.5mm audio jacks; FTDI makes a prebuilt cable: https://ftdichip.com/products/ttl-232r-5v-aj/
    • rjsw 1 hour ago
      Pine64 use audio sockets for debug uarts.
  • notthetup 2 hours ago
    Nice but it’s huge! I’d prefer something smaller like these 3 pin magnetic connectors from Aliexpress. https://a.aliexpress.com/_c4CtK0gj
    • eqvinox 1 hour ago
      And where do I put Vref, RTS, CTS, and plug detect? That's 7 pins ;)

      </jk>

      Less of a joke though: those aren't polarized, how do you not accidentally 180° them? Are they magnetically polarized or what?

      [ed.: I didn't initially see it, they're mechanically polarized, one "short end" is flat, the other rounded.]

    • amelius 1 hour ago
      Do you solder them to a PCB directly?
  • amelius 1 hour ago
    I always wonder why Molex makes only black and white connectors. This makes it needlessly difficult to use different connectors for different purposes. Same with phoenix contact but there it's mostly green terminal blocks. Is it so difficult to just offer some more colors?
    • Aurornis 29 minutes ago
      They’ll make them in any color you want if you order enough.

      Adding more colors would multiply their logistic and inventory requirements, which are already hard with so many different connectors multiplied by number of pin options. Multiplying that even further by number of colors that most people would never buy isn’t a win.

  • wildzzz 1 hour ago
    Ideally you wouldn't need to expose a TTL serial debug port to begin with. Maybe on a prototype you would want this but I'd rather just have a single connector that can expose everything (jtag or swd). Bonus points if the interface chip is on the board so it's just a USB port
    • eqvinox 1 hour ago
      FUSB307B is amazing for this, it has a hardware DBG output pin indicating that a USB-C debug accessory mode connection has been made. Perfect for connecting a mux and putting SWD & serial on some USB-C pins.

      Too bad there's no standard for debug accessory connections. Also, at that point (putting a USB-C TCPC on your board) you might as well do full usbserial…

      NB: there's no orientation detection in debug accessory mode.

    • Geof25 58 minutes ago
      Well the first problem you will hit I'd that very likely you will need to protect or isolate those lines from ESD. This will raise price of device and it will get denied just in these grounds.
      • exmadscientist 18 minutes ago
        ESD diode costs are nothing compared to the connector headers or even dealing with the mechanical complications of exposing Just One More Thing. Seriously, they're cheap.
  • eqvinox 1 hour ago
    The only things with a chance at succeeding in this space are putting USB-serial directly on the board + USB-C, or alternatively bluetooth classic RFCOMM profile. (The latter is a very long shot.)

    Apart from that, this doesn't even touch upon the various voltage levels for logic-level serial ports, or the question of whether to Vref or not to Vref. (Or RTS/CTS.)

    • russdill 21 minutes ago
      Microcontrollers that support BLE are getting so cheap this really is becoming an option. Hopefully with some button that activates it.
  • hlieberman 1 hour ago
    TagConnect or EdgeConnect ftw.
    • eqvinox 1 hour ago
      Is there a standard for TTL-serial pinout on those? I'm not aware of one, only for SWD…
    • bsder 44 minutes ago
      .100 headers tend to be smaller than most TagConnect/EdgeConnect footprints and you don't have to use expensive custom cables.

      The alignment mechanisms on TagConnect/EdgeConnect negate any space advantage.

  • dazhbog 1 hour ago
    I cannot count how many PCBs I did with various quick connect ideas to have a fast way to debug..

    - Chop a PCI connector and have edge fingers on the PCB

    - Skedd connectors

    - Micro usb with a toggle switch or solder blob to switch between SWD/UART or USB

    - Low profile usb-c and have D+/- as normal, and RX/TX over the accessory pins (like audio)

    - Pogo pin clips

    - GH1.25 connectors

    - Tag-connect meh

    - If thickness of pcb allows, your PCB can plug directly into a USB-A port (Thicc pcb) or if its too thin, it can plug into a male usb-c connector from a charger cable(might bend some pins though)

    etc. etc.

    So just like the author, anything but Dupont connectors ;)

  • andrewshadura 1 hour ago
    I found Julet connectors incredibly hard to disconnect once plugged in. I can’t get a good grip on anything.
    • MrBuddyCasino 1 hour ago
      They’re good for eBikes because they’re sturdy and don’t disconnect easily, but I dread un-/plugging them.