this post was submitted on 21 Jun 2023
2 points (100.0% liked)

Ask Electronics

3316 readers
2 users here now

For questions about component-level electronic circuits, tools and equipment.

Rules

1: Be nice.

2: Be on-topic (eg: Electronic, not electrical).

3: No commercial stuff, buying, selling or valuations.

4: Be safe.


founded 1 year ago
MODERATORS
 

Right to the point: On a BPI-R3, should connecting the UART debug pins directly to the appropriate pins on a DB9 USB serial adapter (rx->tx, tx->rx, gnd->gnd) work? Because I’m just getting a garbled mess in my serial console. I’ve tried all different baud rates. I’m using a high quality serial adapter (Keyspan Tripp Lite). I’ve tried on Linux and Windows. I assume I’m missing something stupid.

To make matters more annoying, I have a $5 almost certainly counterfeit USB serial adapter with USB on one end and DuPont connectors on the other end and it works fine, so at this point my problem is mostly academic. I would like to know what I’m doing wrong, though.

top 6 comments
sorted by: hot top controversial new old
[–] th_in_gs@lemmy.sdf.org 4 points 1 year ago (1 children)

I suspect your serial converter is expecting a ‘real’ RS232 signal, with its old-school now-weird voltage levels.

Your USB serial adapter is probably using 5V or 3V so-called ‘TTL’ signaling (which in the real world is mostly cross-compatible between 5V and 3V)

Good explanation here: https://www.sparkfun.com/tutorials/215

[–] MaximGun@discuss.tchncs.de 2 points 1 year ago

Yeah this must be it. Thanks.

You probably have already sussed this - but:

DuPont connectors equates to logic level signals. There may even be a 3.3 v <>5v link selector on the adapter.

Whereas DB9 equates to "RS232" level signals. Generally, at least the capability to accept those voltage levels, even if not necessarily producing them.

My first step tends to be to connect tx to rx and see if characters typed in a terminal/emulator get echoed.

An RS232 breakout box is pretty much a given necessity, when it comes to sorting out what's happening on all those pins and sorting out what to connect to what.

[–] PCChipsM922U@sh.itjust.works 2 points 1 year ago* (last edited 1 year ago) (1 children)

It's probably just the converter... something misconfigured in the drivers or... who knows. Try and see if you get the same garbled data in Windows and Linux (binary check). If they match, it's something hardware wise.

Back in the day, yes, the Chinese USB to Serial/Prallel converters were terrible, no doubt there. But, over the years, they've gotten surprisingly good. In fact, I picked one up a few weeks ago (as you said, about $5), works like charm.

[–] th_in_gs@lemmy.sdf.org 2 points 1 year ago

I suspect your serial converter is expecting a ‘real’ RS232 signal, with its old-school now-weird voltage levels.

Your USB serial adapter is probably using 5V or 3V so-called ‘TTL’ signaling (which in the real world is mostly cross-compatible between 5V and 3V)

Good explanation here: https://www.sparkfun.com/tutorials/215

[–] pneumapunk@lemmy.sdf.org 1 points 1 year ago* (last edited 1 year ago)

In addition to the voltages being different between real-RS232 and "TTL"-serial, they're also swapped. On a DB9 you probably have something approximating RS232, where mark=-9V and space=+9V, but the debug header is likely mark=+3V and space=0V. So even if your inputs can handle a wide voltage range, the sense is inverted, which is why you'll get garble.

(For example, when the line is idle it's at the 'mark' voltage and the receiver knows a character is incoming when it transitions to 'space' for one period (the start-bit). If mark and space are swapped, the receiver will see 'space' most of the time and only detect a character starting when there are some 'mark' bits in the middle of a transmitted character. It'll never actually synchronize correctly with the transmitter.)

You can figure out what you've got with a multimeter and checking what the voltage is on the TX pin when it's idle.

load more comments
view more: next ›