by notthetup · 6mo ago · 0 comments
</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.]
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.
Or Adafruit? https://www.adafruit.com/product/5468
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... 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)
I think rotation is a bit extra though. The frustration with the dupont/0.1" headers is that they're not polarized. As soon as you add a key (or a literal magnetic polarity here), that problem goes away.
There are possibly ways to handle orientation in software. If you did a 4-pin and include VCC, the pinout on the pi is hi-lo-tx-rx, so you could look for hi-lo-hi-hi and wait for some period to identify any logic transitions on the tx pin. There should always be a period where that pattern is correct, because either the output is idle (high) or it's sending a bit sequence which will also involve a high somewhere. If you ever see the "2nd" pin high, you know it's not ground. Then your serial transceiver needs some way of setting up rx/tx or tx/rx (either you remap the pins, software serial, or use an analog multiplexer).
So, for example, with 3-wire serial and a non-polar 3-pin connector: TXD and RXD backwards (again) so nothing talks? No worries: Flip the connector 'round 180 degrees, and it works.
Same goes for CTS, RTS, DTR, DSR, and so on.
Those magnet couplings are nice. EDAC make a non-Aliexpress version, about $25 a pair.