in reply to Re^2: Write timeout, in perl Win32::Serialport
in thread Write timeout, in perl Win32::Serialport

AN OFF TOPIC - OH My GOSH!
Some cheapo computers only use +5V for a "psuedo RS-232" signal. RS-232 defines a "true" value as +12V not +5V! Some "cheapo" computers simply do not supply enough voltage on their "quote RS-232 ports" to be interfaced with compliant devices. Be aware of this - I've seen it.

Wrong. +5V is a perfectly valid RS232 voltage. The problem is (a) hardware that uses 0 V instead of -3V..-15V and (b) hardware that expects RS232 lines to deliver significant amounts of energy.

RS232 is specified to use +3V..+15V and -3V..-15V. The range -3V..+3V is undefined. RS232 is not specified to deliver significant current.

Legacy PC hardware is a completely different thing. Most PC "RS232" interfaces accept any voltage around 0V and below as negative (this does not violate the RS232 spec), and the outputs can deliver several mA at +/-12V, simply because the original IBM PC was build this way, and legacy hardware (mostly serial mice and barcode readers) expect this interface. Some "exotic" systems (e.g. early laptops) had a different line driver circuit that delivered only +/-5V and/or less current, this caused compatibility problems with hardware that expected +/-12V and high current, mostly serial mice. Never the less, the interface was implemented according to the RS232 spec, but the peripheral device was not.

See also Re^2: Win32::SerialPort v. New computers.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^3: Write timeout, in perl Win32::Serialport

Replies are listed 'Best First'.
Re^4: Write timeout, in perl Win32::Serialport
by Marshall (Canon) on Feb 20, 2012 at 09:14 UTC
    I looked again at the RS232 spec and you are correct, a 3 volt swing would be enough.
    No, not right - transmitter needs at least +5V swing. A normal TTL output can't get there.
    Update: All hardware interfaces have a defined "margin of error". For me to send a "true" value there is a defined voltage level that must be achieved. There is a much lower voltage level that is required for you to "receive that true value". That is the "margin for transmission error". It is completely possible for me to send something to you that "by the books" is not a "true" level for me to transmit, but that you will accept as such.

    This is meaningless to the software folks here..strike.. If these wimpy guys could use an open collector output to get to the full 5V, then it would be fine. But then of course they could just tie that to the 12V rail also. And this would be able to source significant current at the logic "high" level. A standard TTL gate cannot source any significant current at a logic "high" level.

    This whole RS232 I/F stuff is fraught with "how its done" vs "how its spec'd" stuff. We could probably have a many page discussion about this...

    I'm saying that sometimes Box A and B who claim to be compatible, will not "talk". And that does happen. Last time for me was about 18 months ago - rather than buy a serial card and deal with the software hassles with that - the client elected to just buy a different computer. This "bad boy" RS232 computer just has a different job on the network.

    My point is that sometimes some I/F's won't talk to one another. I probably shouldn't have pointed this out, but I did. Its not the "normal" thing, but it can happen in practice.

    UPDATE: Geez what a messy looking post! Sorry about that. The bottom line is that sometimes 2 devices cannot communicate because their hardware just doesn't meet specs, even though they might yet be able to communicate with some other device. This is rare, but it does happen. That was the point.