Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I looked at their docs. The "send" and "data" lines are separate here, and of a polarity that should render them useful with a normal RS232 converter. By "normal", I mean one that converts outgoing CMOS 0V to (+3 to +12V) and CMOS +5V to (-3 to -12V), and vice-versa for incoming RS232 lines. This is to say, it inverts in both directions. This needs to be done for all the signals you use. If it doesn't do this, you're not getting your money's worth, and I'd get a different converter or build one using a Maxim MAX232 or somesuch IC.

Once you have a proper converter, the rest is easy. Pin 2 on your PC's DB9 should map from the note scanner's "data" line. It's easiest if the "send" line maps to one of the handshake lines the PC can control directly, but if it maps to the PC's TX line (pin 3) that's okay too. You just need to send the changer a pulsed BREAK for a period long enough to meet their timing requirements. This is done with: $PortObj->pulse_break_on($milliseconds);
What this does is raise the RS232 TX line (pin 3) from -10V, say, to +10V for a period you specify. The converter, by inverting this, will create a 0V pulse on a normally 5V signal line -- just what the scanner wants. Then all you have to do is check your input buffer for the incoming data byte.

With all the means available for doing this right, there just isn't any excuse for kludging the hardware in the manner you describe.


In reply to Re: Kludging the serial port by Dr. Mu
in thread Kludging the serial port by Aighearach

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (9)
    As of 2014-09-02 22:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (32 votes), past polls