TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The RS-232 protocol [video]

350 点作者 EgoIncarnate超过 2 年前

22 条评论

bmitc超过 2 年前
Having worked with a lot of instrumentation and control stuff, I really, really like RS-232. It <i>just works</i>. I made the mistake on one project to go all USB, and it was a complete nightmare. Basically, anything you can think of went wrong, from USB controllers maxing out on number of devices (despite the number of devices being a mere fraction of the allowed devices in the USB spec), devices causing other devices not to work if on the same hub, devices disconnecting, etc. I couldn&#x27;t even get manufacturers to tell me how many USB devices their USB controller supported. I often had to use tools like USB Device Tree Viewer (<a href="https:&#x2F;&#x2F;www.uwe-sieber.de&#x2F;usbtreeview_e.html" rel="nofollow">https:&#x2F;&#x2F;www.uwe-sieber.de&#x2F;usbtreeview_e.html</a>) to understand what was going on. There was another USB debug tool that I used that I&#x27;ve forgotten the name of (maybe USBDeview). And if USB devices disconnect, the only way to guarantee getting back to them is to restart the OS process, which makes your software very fragile. Same thing with cameras with USB vs something like Camera Link. A camera&#x27;s USB driver crashing would make you restart your entire program, making it very hard to build systems. Camera Link, another serial protocol, also just works.<p>RS-232 and RS-485 are just so reliable. The higher voltage of +&#x2F;-12V makes it more resilient to noise, and the protocols are just simple. It isn&#x27;t the fastest around, but it can still be pretty fast depending on how the protocols are implemented.
评论 #33484707 未加载
评论 #33484425 未加载
评论 #33485322 未加载
评论 #33485566 未加载
评论 #33488330 未加载
评论 #33491501 未加载
评论 #33487761 未加载
评论 #33485844 未加载
评论 #33490604 未加载
评论 #33484576 未加载
gorgoiler超过 2 年前
One of my proudest hacker moments was also one of my first: debugging a noisy console session whose transport was RS232.<p>Long story short (it was 30 years ago so I also can’t remember the precise diagnosis) there was corruption on the line in that sometimes when you typed a space it would come out as something random. Few other characters were corrupted as often, if at all. It was almost always spaces that were showing up as random other characters.<p>My observation was that space was encoded as 00000 — all low, the printed character most susceptible to line noise — and that something wasn’t grounded. Smarter people took my observation, figured out what was wrong, and soon all was fixed. It felt like, for the first time, I understood the system with a depth I’d not had before. It was cool.<p>Oh, and playing DOOM for the first time over RS232, too. Another precious memory indeed!
birktj超过 2 年前
Yesterday I was configuring a usb to serial converter to communicate with a CNC controller (over RS232). However I was unable to transmit any data and so I brought the oscilloscope to see what was happening. I disconnected my converter and connected the oscilloscope and all the data was there and my oscilloscope had no problems decoding it with the same parameters i had used with my usb converter. Confused, I disconnected my scope and connected my converter back up again, but sill nothing. After a few times back an fourth I ended up connecting my scope up while the converter was still connected and crucially I also had a cat &#x2F;dev&#x2F;ttyUSB0 running and as expected the data was right there at the scope, but to my big surprise it was also there in my terminal! I then tried to disconnect my scope resulting in no more data being sent to my laptop.<p>The only explanation I could think of was a faulty ground connection. The scope was grounded through the wall socket same as the CNC and thus had the same ground potential. My laptop on the other hand was running on battery and only shared ground with the CNC through RS232 pin 5 (signal ground). However it seems this pin was not correctly connected on the CNC side and thus I was unable to transmit any data. Experimenting a bit I tried to connect ground to the connector shield instead and everything worked perfectly.
评论 #33486952 未加载
评论 #33486912 未加载
评论 #33488571 未加载
63超过 2 年前
&gt; Please don&#x27;t do things to make titles stand out, like using uppercase or exclamation points, or saying how great an article is. It&#x27;s implicit in submitting something that you think it&#x27;s important.<p>&gt; Otherwise please use the original title, unless it is misleading or linkbait; don&#x27;t editorialize.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html</a>
评论 #33484087 未加载
tyingq超过 2 年前
Interesting comment on the video:<p><i>&quot;The negative voltage requirement of RS-232 is why some ATX power supplies still provide a negative voltage reference on one of the pins. The power supply manufacturers want to provide it in case the end user has a motherboard that uses on board RS-232 (some industrial motherboards still use it). usually the available current for the negative voltage reference is pretty small though (around 1 amp or less)&quot;</i>
评论 #33488565 未加载
评论 #33483051 未加载
评论 #33489042 未加载
0xmarcin超过 2 年前
Great to hear that. BTW in meantime other ppl also posted amazing content. Right now I am following this guy (<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=VvyUAaRTsww&amp;list=PLcGZbzUhfcJbEazYYKUgdnEskZa5PX86N" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=VvyUAaRTsww&amp;list=PLcGZbzUhfc...</a>), he builds x86 breadboard computer, but does so with much more tech detail &amp; compiler&#x2F;liner mastery than Ben.<p>(If you are interested into x86 breadboard stuff, please check The 8088 Project Book - which is a great intro befor jumping into more advanced stuff).<p>BTW I have a PoC of using C with Ben Eater computer - <a href="https:&#x2F;&#x2F;github.com&#x2F;marcin-chwedczuk&#x2F;ben-eater-6502-ansi-c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;marcin-chwedczuk&#x2F;ben-eater-6502-ansi-c</a> I do not have time to dig deeper into it yet, but looks promising. The only problem with 8-bit processor is that they use first page of memory to pass extra variables because stack is too small (256 values in total, yup).
评论 #33484180 未加载
scarecrowbob超过 2 年前
I will watch this one later, but I can totally understand the excitement.<p>Just for some background: in college I took an introductory digital logic class and loved it, but then I moved over to a humanities degree and lost a lot of that information. Then I started programming again, but mostly as a &quot;self-taught&quot; web developer-- not to undercut my high school and college work (I was on a HS programming team that was competitive), but most of what I use in my day to do day life are things I picked up from having to do increasingly difficult projects&#x2F;tasks as a programmer interspersed with ocasional seasons of motivations where I&#x27;d pick up new techniques (functional programming, server management, front end web rendering frameworks, etc).<p>Ben Eater&#x27;s long series on building a computer out of 65c02 and then his longer series on building a microprocessor from TTL logic chips hit an incredibly sweet spot for me.<p>I&#x27;d spent some time trying to teach my kids how to do basic electronics (building things like 555 timers or little robots with pi&#x27;s for controllers, so I have some familiarity with the topic.<p>I suppose if I had the time and were motivated, I could have gotten some textbooks and learned the same material. However, his material was setup in a way that made it very easy to grasp as a passive consumer of the video. It feels like it covered the topic as deeply as I was interested and answered a lot of questions as it went along.<p>So, as a person who has enough familiarity with the concepts to find it interesting but no pressing need to master the material deeply, I highly recommend his work.
评论 #33484021 未加载
stephc_int13超过 2 年前
Imagine a world where simple point to point data link would still use a backward compatible and improved RS-232 and where everything else was using Ethernet.<p>I would be curious to see an evaluation of the collective cost of USB + Bluetooth over the decades since their inception.<p>I&#x27;ve seen the guts of USB drivers a long time ago, I could not describe the horror.
mmac_超过 2 年前
Most people will be familiar with RS-232 when connecting to a computer (COM ports). In the industrial&#x2F;embedded world, it&#x27;s still used quite a bit to connect to devices for logs&#x2F;terminals&#x2F;programming and setup etc. Of course now we rely on usb-serial adapters to connect them to our laptops.<p>RS-232 is still used for connecting to some embedded chipsets. Best example would be modems&#x2F;4G modules. You can pick either RS-232 or USB, however sometimes on that little microcontroller you&#x27;re using it won&#x27;t have USB. If you don&#x27;t need a huge amount of throughput then the serial port is fine.<p>RS-485 as others have mentioned is great. Often you can&#x27;t run new cables for cat&#x2F;fibre so you&#x27;re stuck with stealing some copper off an old system that has been decommissioned. You&#x27;d be surprised how far you can run a RS-485 system at low speed and maintain high reliability.
评论 #33490579 未加载
评论 #33487523 未加载
anonymousiam超过 2 年前
Nice informational video (after such a long time) and I don&#x27;t mean to be pedantic, but RS-232 is not a protocol, it is an electrical&#x2F;physical standard. RS-232 says nothing about the bits on the wire, other than how they might be synchronized as long as both ends of the point-to-point link agree on settings.
spookthesunset超过 2 年前
His homebrew CPU was the best explanation of how microprocessors work I’ve seen!
davidpfarrell超过 2 年前
Just FYI what fun thing is explored in the video:<p>&gt; This video explores the electrical and timing characteristics of the RS-232 protocol.
geerlingguy超过 2 年前
His visual exploration into various protocols is eye-opening. I love the style and always learn a few things when looking at protocols from a signal-level perspective.
评论 #33483119 未加载
joneholland超过 2 年前
I posted this on the YouTube comments as well. I’m pretty sure there is minor bug in how he uses 7 cpu cycles to try to read from the middle of each pulse. It should be about 50. He divided the 13 cycle wait in half but the reason he used 13 cycles originally is because the read logic was already using many cycles. In practice this doesn’t matter because the state transitions are stable enough with his particular device.
评论 #33484304 未加载
unboxingelf超过 2 年前
Started my career in software building automation systems around RS-232, IR, and ethernet. RS-232 was always my favorite because compared to the other protocols it just worked; IR was often unreliable and ethernet had much more complexity. I think I could still wire a db9 pinout from memory.
ThrowawayTestr超过 2 年前
This is the guy that made a video card from scratch, neat.
评论 #33482568 未加载
louwrentius超过 2 年前
This video is made by Ben Eater. He has virtually disappeared online for almost a year now (give or take). I hope he is OK and I really miss his videos.
评论 #33486515 未加载
cafard超过 2 年前
The first technical book I ever bought, 35 or 36 years ago, was <i>The RS-232 Solution</i>. I was doing tech support in those days for an outfit that sold systems built on similar but not identical gear, and reading that book considerably increased my efficiency.
hbogert超过 2 年前
I should really pick up his vids, they are worth their thumbs up in gold
rektide超过 2 年前
Is there a word to describe the +&#x2F;- signal behavior of rs232? It&#x27;s like a differential signal, but with a pesky common ground, bother.
评论 #33484351 未加载
评论 #33484386 未加载
评论 #33483697 未加载
评论 #33484364 未加载
评论 #33486318 未加载
fuzzfactor超过 2 年前
Looks like this would be RS-232F.<p>It was way back in RS-232B when the Mark and Space were reversed.<p>And the standard called for robust performance with all circuits not affected by any miswiring up to +&#x2F;- 25 VDC on any pin at any time. Must not requie powering down before connecting&#x2F;disconnecting.<p>DCE really meant Data Communication Equipment, i.e. primarily Bell-approved acoustic telephone modems (to be operated back then no faster than 300 baud when using their monopolized land lines).<p>So a DTE was Data Terminal Equipment which means a regular &quot;dumb&quot; terminal which is just a keyboard and CRT display with an RS-232 input&#x2F;output having the D-sub (male) pinout according to the DTE pinout scheme. A PC is a lot more powerful but with a terminal app or the correct tty i&#x2F;o your keyboard, display, and motherboard 9-pin D-sub (if available) will do it better than ever.<p>In the video, he&#x27;s connecting only the transmit pair from his terminal, not shown would be the handshake lines which are, as seen, actually &quot;optional&quot;. Not really but with lots of hardware if the recieving DCE end were not able to signal Data Carrier Detect (DCD), Data Set Ready (DSR), and Clear to Send (CTS) on the proper handshake lines back to the DTE terminal, there was going to be no data coming out of the terminal from pin 2 for you.<p>I would expect in the software of his RS-232 adapter, that he has continuously enabled the handshake lines needed by the PC to recognize that his external device is ready to recieve. So he therefore needs no extra conductors between the devices to accomplish that handshake purpose.<p>The DTE terminal would ideally signal power on and buffer ready on the DTR and RTS pins or the modem would speak not.<p>On the DTE the outputs are Data on pin 2 and logic on DTR and RTS. The inputs are Data on pin 3 and logic on DSR, DCD, and CTS.<p>On the DCE the outputs are Data on pin 3 and logic on DSR, DCD, and CTS. The inputs are Data on pin 2 and logic on DTR and RTS.<p>The default concept was supposed to be a cable with straight connections between pins 1, 2, 3, 4, 5, 6, 7, 8, and 20 of a male and female D-sub 25 connector at each end. On the hardware, the DCE modem had the female D-sub and the DTE terminal had the male D-sub, so it was just a straight cable. Multiple cables could be used as extension cords. Good for hundreds of feet with careful wiring considerations. In the abscence of handshakes only two conductors needed for one-way communication.<p>On the first PCs there were two D-sub 25 pin connectors on the back, the female was a (ribbon cable) bus parallel port for the printer, and the male was an RS-232 serial COM port for use to connect to a telephone modem.<p>When the mouse came along they were RS-232, most people did not have a modem yet (why would you want to connect to someone else&#x27;s computer anway?), so there was an available port. Connector was downsized to 9-pin with partial pin renumbering.<p>Actually you could always connect two PC&#x27;s together and bypass the handshake settings in software if your buffers were adequate, you only needed 3 conductors; a ground with 2 &amp; 3 crossed over. There is also the optional XON&#x2F;XOFF software handshake otherwise which is signaled within the data stream instead of needing excess conductors in the cable. Or you put a local jumper between some handshake pins at one or both ends of the cable to force the handshake logic if you didn&#x27;t truly need the extra logic conductors between your target devices.<p>On any one connector, there should be a couple handshake pins (other than communication pins 2 and 3) where, in the abscense of intentional hardware signal changes, these pins remain at a constant positive or negative voltage. So either voltage is available at either end of the cable for <i>local jumpering</i> in order to fake a handshake if necessary to coerce data flow in one or both directions. Small (sometimes unique) rats nest of wiring inside of one or both ends of &quot;proprietary&quot; RS-232 cables under the hood is normal, to get by with fewer conductors since most serial devices are not modems any more and have lesser logic needs.<p>For one-way communication he&#x27;s wise to use only two conductors between devices and skip the confusing &quot;null-modem&quot; fake-handshake approach I have seen so much of. Fortunately modern (1990!) RS-232 software allows you to enable various handshake lines at the terminal.<p>Here&#x27;s some example wiring workarounds showing that almost anything goes:<p><a href="https:&#x2F;&#x2F;www.perle.com&#x2F;support_services&#x2F;cabling&#x2F;documents&#x2F;db25_dce_cabling_examples.pdf" rel="nofollow">https:&#x2F;&#x2F;www.perle.com&#x2F;support_services&#x2F;cabling&#x2F;documents&#x2F;db2...</a><p>At slow baud rates like 300 or less if available, your data can be visualized in real-time without an ocilloscope. With bypass of the hardware handshakes enabled in your communication software, ideally connect a bipolar LED (having an appropriate current-dropping resistor in series) between only male pins 2 &amp; 5 of the PC&#x27;s D-sub 9-pin connector. Although an ordinary (unipolar) LED can be good too, then alternatively reversed in polarity, showing only the marks or the spaces either way. This could just be popped into the breadboard in the video. As you press a key when terminal i&#x2F;o is to that COM port it&#x27;s almost like Morse code on the LED. These are the same two pins he is using to connect from his COM port to his breadboard.
评论 #33486828 未加载
timonoko超过 2 年前
RS-232 has a protocol? You mean &quot;do not send after XOFF&quot;. Too long video to watch and find out.
评论 #33490433 未加载