Shop OBEX P1 Docs P2 Docs Learn Events
VB6 / MSCOMM control - serial comm echo — Parallax Forums

VB6 / MSCOMM control - serial comm echo

ArchiverArchiver Posts: 46,084
edited 2004-04-19 19:35 in General Discussion
I have a Visual Basic 6 program which connects with a BS2 stamp
using the serial port on the Board of Education.
The VB6 program uses the MSCOMM control and the OnComm event. I know
that pins 6 and 7 on the BOE are connected to handle automatic
serial port selection in the stamp editor.

Why does data send to the BS2 from the VB6 program get returned to
the VB6 program OnComm/CommEvent (comEvReceive)?
This occurs even if there is no power to the BS2 (unless the serial
cable is disconnected). I thought it might be the two capacitors on
the ATN (serial pin 4) line, but that doesn't seem to be the case.

Here are the MSCOMM properties
MSComm1.CommPort = 1
MSComm1.DTREnable = False
MSComm1.EOFEnable = False
MSComm1.Handshaking = comNone
MSComm1.InBufferSize = 1024
'Setting the InputLen property to 0 causes the
'Communications control to read the entire contents
'of the receive buffer when the Input property is used
MSComm1.InputLen = 1
MSComm1.InputMode = comInputModeText
MSComm1.NullDiscard = False
MSComm1.ParityReplace = "?"
MSComm1.RThreshold = 1
MSComm1.RTSEnable = False
MSComm1.SThreshold = 1
MSComm1.Settings = "9600,n,8,1"

Thanks for any insight.
- Ron

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-15 23:44
    The reason for this is that the level-shifter on the BS2 module
    "borrows" power from the RS-232 connection, so everything gets echoed
    back. This is easy to filter, or it can be used (as the compiler does)
    to make sure that a byte sent to the BASIC Stamp actually got there (you
    know that since it got echoed).

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Ron Czapala [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=aUhRP1JhQjKGbZ8NyQ5jY2aREZG5GEq5zf4D6I8ztqH5AlsEsSnKtnxnOuyGqWWOUblCeW6LDWTx]rczapala@y...[/url
    Sent: Thursday, April 15, 2004 3:37 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo


    I have a Visual Basic 6 program which connects with a BS2 stamp
    using the serial port on the Board of Education.
    The VB6 program uses the MSCOMM control and the OnComm event. I know
    that pins 6 and 7 on the BOE are connected to handle automatic
    serial port selection in the stamp editor.

    Why does data send to the BS2 from the VB6 program get returned to
    the VB6 program OnComm/CommEvent (comEvReceive)?
    This occurs even if there is no power to the BS2 (unless the serial
    cable is disconnected). I thought it might be the two capacitors on
    the ATN (serial pin 4) line, but that doesn't seem to be the case.

    Here are the MSCOMM properties
    MSComm1.CommPort = 1
    MSComm1.DTREnable = False
    MSComm1.EOFEnable = False
    MSComm1.Handshaking = comNone
    MSComm1.InBufferSize = 1024
    'Setting the InputLen property to 0 causes the
    'Communications control to read the entire contents
    'of the receive buffer when the Input property is used
    MSComm1.InputLen = 1
    MSComm1.InputMode = comInputModeText
    MSComm1.NullDiscard = False
    MSComm1.ParityReplace = "?"
    MSComm1.RThreshold = 1
    MSComm1.RTSEnable = False
    MSComm1.SThreshold = 1
    MSComm1.Settings = "9600,n,8,1"

    Thanks for any insight.
    - Ron
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-16 00:56
    Thanks Jon!
    I wondered whether the BS2 was drawing power from the PC serial
    port. That explains why it worked with no power applied. I'm not
    sure what the "level shifter" is but I assume it is in the PIC
    controller and that there is no way to disable the echo in PBasic.
    Thanks for your help!
    - Ron

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > The reason for this is that the level-shifter on the BS2 module
    > "borrows" power from the RS-232 connection, so everything gets
    echoed
    > back. This is easy to filter, or it can be used (as the compiler
    does)
    > to make sure that a byte sent to the BASIC Stamp actually got
    there (you
    > know that since it got echoed).
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > Sent: Thursday, April 15, 2004 3:37 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    >
    >
    > I have a Visual Basic 6 program which connects with a BS2 stamp
    > using the serial port on the Board of Education.
    > The VB6 program uses the MSCOMM control and the OnComm event. I
    know
    > that pins 6 and 7 on the BOE are connected to handle automatic
    > serial port selection in the stamp editor.
    >
    > Why does data send to the BS2 from the VB6 program get returned to
    > the VB6 program OnComm/CommEvent (comEvReceive)?
    > This occurs even if there is no power to the BS2 (unless the
    serial
    > cable is disconnected). I thought it might be the two capacitors
    on
    > the ATN (serial pin 4) line, but that doesn't seem to be the case.
    >
    > Here are the MSCOMM properties
    > MSComm1.CommPort = 1
    > MSComm1.DTREnable = False
    > MSComm1.EOFEnable = False
    > MSComm1.Handshaking = comNone
    > MSComm1.InBufferSize = 1024
    > 'Setting the InputLen property to 0 causes the
    > 'Communications control to read the entire contents
    > 'of the receive buffer when the Input property is used
    > MSComm1.InputLen = 1
    > MSComm1.InputMode = comInputModeText
    > MSComm1.NullDiscard = False
    > MSComm1.ParityReplace = "?"
    > MSComm1.RThreshold = 1
    > MSComm1.RTSEnable = False
    > MSComm1.SThreshold = 1
    > MSComm1.Settings = "9600,n,8,1"
    >
    > Thanks for any insight.
    > - Ron
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-16 01:26
    No, a level shifter takes care of the interface between RS-232 levels
    and TTL levels of the core micro.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Ron Czapala [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5MdK2SBeHSQrRslfPfrtaCy3-cZWqd-ThVErm9wDcCoamb--b3lDUoIsnrO2RlskiwI0yKPcb-h80c2k]rczapala@y...[/url
    Sent: Thursday, April 15, 2004 6:56 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: VB6 / MSCOMM control - serial comm echo


    Thanks Jon!
    I wondered whether the BS2 was drawing power from the PC serial
    port. That explains why it worked with no power applied. I'm not
    sure what the "level shifter" is but I assume it is in the PIC
    controller and that there is no way to disable the echo in PBasic.
    Thanks for your help!
    - Ron

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > The reason for this is that the level-shifter on the BS2 module
    > "borrows" power from the RS-232 connection, so everything gets
    echoed
    > back. This is easy to filter, or it can be used (as the compiler
    does)
    > to make sure that a byte sent to the BASIC Stamp actually got
    there (you
    > know that since it got echoed).
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > Sent: Thursday, April 15, 2004 3:37 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    >
    >
    > I have a Visual Basic 6 program which connects with a BS2 stamp
    > using the serial port on the Board of Education.
    > The VB6 program uses the MSCOMM control and the OnComm event. I
    know
    > that pins 6 and 7 on the BOE are connected to handle automatic
    > serial port selection in the stamp editor.
    >
    > Why does data send to the BS2 from the VB6 program get returned to
    > the VB6 program OnComm/CommEvent (comEvReceive)?
    > This occurs even if there is no power to the BS2 (unless the
    serial
    > cable is disconnected). I thought it might be the two capacitors
    on
    > the ATN (serial pin 4) line, but that doesn't seem to be the case.
    >
    > Here are the MSCOMM properties
    > MSComm1.CommPort = 1
    > MSComm1.DTREnable = False
    > MSComm1.EOFEnable = False
    > MSComm1.Handshaking = comNone
    > MSComm1.InBufferSize = 1024
    > 'Setting the InputLen property to 0 causes the
    > 'Communications control to read the entire contents
    > 'of the receive buffer when the Input property is used
    > MSComm1.InputLen = 1
    > MSComm1.InputMode = comInputModeText
    > MSComm1.NullDiscard = False
    > MSComm1.ParityReplace = "?"
    > MSComm1.RThreshold = 1
    > MSComm1.RTSEnable = False
    > MSComm1.SThreshold = 1
    > MSComm1.Settings = "9600,n,8,1"
    >
    > Thanks for any insight.
    > - Ron



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-16 01:43
    Oh - you're talking about the transistor that inverts the signal and
    handles the 12v to 5v difference.

    Thanks again.
    - Ron

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > No, a level shifter takes care of the interface between RS-232
    levels
    > and TTL levels of the core micro.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > Sent: Thursday, April 15, 2004 6:56 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: VB6 / MSCOMM control - serial comm echo
    >
    >
    > Thanks Jon!
    > I wondered whether the BS2 was drawing power from the PC serial
    > port. That explains why it worked with no power applied. I'm not
    > sure what the "level shifter" is but I assume it is in the PIC
    > controller and that there is no way to disable the echo in PBasic.
    > Thanks for your help!
    > - Ron
    >
    > --- In basicstamps@yahoogroups.com, "Jon Williams"
    <jwilliams@p...>
    > wrote:
    > > The reason for this is that the level-shifter on the BS2 module
    > > "borrows" power from the RS-232 connection, so everything gets
    > echoed
    > > back. This is easy to filter, or it can be used (as the compiler
    > does)
    > > to make sure that a byte sent to the BASIC Stamp actually got
    > there (you
    > > know that since it got echoed).
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > Sent: Thursday, April 15, 2004 3:37 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > >
    > >
    > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > using the serial port on the Board of Education.
    > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > know
    > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > serial port selection in the stamp editor.
    > >
    > > Why does data send to the BS2 from the VB6 program get returned
    to
    > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > This occurs even if there is no power to the BS2 (unless the
    > serial
    > > cable is disconnected). I thought it might be the two capacitors
    > on
    > > the ATN (serial pin 4) line, but that doesn't seem to be the
    case.
    > >
    > > Here are the MSCOMM properties
    > > MSComm1.CommPort = 1
    > > MSComm1.DTREnable = False
    > > MSComm1.EOFEnable = False
    > > MSComm1.Handshaking = comNone
    > > MSComm1.InBufferSize = 1024
    > > 'Setting the InputLen property to 0 causes the
    > > 'Communications control to read the entire contents
    > > 'of the receive buffer when the Input property is used
    > > MSComm1.InputLen = 1
    > > MSComm1.InputMode = comInputModeText
    > > MSComm1.NullDiscard = False
    > > MSComm1.ParityReplace = "?"
    > > MSComm1.RThreshold = 1
    > > MSComm1.RTSEnable = False
    > > MSComm1.SThreshold = 1
    > > MSComm1.Settings = "9600,n,8,1"
    > >
    > > Thanks for any insight.
    > > - Ron
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    Subject
    > and Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p...
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 17:49
    Does anyone know if its possible to disable the echo? I suppose it
    should be easy to filter out the echo, but it would be even easier
    if it could be disabled...

    thanks,
    Alex

    --- In basicstamps@yahoogroups.com, "Ron Czapala" <rczapala@y...>
    wrote:
    > Thanks Jon!
    > I wondered whether the BS2 was drawing power from the PC serial
    > port. That explains why it worked with no power applied. I'm not
    > sure what the "level shifter" is but I assume it is in the PIC
    > controller and that there is no way to disable the echo in PBasic.
    > Thanks for your help!
    > - Ron
    >
    > --- In basicstamps@yahoogroups.com, "Jon Williams"
    <jwilliams@p...>
    > wrote:
    > > The reason for this is that the level-shifter on the BS2 module
    > > "borrows" power from the RS-232 connection, so everything gets
    > echoed
    > > back. This is easy to filter, or it can be used (as the
    compiler
    > does)
    > > to make sure that a byte sent to the BASIC Stamp actually got
    > there (you
    > > know that since it got echoed).
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > Sent: Thursday, April 15, 2004 3:37 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > >
    > >
    > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > using the serial port on the Board of Education.
    > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > know
    > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > serial port selection in the stamp editor.
    > >
    > > Why does data send to the BS2 from the VB6 program get returned
    to
    > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > This occurs even if there is no power to the BS2 (unless the
    > serial
    > > cable is disconnected). I thought it might be the two capacitors
    > on
    > > the ATN (serial pin 4) line, but that doesn't seem to be the
    case.
    > >
    > > Here are the MSCOMM properties
    > > MSComm1.CommPort = 1
    > > MSComm1.DTREnable = False
    > > MSComm1.EOFEnable = False
    > > MSComm1.Handshaking = comNone
    > > MSComm1.InBufferSize = 1024
    > > 'Setting the InputLen property to 0 causes the
    > > 'Communications control to read the entire contents
    > > 'of the receive buffer when the Input property is used
    > > MSComm1.InputLen = 1
    > > MSComm1.InputMode = comInputModeText
    > > MSComm1.NullDiscard = False
    > > MSComm1.ParityReplace = "?"
    > > MSComm1.RThreshold = 1
    > > MSComm1.RTSEnable = False
    > > MSComm1.SThreshold = 1
    > > MSComm1.Settings = "9600,n,8,1"
    > >
    > > Thanks for any insight.
    > > - Ron
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 18:41
    Hello,
    The only way to disable this would be by removing the 4.7k
    resistor across Sin (pin 2) and Sout (pin 1). On the Stamp-IC it is not
    easy but the OEM stamp it's not to bad. Also it will need to be
    reinstalled when wanting to reprogram the stamp.

    Stephen Swanson
    Technical Support Manager
    Parallax, Inc.
    599 Menlo Drive, #100
    Rocklin, CA 95765

    Phone (916) 624-8333
    E-mail ..... sswanson@p...
    Main site...... www.parallax.com
    Educational site.... www.parallax.com/sic
    Javelin Stamp... www.parallax.com/javelin


    Original Message
    From: lexaay [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=1TkusyRJ5pl_j34qzSiFf41p7s4xcfdwVtXbqFG3qVp-lIlEODWoH9M16C7AwZkmndh7xshzCqhY93W3]lexaay@y...[/url
    Sent: Monday, April 19, 2004 9:50 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: VB6 / MSCOMM control - serial comm echo

    Does anyone know if its possible to disable the echo? I suppose it
    should be easy to filter out the echo, but it would be even easier
    if it could be disabled...

    thanks,
    Alex

    --- In basicstamps@yahoogroups.com, "Ron Czapala" <rczapala@y...>
    wrote:
    > Thanks Jon!
    > I wondered whether the BS2 was drawing power from the PC serial
    > port. That explains why it worked with no power applied. I'm not
    > sure what the "level shifter" is but I assume it is in the PIC
    > controller and that there is no way to disable the echo in PBasic.
    > Thanks for your help!
    > - Ron
    >
    > --- In basicstamps@yahoogroups.com, "Jon Williams"
    <jwilliams@p...>
    > wrote:
    > > The reason for this is that the level-shifter on the BS2 module
    > > "borrows" power from the RS-232 connection, so everything gets
    > echoed
    > > back. This is easy to filter, or it can be used (as the
    compiler
    > does)
    > > to make sure that a byte sent to the BASIC Stamp actually got
    > there (you
    > > know that since it got echoed).
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > Sent: Thursday, April 15, 2004 3:37 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > >
    > >
    > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > using the serial port on the Board of Education.
    > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > know
    > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > serial port selection in the stamp editor.
    > >
    > > Why does data send to the BS2 from the VB6 program get returned
    to
    > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > This occurs even if there is no power to the BS2 (unless the
    > serial
    > > cable is disconnected). I thought it might be the two capacitors
    > on
    > > the ATN (serial pin 4) line, but that doesn't seem to be the
    case.
    > >
    > > Here are the MSCOMM properties
    > > MSComm1.CommPort = 1
    > > MSComm1.DTREnable = False
    > > MSComm1.EOFEnable = False
    > > MSComm1.Handshaking = comNone
    > > MSComm1.InBufferSize = 1024
    > > 'Setting the InputLen property to 0 causes the
    > > 'Communications control to read the entire contents
    > > 'of the receive buffer when the Input property is used
    > > MSComm1.InputLen = 1
    > > MSComm1.InputMode = comInputModeText
    > > MSComm1.NullDiscard = False
    > > MSComm1.ParityReplace = "?"
    > > MSComm1.RThreshold = 1
    > > MSComm1.RTSEnable = False
    > > MSComm1.SThreshold = 1
    > > MSComm1.Settings = "9600,n,8,1"
    > >
    > > Thanks for any insight.
    > > - Ron




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 18:44
    Nope, the 'echo' is caused by the RS232 circuitry
    on the BS2 using the 'TX' line voltage for its
    transistor-based 232. The BS2 'RX' line (which
    actually sends data from the BS2) uses the PC's
    'TX' line for +12 volts. Thus, when the PC
    sends data, and drops its +12 volt TX, this
    immediately appears on the PC's 'RX' line.

    It's in hardware. It can't be defeated. It's
    a clever trick, which allows the BS2 to talk
    'true' +-12 volt RS-232, without actually
    having a 12 volt supply on-chip.

    It has the nice side-effect that the PC can
    tell every byte has made it to the chip,
    since every byte it sends is echo'ed back.
    And it is usually not too hard to have
    the PC 'toss' the echo to its own messages.


    --- In basicstamps@yahoogroups.com, "lexaay" <lexaay@y...> wrote:
    > Does anyone know if its possible to disable the echo? I suppose it
    > should be easy to filter out the echo, but it would be even easier
    > if it could be disabled...
    >
    > thanks,
    > Alex
    >
    > --- In basicstamps@yahoogroups.com, "Ron Czapala" <rczapala@y...>
    > wrote:
    > > Thanks Jon!
    > > I wondered whether the BS2 was drawing power from the PC serial
    > > port. That explains why it worked with no power applied. I'm not
    > > sure what the "level shifter" is but I assume it is in the PIC
    > > controller and that there is no way to disable the echo in
    PBasic.
    > > Thanks for your help!
    > > - Ron
    > >
    > > --- In basicstamps@yahoogroups.com, "Jon Williams"
    > <jwilliams@p...>
    > > wrote:
    > > > The reason for this is that the level-shifter on the BS2 module
    > > > "borrows" power from the RS-232 connection, so everything gets
    > > echoed
    > > > back. This is easy to filter, or it can be used (as the
    > compiler
    > > does)
    > > > to make sure that a byte sent to the BASIC Stamp actually got
    > > there (you
    > > > know that since it got echoed).
    > > >
    > > > -- Jon Williams
    > > > -- Applications Engineer, Parallax
    > > > -- Dallas Office
    > > >
    > > >
    > > >
    Original Message
    > > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > > Sent: Thursday, April 15, 2004 3:37 PM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > > >
    > > >
    > > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > > using the serial port on the Board of Education.
    > > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > > know
    > > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > > serial port selection in the stamp editor.
    > > >
    > > > Why does data send to the BS2 from the VB6 program get returned
    > to
    > > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > > This occurs even if there is no power to the BS2 (unless the
    > > serial
    > > > cable is disconnected). I thought it might be the two
    capacitors
    > > on
    > > > the ATN (serial pin 4) line, but that doesn't seem to be the
    > case.
    > > >
    > > > Here are the MSCOMM properties
    > > > MSComm1.CommPort = 1
    > > > MSComm1.DTREnable = False
    > > > MSComm1.EOFEnable = False
    > > > MSComm1.Handshaking = comNone
    > > > MSComm1.InBufferSize = 1024
    > > > 'Setting the InputLen property to 0 causes the
    > > > 'Communications control to read the entire contents
    > > > 'of the receive buffer when the Input property is used
    > > > MSComm1.InputLen = 1
    > > > MSComm1.InputMode = comInputModeText
    > > > MSComm1.NullDiscard = False
    > > > MSComm1.ParityReplace = "?"
    > > > MSComm1.RThreshold = 1
    > > > MSComm1.RTSEnable = False
    > > > MSComm1.SThreshold = 1
    > > > MSComm1.Settings = "9600,n,8,1"
    > > >
    > > > Thanks for any insight.
    > > > - Ron
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 19:23
    Remember that you do not have to use the port you use for programming and
    debug for serial input and output on the stamp. You can use any of the
    ports for serial I/O and they will not 'echo'. For example,
    http://www.geocities.com/jimforkin2003/
    jim

    Original Message
    From: Allan Lane [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ZHZDCinwV7UgDVdNvUgmLzYbfJz8pfSCnkGrusCFXMR1p3_Dt_BZ4hv7E4bdR7XaAZbr9F-xaMu9rzL3WzMsCyesZhA]allan.lane@h...[/url
    Sent: Monday, April 19, 2004 1:45 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: VB6 / MSCOMM control - serial comm echo


    Nope, the 'echo' is caused by the RS232 circuitry
    on the BS2 using the 'TX' line voltage for its
    transistor-based 232. The BS2 'RX' line (which
    actually sends data from the BS2) uses the PC's
    'TX' line for +12 volts. Thus, when the PC
    sends data, and drops its +12 volt TX, this
    immediately appears on the PC's 'RX' line.

    It's in hardware. It can't be defeated. It's
    a clever trick, which allows the BS2 to talk
    'true' +-12 volt RS-232, without actually
    having a 12 volt supply on-chip.

    It has the nice side-effect that the PC can
    tell every byte has made it to the chip,
    since every byte it sends is echo'ed back.
    And it is usually not too hard to have
    the PC 'toss' the echo to its own messages.


    --- In basicstamps@yahoogroups.com, "lexaay" <lexaay@y...> wrote:
    > Does anyone know if its possible to disable the echo? I suppose it
    > should be easy to filter out the echo, but it would be even easier
    > if it could be disabled...
    >
    > thanks,
    > Alex
    >
    > --- In basicstamps@yahoogroups.com, "Ron Czapala" <rczapala@y...>
    > wrote:
    > > Thanks Jon!
    > > I wondered whether the BS2 was drawing power from the PC serial
    > > port. That explains why it worked with no power applied. I'm not
    > > sure what the "level shifter" is but I assume it is in the PIC
    > > controller and that there is no way to disable the echo in
    PBasic.
    > > Thanks for your help!
    > > - Ron
    > >
    > > --- In basicstamps@yahoogroups.com, "Jon Williams"
    > <jwilliams@p...>
    > > wrote:
    > > > The reason for this is that the level-shifter on the BS2 module
    > > > "borrows" power from the RS-232 connection, so everything gets
    > > echoed
    > > > back. This is easy to filter, or it can be used (as the
    > compiler
    > > does)
    > > > to make sure that a byte sent to the BASIC Stamp actually got
    > > there (you
    > > > know that since it got echoed).
    > > >
    > > > -- Jon Williams
    > > > -- Applications Engineer, Parallax
    > > > -- Dallas Office
    > > >
    > > >
    > > >
    Original Message
    > > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > > Sent: Thursday, April 15, 2004 3:37 PM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > > >
    > > >
    > > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > > using the serial port on the Board of Education.
    > > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > > know
    > > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > > serial port selection in the stamp editor.
    > > >
    > > > Why does data send to the BS2 from the VB6 program get returned
    > to
    > > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > > This occurs even if there is no power to the BS2 (unless the
    > > serial
    > > > cable is disconnected). I thought it might be the two
    capacitors
    > > on
    > > > the ATN (serial pin 4) line, but that doesn't seem to be the
    > case.
    > > >
    > > > Here are the MSCOMM properties
    > > > MSComm1.CommPort = 1
    > > > MSComm1.DTREnable = False
    > > > MSComm1.EOFEnable = False
    > > > MSComm1.Handshaking = comNone
    > > > MSComm1.InBufferSize = 1024
    > > > 'Setting the InputLen property to 0 causes the
    > > > 'Communications control to read the entire contents
    > > > 'of the receive buffer when the Input property is used
    > > > MSComm1.InputLen = 1
    > > > MSComm1.InputMode = comInputModeText
    > > > MSComm1.NullDiscard = False
    > > > MSComm1.ParityReplace = "?"
    > > > MSComm1.RThreshold = 1
    > > > MSComm1.RTSEnable = False
    > > > MSComm1.SThreshold = 1
    > > > MSComm1.Settings = "9600,n,8,1"
    > > >
    > > > Thanks for any insight.
    > > > - Ron




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.

    Yahoo! Groups Links
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 19:27
    No, it's a hardware related thing. If it's really bothersome you could
    switch to SERIN/SEROUT on standard IO pins, but then you may need to
    level-shifter.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: lexaay [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=6SuSGOX9tO_vS1vSqJOOu7O0ZwvrWZms1BxXs71tBTr98nMwWbuLAZRupXLx_H7QicVxFRjnv4egqQ]lexaay@y...[/url
    Sent: Monday, April 19, 2004 11:50 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: VB6 / MSCOMM control - serial comm echo


    Does anyone know if its possible to disable the echo? I suppose it
    should be easy to filter out the echo, but it would be even easier
    if it could be disabled...

    thanks,
    Alex

    --- In basicstamps@yahoogroups.com, "Ron Czapala" <rczapala@y...>
    wrote:
    > Thanks Jon!
    > I wondered whether the BS2 was drawing power from the PC serial
    > port. That explains why it worked with no power applied. I'm not
    > sure what the "level shifter" is but I assume it is in the PIC
    > controller and that there is no way to disable the echo in PBasic.
    > Thanks for your help!
    > - Ron
    >
    > --- In basicstamps@yahoogroups.com, "Jon Williams"
    <jwilliams@p...>
    > wrote:
    > > The reason for this is that the level-shifter on the BS2 module
    > > "borrows" power from the RS-232 connection, so everything gets
    > echoed
    > > back. This is easy to filter, or it can be used (as the
    compiler
    > does)
    > > to make sure that a byte sent to the BASIC Stamp actually got
    > there (you
    > > know that since it got echoed).
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Ron Czapala [noparse][[/noparse]mailto:rczapala@y...]
    > > Sent: Thursday, April 15, 2004 3:37 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] VB6 / MSCOMM control - serial comm echo
    > >
    > >
    > > I have a Visual Basic 6 program which connects with a BS2 stamp
    > > using the serial port on the Board of Education.
    > > The VB6 program uses the MSCOMM control and the OnComm event. I
    > know
    > > that pins 6 and 7 on the BOE are connected to handle automatic
    > > serial port selection in the stamp editor.
    > >
    > > Why does data send to the BS2 from the VB6 program get returned
    to
    > > the VB6 program OnComm/CommEvent (comEvReceive)?
    > > This occurs even if there is no power to the BS2 (unless the
    > serial
    > > cable is disconnected). I thought it might be the two capacitors
    > on
    > > the ATN (serial pin 4) line, but that doesn't seem to be the
    case.
    > >
    > > Here are the MSCOMM properties
    > > MSComm1.CommPort = 1
    > > MSComm1.DTREnable = False
    > > MSComm1.EOFEnable = False
    > > MSComm1.Handshaking = comNone
    > > MSComm1.InBufferSize = 1024
    > > 'Setting the InputLen property to 0 causes the
    > > 'Communications control to read the entire contents
    > > 'of the receive buffer when the Input property is used
    > > MSComm1.InputLen = 1
    > > MSComm1.InputMode = comInputModeText
    > > MSComm1.NullDiscard = False
    > > MSComm1.ParityReplace = "?"
    > > MSComm1.RThreshold = 1
    > > MSComm1.RTSEnable = False
    > > MSComm1.SThreshold = 1
    > > MSComm1.Settings = "9600,n,8,1"
    > >
    > > Thanks for any insight.
    > > - Ron




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-19 19:35
    Thanks Stephen,
    It's not really a problem. As Jon said it is easy to ignore the
    echo data. I was just trying to understand why it was happening.
    - Ron

    --- In basicstamps@yahoogroups.com, "Stephen Swanson"
    <sswanson@p...> wrote:
    > Hello,
    > The only way to disable this would be by removing the 4.7k
    > resistor across Sin (pin 2) and Sout (pin 1). On the Stamp-IC it
    is not
    > easy but the OEM stamp it's not to bad. Also it will need to be
    > reinstalled when wanting to reprogram the stamp.
    >
    > Stephen Swanson
    > Technical Support Manager
    > Parallax, Inc.
    > 599 Menlo Drive, #100
    > Rocklin, CA 95765
    >
    > Phone (916) 624-8333
    > E-mail ..... sswanson@p...
    > Main site...... www.parallax.com
    > Educational site.... www.parallax.com/sic
    > Javelin Stamp... www.parallax.com/javelin
    >
    >
Sign In or Register to comment.