EmbeddedRelated.com
Forums

Boxed MCU with RS-232 Port

Started by Rick C January 17, 2023
On 2023-01-18, Rick C <gnuarm.deletethisbit@gmail.com> wrote:
> > The data sheet I saw has a table of minimum capacitance for three > Vcc ranges, 3.3V, 5V and 3.3 to 5V approximately. Only 3.3V was > 0.1 uF on all caps. The others were larger on at least one cap. > Table 9-1 on page 12. 1
I'm reading Maxim's datasheet, see https://pdf1.alldatasheet.com/datasheet-pdf/view/73152/MAXIM/MAX3232CPE.html If you're looking at a sheet from another manufacturer that may change, leading to the same kind of incompatibility as seen with the MAX232 variants.
> You mean the RS-232 (TIA/EIAI) specification has changed? I have > not seen this.
Not recently but over time, yes. From memory the initial spec was +/-12V. I think it was RS232C that lowered it to +/-9V but don't hold me to that. It was either RS232E or F that lowered it again to +/-5V. Even the 'F' revision is fairly old now, but 'C' got so deeply ingrained it's not unusual to see references to RS232C even today. All specify inputs must tolerate up to +/-25V so there is cross-compatibility in terms of avoiding damage at least, but RS232 is one of those standards that often doesn't get implemented rigidly, e.g. power thieves, discrete implementations that are not strictly compliant, and so on.
> 5V supply. I don't know why you are talking about the MAX232. > I've said "MAX3232CPE" several times.
Acknowledged. MAX232 is the classic part for this application and where I suspect most people will have gained their initial experience. It's the one that has the most issue with the cap sizing. It's also a 5V only part. The MAX2323 is a 3.3V/5V part, at 5V it's interchangable with the MAX232 but the latter has higher output levels. If thresholds are the marginal factor here that's why I suggest it as a possible experiment. -- Andrew Smallshaw andrews@sdf.org
On 2023-01-18, Andrew Smallshaw <andrews@sdf.org> wrote:
> > Acknowledged. MAX232 is the classic part for this application and > where I suspect most people will have gained their initial experience. > It's the one that has the most issue with the cap sizing. It's > also a 5V only part. The MAX2323 is a 3.3V/5V part, at 5V it's > interchangable with the MAX232 but the latter has higher output > levels. If thresholds are the marginal factor here that's why I > suggest it as a possible experiment.
Sorry, to emphasise again, a MAX232_A_ can be substituted. A genuine Maxim MAX232 needs larger caps. -- Andrew Smallshaw andrews@sdf.org
On Wednesday, January 18, 2023 at 9:22:20 AM UTC-4, Andrew Smallshaw wrote:
> On 2023-01-18, Rick C <gnuarm.del...@gmail.com> wrote: > > > > The data sheet I saw has a table of minimum capacitance for three > > Vcc ranges, 3.3V, 5V and 3.3 to 5V approximately. Only 3.3V was > > 0.1 uF on all caps. The others were larger on at least one cap. > > Table 9-1 on page 12. 1 > > I'm reading Maxim's datasheet, see > https://pdf1.alldatasheet.com/datasheet-pdf/view/73152/MAXIM/MAX3232CPE.html > If you're looking at a sheet from another manufacturer that may > change, leading to the same kind of incompatibility as seen with > the MAX232 variants.
Did you look at the data sheet you linked to? What are the minimum capacitor recommendations for the MAX3232?
> > You mean the RS-232 (TIA/EIAI) specification has changed? I have > > not seen this. > Not recently but over time, yes. From memory the initial spec was > +/-12V. I think it was RS232C that lowered it to +/-9V but don't > hold me to that. It was either RS232E or F that lowered it again > to +/-5V. Even the 'F' revision is fairly old now, but 'C' got so > deeply ingrained it's not unusual to see references to RS232C even > today.
I think your memory is faulty. It has always been a minimum of &plusmn;5V at the driver output as long as I can recall. RS232C is from 1969. More recent changes were made to make the standard interworkable with ITU-T/CCITT V.24. The receiver voltage requirement of &plusmn;3V allows for variation in the actual threshold of the receiver. The spec has also always allowed up to &plusmn;25V at the driver, unloaded, and an output resistance of 3 to 7 kohms. The difference between the output and input voltage ranges allows for at least 2V of noise on the line.
> All specify inputs must tolerate up to +/-25V so there is > cross-compatibility in terms of avoiding damage at least, but RS232 > is one of those standards that often doesn't get implemented rigidly, > e.g. power thieves, discrete implementations that are not strictly > compliant, and so on. > > 5V supply. I don't know why you are talking about the MAX232. > > I've said "MAX3232CPE" several times. > Acknowledged. MAX232 is the classic part for this application and > where I suspect most people will have gained their initial experience. > It's the one that has the most issue with the cap sizing. It's > also a 5V only part. The MAX2323 is a 3.3V/5V part, at 5V it's > interchangable with the MAX232 but the latter has higher output > levels. If thresholds are the marginal factor here that's why I > suggest it as a possible experiment.
If the voltage levels are marginal, that would best be discovered by using an oscilloscope to measure them as well as the rise/fall times and the pulse timings. -- Rick C. +-- Get 1,000 miles of free Supercharging +-- Tesla referral code - https://ts.la/richard11209
Rick C <gnuarm.deletethisbit@gmail.com> wrote:
> Anyone know of such a box? The programming might be contracted out, if > you are interested. There's a prototype using an Arduino nano, but some > of them are flaky and it would not hurt to start over from scratch.
I was wondering about boxes that do MIDI, eg MIDI to USB conversion. MIDI is just serial with a strange (31K) baud rate, and those boxes often have multiple MIDI ports (although not as many UARTs as ports). The downside is that MIDI is a current loop so the electrical signalling is wrong. Also wondered if there are RS232-to-X boxes (eg USB) where the main chip is an MCU that can be reprogrammed. But if you want two ports that's harder. Another thought is to find a common 'gender changer' case, a plastic case that would take a DB9 connector at each end, and drop in your own PCB. eg https://uk.misumi-ec.com/vona2/detail/222301880534/# - they have a DB9 to DB9 version: https://uk.misumi-ec.com/pdf/vona/el/PVT1/PVT1_670909M_Datasheet_de_en_1.pdf (this used to be a very common design but seems harder to find these days) Theo
Theo <theom+news@chiark.greenend.org.uk> writes:
> Another thought is to find a common 'gender changer' case, a plastic case > that would take a DB9 connector at each end, and drop in your own PCB. eg
I think the hope is to not build hardware at all, including dropping boards into things, but instead to buy a complete and packaged box that you can plug cables into. I'm surprised that it seems this difficult. Maybe it is an opportunity.
Rick C <gnuarm.deletethisbit@gmail.com> writes:
>> More seriously, the thing that fails the most on Rpi-style boards is >> the SD card. > So potentially lose an entire day of data? LOL
Does that refer to the SD card failing? I didn't realize you were envisioning saving any data on the Pi. If you were using a RPi type of board presumably you'd upload incoming data (maybe over a network) as it arrived. But that is far away from the Arduino approach.
> Yes, and I would still need to worry about it being stepped on by a > dinosaur.
Ok, so it sounds like you are confident that something is really wrong with the Arduino boxes that are failing. Seems reasonable.
On Wednesday, January 18, 2023 at 6:19:16 PM UTC-4, Paul Rubin wrote:
> Rick C <gnuarm.del...@gmail.com> writes: > >> More seriously, the thing that fails the most on Rpi-style boards is > >> the SD card. > > So potentially lose an entire day of data? LOL > Does that refer to the SD card failing? I didn't realize you were > envisioning saving any data on the Pi. If you were using a RPi type of > board presumably you'd upload incoming data (maybe over a network) as it > arrived. But that is far away from the Arduino approach. > > Yes, and I would still need to worry about it being stepped on by a > > dinosaur. > Ok, so it sounds like you are confident that something is really wrong > with the Arduino boxes that are failing. Seems reasonable.
I don't think we are communicating at all. When the glitch happens, no further data is sent to the recipient, until the translator is reset. At this point, you have some idea in your mind as to what has been designed, that seems to not match reality. Sorry if I've misled you. -- Rick C. +-+ Get 1,000 miles of free Supercharging +-+ Tesla referral code - https://ts.la/richard11209
Paul Rubin <no.email@nospam.invalid> wrote:
> Theo <theom+news@chiark.greenend.org.uk> writes: > > Another thought is to find a common 'gender changer' case, a plastic case > > that would take a DB9 connector at each end, and drop in your own PCB. eg > > I think the hope is to not build hardware at all, including dropping > boards into things, but instead to buy a complete and packaged box that > you can plug cables into. I'm surprised that it seems this difficult. > Maybe it is an opportunity.
I know, but I don't think there are better options. I'm not really surprised, because the existence of a piece of hardware depends on a pre-existing market for that hardware. The market for RS232-to-X is well established, for various X. But RS232 to RS232 seems less likely, because it's not clear what people would use it for. The secondary question is, if a thing of the right shape exists, whether it can be reprogrammed. That is more common in an RS232-to-X product where some protocol conversion is involved, but often those are fixed-function chips (eg RS232 to USB). Even if it is reprogrammable, it may be 'unofficially', in which case you're maybe in a lifetime buy situation in case they change the MCU or something that would mean your reprogramming strategy no longer works. In the latter case I'd hunt around Alibaba looking for things of the right shape, but I think you'd first need to establish a use case that you can search for. Without that, it's just a 'box with MCU and two serial ports' and why would somebody want that? The alternative is to go for something highly overspecced that just happens to have two serial ports. A PC is an obvious one: https://www.alibaba.com/product-detail/Factory-Wholesale-Price-Dual-Band-Soft_1600482484162.html? or else there are dual RS232 to Modbus/RS485 converters: https://www.alibaba.com/product-detail/USR-N520-H7-Version-Dual-Port_60593907847.html and maybe you could reprogram those (it claims an ST Cortex M7). But it's pot luck whether the next batch will have a different CPU - the listing says they already revved it from a TI Cortex M4. Theo
On 1/19/2023 3:29 AM, Theo wrote:
> I'm not really surprised, because the existence of a piece of hardware > depends on a pre-existing market for that hardware. The market for > RS232-to-X is well established, for various X. But RS232 to RS232 seems > less likely, because it's not clear what people would use it for. > > The secondary question is, if a thing of the right shape exists, whether it > can be reprogrammed. That is more common in an RS232-to-X product where > some protocol conversion is involved, but often those are fixed-function > chips (eg RS232 to USB). Even if it is reprogrammable, it may be > 'unofficially', in which case you're maybe in a lifetime buy situation in > case they change the MCU or something that would mean your reprogramming > strategy no longer works. > > In the latter case I'd hunt around Alibaba looking for things of the right > shape, but I think you'd first need to establish a use case that you can > search for. Without that, it's just a 'box with MCU and two serial ports' > and why would somebody want that? > > The alternative is to go for something highly overspecced that just happens > to have two serial ports. A PC is an obvious one: > https://www.alibaba.com/product-detail/Factory-Wholesale-Price-Dual-Band-Soft_1600482484162.html? > > or else there are dual RS232 to Modbus/RS485 converters: > https://www.alibaba.com/product-detail/USR-N520-H7-Version-Dual-Port_60593907847.html > and maybe you could reprogram those (it claims an ST Cortex M7). > But it's pot luck whether the next batch will have a different CPU - the > listing says they already revved it from a TI Cortex M4.
Two-port terminal server -- with a single PC to service as many as necessary. No changes to the TS. If the TS is redesigned, the i/f (to the network) will remain the same (excepting, possibly, configuration options if not autobaud). SW resides in the PC -- and can snoop/log/replace/remote the data if ever necessary without upgrading "firmware" in a device. Secure comms to/from the PC so it's AS IF it was hidden in firmware. Costly, though. And, adds the need for a PC (which can likely be shared). But, easy-peasy to implement! As you said, unless there is an existing market, who's going to bother designing it?
On 2023-01-19, Theo <theom+news@chiark.greenend.org.uk> wrote:

> I'm not really surprised, because the existence of a piece of hardware > depends on a pre-existing market for that hardware. The market for > RS232-to-X is well established, for various X. But RS232 to RS232 seems > less likely, because it's not clear what people would use it for.
The company I work for used to sell a small industrial "shoebox" PC with 8 serial ports (232/422/485 software selectable) and a small SSD. It had some slow Intel processor and ran Windows 7 or Linux. It never came close to breaking even, and was carried mainly as a convenience for customers who purchased a particular large and profitable software product (that used serial ports) and they didn't want to configure their own machines. 15 years ago it made sense, but these days, everybody runs the software product on a VM and uses Ethernet->serial interfaces for the serial ports. The supplier stopped making the shoebox machines, and nobody had bought any for a couple years -- so we never bothered to find a replacement. We also used to sell a family of small boxes with ARM CPUs, a bunch of serial ports, and an RTOS-based software development kit. The cost of supporting the SDK was way too high to justify for the meager sales to customers who wanted to write their own firmware, so the SDK was discontinued. [The boxes themselves are still sold running propritary firmware for varioius applications.]