5 ms·
> I really, really like RS-232. It just works. Well... as long as everyone has their configuration correctly hand-configured. As the video states, RS-232 doesn
by inetknght 4y ago
> I really, really like RS-232. It just works.
Well... as long as everyone has their configuration correctly hand-configured. As the video states, RS-232 doesn't have any way to transmit a clock. So if one end is talking 9600 baud and another wants to talk at, say, 56000 baud, then... no it doesn't just work.
- bmitc 4y agoIt does because that is solved trivially by documentation. By just work I didn't mean plug and play. (USB isn't really plug and play anyway by virtue of it being terrible.)
- sgtnoodle 4y agoYou can also design the protocol to auto-determine baud rate. Some protocols even transmit 0x55 at the start of every packet, allowing for clock synchronization.
- camtarn 4y agoSometimes you get a device from a client who got it from another company who got it from etc etc. And it's been configured via internal memory to talk at some baud rate with some parity, and if you're really unlucky, it won't transmit unless it's received a command. And, like somebody else commented above, sometimes the Tx and Rx pins are just the wrong way around. Your experiences with USB sound incredibly frustrating. But RS232 can also be crap in its own unique ways. But to be fair, I do still rather like working on well behaved RS232/422/485 equipment, where you plug it in, set it to 9600 baud 8N1, and you just start seeing a stream of easily parsed text scrolling down your terminal :)
- bmitc 4y agoMost of the issues with RS-232 can be front-loaded though, and they are understandable. Once you get it going and document what's what, it's fine. For USB though, reaching an understanding of the actual problem is basically impossible.
- brendank310 4y agoWith RS232 you can hook up an old oscilloscope and measure what the right baud rate should be. Even in the "won't transmit unless it receives" case, a sweep on a waveform generator and well configured trigger will get you on your way. USB you'd need much nicer tools handy to get to the bottom of an issue. You are right on about the joy of it being 9600 8N1 on the first try.
- sgtnoodle 4y agoMy favorite was the time we received a new batch of controllers from a vendor, same revision number, and their RX and TX pins were swapped. When working with RS232, it's best to have a handful of null adapters and gender changers in your pocket.
- unboxingelf 4y agoThis brings back memories. We called them “gender benders”.
- reaperducer 4y agoDifferent item. While Gender benders could optionally be built with a null modem inside, as a single item their purpose was to link incompatible male and female ports. Having both a null modem and a gender bender end-to-end was common.
- dgfitz 4y agoStill is! I carry around gender-benders, null modem adapters and 120ohm CAN db9 resistors every day, along with usb-to-serial, peak can to usb, kvaser to usb, and ixxat to usb. These aren’t dead technologies by any stretch, not that you were implying that.
- Eleison23 4y agoWe never called them "gender benders" because that term had already been in use in the real world of gender ideology. Real techs knew them as "gender changers" which was different enough to be recognizable as only a technical term for cable connectors.
- randombits0 4y agoSo how did you reference master/slave? That term is already in use in the real world of human ideology. I’ll bet you’re not a native English speaker. Nothing wrong with that, btw.
- pdntspa 4y agoI've yet to encounter a situation where this is truly as issue.
- vardump 4y agoLucky you. Issues like one device got a slightly different baud rate, enough to make it either not work at all or having a lot of transmission errors? I have, and I'm sure a lot of other people have their own horror stories. Having a clock signal, like in I2C, solves that. Oh and that "oops, just connected 12V RS-232 to a 3.3V device," and see the magic smoke getting away...
- pdntspa 4y agoWhen I was doing embedded work all our terminals simply remembered the last settings and it was like we would set it once and not have to think about it again. The voltage thing is real (and real stupid IME) but we never ran into clock issues that would skew baud rates one way or another.
- exmadscientist 4y agoYou do need decently stable clocks for 232 and friends. Anything clocked by an RC oscillator is probably going to cause some sadness eventually. I2C is terrible in so many ways. (Don't send it off-board. Just don't. Ever. Trust me on this one. I don't care what you read about the bus capacitance spec, do. not. do. this.) Sending out a clock on a 400pF on-card bus isn't too bad, but when you have a kilometer-long cable... yeah, we'd rather not send a clock down that, thank you. Hence the use of self-clocked or pray-we-have-similar-clock-frequencies protocols. 3.3V or 5V devices aren't RS-232 and people need to be careful about that. They're just UARTs with regular old logic levels. RS-232 or 422 or 485 are Serious Business levels to go out and do battle with the mean Real World and the only place they should ever land is at a dedicated transceiver. Full stop.
- chasd00 4y agoAre you saying beware of i2c on a kilometer long cable?! Why would anyone even think that would be feasible?
- megraf 4y agoI've done a bunch of work with RS232 in the machining industry (CNC). Getting my mind around both software / hardware control sequences was the most challenging part. You can overcome the baud challenges with scripts that loop through common baud rates until alpha numeric characters are found. It's also nice that the same few windows applications have been in use for 20 years or so (I specifically worked with RS232 to TCP/IP).
- funstuff007 4y agoWith a buffer, it's probably pretty easy to guess the baud rate. Similar to encoding guessers for strings or the CSV.sniffer in Python standard library. https://github.com/chardet/chardet https://github.com/chardet/chardet https://docs.python.org/3/library/csv.html#csv.Sniffer https://docs.python.org/3/library/csv.html#csv.Sniffer