Live data from Hacker News

The Serial TTL connector we deserve

kohlschuetter.github.io

51–60 of 80 posts

Re: The Serial TTL connector we deserve

#51
post #8

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. Replacemen…

Every vendor defines their audio jack connector serial port differently. It is very dangerous to use 3.5mm jack. There is no pinout standard of using 3.5mm.

Even as pure audio jack, the 3.5mm connector has two standards, with the difference on ground and mic.

Re: The Serial TTL connector we deserve

#53
post #19
post #18

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 whatev…

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…

I think they mean the debug adapter should auto-detect all these things, not the debug port. You'd have one adapter you could plug in to anything and it would usually magically work.

Re: The Serial TTL connector we deserve

#54
post #18

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 whatev…

you are over-engineering it. At the end of the day, it's a debug connector, when you use it, you should know what you are doing. The more thing you add to debug connector, the more thing you have to debug when the debug connector not working.

Re: The Serial TTL connector we deserve

#55

Nice but it’s huge! I’d prefer something smaller like these 3 pin magnetic connectors from Aliexpress. https://a.aliexpress.com/_c4CtK0gj

One side could be flush with an enclosure, but it's not clear how you attach the other side to a cable. There doesn't appear to be any housing to cover soldered wires, for instance.

Re: The Serial TTL connector we deserve

#56
post #45

Earlier quoted context omitted.

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.

In my experience with... it's maybe 20? ... embedded boards, junk during boot breaks the boot flow for about half of them. And attaching quickly after target powerup is very often the crux of the exercise, to get to the bootloader fast enough before it moves on, but also you don't have the shifters (or Vref pin) in place to be able to attach beforehand...

Since I once had the case where junk on the line (from a wiggly connection) caused Magic Sysrq requests I'm fully on your side. No junk tolerated for potential hot plug connections.

Re: The Serial TTL connector we deserve

#57
post #8

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. Replacemen…

Using a male TRS 3.5mm audio connector is something you should do with care. When you hotplug that connector the plug's tip (T) may first make contact with the sleeve (S) of the receptible, then briefly hit the ring (R) until it finally lands on the tip connector. Same goes for the plug ring (R) which may have contact with the sleeve (S) of the receptible.

So expected are:

  T → T
  R → R
  S → S
  
and what can happen briefly is:

  T → S
  T → R
  R → S  
  
Depending on what you're using the connector for, that can ruin your day. Likely this isn't an issue on serial connections, but I have seen people use that connector for power..

On audio systems this is typically not an issue, since tip and ring carry signals that on any gear worth anything should have an output stage that can easily handle a connection to ground.

Re: The Serial TTL connector we deserve

#58
post #19

Earlier quoted context omitted.

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…

I think they mean the debug adapter should auto-detect all these things, not the debug port. You'd have one adapter you could plug in to anything and it would usually magically work.

yes, largely - even if its just pin headers adding a detect line which shows a resistance between it and ground would be an improvement.

In my working life I've seen -

at least 3 different ways to do RS-232 on 8p8c

DTE-DCE is always an issue on standard 232, otherwise I wouldn't have so many null modem cables

232 and 3.3v TTL on the same board or assembly

3.3v and 5v TTL on the same board or assembly

Inconsistent labelling.

I'm in my mid 40's and I think there is a reasonable chance something with RS-232 serial timings will outlast me, it'd be nice to make it more foolproof, as its one of a very few interfaces that will work without drivers.

I do think as a matter of standard good design practice we should be putting clamping diodes on debug ports to prevent blowing things up if hit with the wrong voltage,

Re: The Serial TTL connector we deserve

#59
post #56
post #45

Earlier quoted context omitted.

In my experience with... it's maybe 20? ... embedded boards, junk during boot breaks the boot flow for about half of them. And attaching quickly after target powerup is very often the crux of the exercise, to get to the bootloader fast enough before it moves on, but also you don't have the shifters (or Vref pin) in place to be able to attach beforehand...

Since I once had the case where junk on the line (from a wiggly connection) caused Magic Sysrq requests I'm fully on your side. No junk tolerated for potential hot plug connections.

What byte sequence on a Tx/Rx/Gnd serial line can trigger Sysrq key sequences?

Re: The Serial TTL connector we deserve

#60
post #46

Earlier quoted context omitted.

You'll be wanting these: https://www.digikey.com/en/products/detail/edac-inc/686C0731... And yes, they're magnetically polarized according to the datasheet. To answer the sibling comment, they're through-hole soldered but frustratingly are 2.7mm not 2.54 so you'd be squeezing a little into an existing header (ignoring clearance on the side anyway). I'm not sure why the 7-pin is obsolete, they make up to 5-way active.…

Yes, yes :). I was really joking with the 7 pins. It would be amazing though to make it a hermaphroditic 4 or 6pin connector. With a pinout like this: GND TX [VrefTX VrefRX] RX GND So it always plugs at a 180° rotation, connecting RX to TX. And any cable also rotates 180°. Since you always have an odd total of (connections + cables), you always get the right connection...

Better yet, you could add more pins and switch them to using differential pairs to make it extensible for more use cases. While you're at it, you could have pins on both the top and bottom of the connector, and use a pair of sense pins to detect orientation, so that super specialized use cases can use every single pin available on the connector.

  GND TX1+ TX1- VBUS CC1  D+   D-   SBU1 VBUS RX2- RX2+ GND
  GND RX1+ RX1- VBUS SBU2 D-   D+   CC2  VBUS TX2- TX2+ GND
If only you could buy receptacles for this for like five cents a pop...

(If you do this, make sure that you don't send more than 3.3ish V over a pin, and that you're tolerant of 3.3V incoming, so that you don't explode yourself or victim devices if people randomly plug you into things. https://github.com/google/usb-cereal is a reference design for a UART over USB-C SBU adapter used for Pixel phones)

Post reply on HN