RS232 question
Archiver
Posts: 46,084
Can the programming pins on the bs2 do double duty and be used both
for rs232 communication with a custom program on a PC and programming
the bs2? Can I put a max232 in between the PC and SIN/SOUT and make
it 'real' rs232.
Or, is it better to just stick two db9's on the board and move the
serial cable back and forth, back and forth, etc?
What identifier do I use with the serin and serout commands? Is it
pin 16 for both tx and rx?
Thanks for the help!
Jim Margarit
for rs232 communication with a custom program on a PC and programming
the bs2? Can I put a max232 in between the PC and SIN/SOUT and make
it 'real' rs232.
Or, is it better to just stick two db9's on the board and move the
serial cable back and forth, back and forth, etc?
What identifier do I use with the serin and serout commands? Is it
pin 16 for both tx and rx?
Thanks for the help!
Jim Margarit
Comments
margarit@zianet.com writes:
for rs232 communication with a custom program on a PC and programming
the bs2? Can I put a max232 in between the PC and SIN/SOUT and make
it 'real' rs232.
Or, is it better to just stick two db9's on the board and move the
serial cable back and forth, back and forth, etc?
What identifier do I use with the serin and serout commands? Is it
pin 16 for both tx and rx?
Yes, you can use the programming connection for general serial communications
with a PC. ·The one thing you have to keep in mind is that anything
transmitted to the Stamp is echoed back to the PC (due to the built-in
inverter circuit). ·Your PC program will have to filter the echoed data.
And no, you don't need a MAX232 for "real" serial. ·And yes, pin 16 is what
you'll use in your SERIN and SEROUT statements, even though there are
separate RX and TX pins. ·Make sure the ATN connection has a cap (0.1 uF)
inline (this pin is connected to DTR). ·This will let your serial port work
with other software and let the Stamp editor reprogram your project if
needed. ·I've done this several times with success.
-- Jon Williams
-- Dallas, TX[/font]
>with a PC.
Jon is correct. Also, if you use a Max232 or similar at Sin and Sout for
true RS-232, because a Max232 inverts the signals, you have to invert twice
to get the expected polarity for Sin and Sout during programming (because
there is no baudmode parameter to do it in code during programming). You
can use the spare driver and receiver in a Max232 for this:
Connect Sout to an RS-232 input on the Max.
Connect that driver's TTL output to a TTL input on the Max.
That driver's output is RS-232 out with the same polarity as Sout.
Connect Sin to an RS-232 output on the Max.
Connect that driver's TTL input to a TTL output on the Max.
That driver's input is RS-232 in with the same polarity as Sin.
For a Max233 (the one with no capacitors), use these connections:
Sout 19 on Max233
20 on Max233 2 on Max233
5 on Max233 cable to RXD at PC
Sin 18 on Max233
1 on Max233 3 on Max233
4 on Max233 cable to TXD at PC
Jan Axelson
http://www.lvr.com
jan@l...