Shop OBEX P1 Docs P2 Docs Learn Events
com port in use BS2 — Parallax Forums

com port in use BS2

RoHerman00RoHerman00 Posts: 22
edited 2011-03-16 06:07 in BASIC Stamp
I am trying to connect my BS2 to the computer serial port and when I do not power the BS2 while it is connected and I select "identify" it says loopback and echo are both yes. When I turn on the power it says the BS2 is identified and connected, but after a short period of time when I try to load a simple code (debug "hello world") it says "cannot connect port in use". Any ideas would be helpful as I have already emailed support.parallax but maybe someone has a quick fix.

Thanks

Comments

  • davejamesdavejames Posts: 4,047
    edited 2011-03-11 08:03
    Are you using a USB connection or are you using a serial connection?
    Do you have anything else connected to the computer that uses COM Port 1?
    Is the BS2 on a Board of Education (BOE)?
    And the general question, how is the BS2 being powered?

    DJ
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-11 09:03
    I used the serial connection diagram off of the BS2 help. The serial cable I had was male to male so I cut one end off a soldered the wires to a female connector and made sure all of the pins were wired the correct order.
    There is nothing connected to COM port 1. However I had the same problem but it was because I had two BS2's connected to one port so I removed one of the BS2's. It removed the "port in use" problem but it came back when I tried loading a program.
    No it is not on a BOE. The BS2 was connected to a usb BOE but I had to remove it so it could go into a circuit board I made for a robot.
    The BS2 is being powered from a 12V 1 amp power supply regulated to 5v with a 78L05 positive 100mA regulator.
  • Mike GMike G Posts: 2,702
    edited 2011-03-11 11:25
    It's not real clear what you're doing. Sounds like you have a robot that talks to the PC via a serial connection? If so, make sure you stop the program that is listening on the PC side before you download a program to the STAMP. There could also be a wiring issue.

    If you have the USB BOE, use that as a test. Close all serial port connections and download a program. If that works then you have to start troubleshooting. If you have a problem, please ask but be specific. Reading your initial post, I would have never guessed that you rigged up a serial connection.
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-03-11 11:42
    RoHerman00 wrote: »
    I used the serial connection diagram off of the BS2 help. The serial cable I had was male to male so I cut one end off a soldered the wires to a female connector and made sure all of the pins were wired the correct order.
    ..

    Are you absolutely certain you have the correct pins connected?
    The PC is telling you that you do not !
    The identify passes loopback and identifies (as you said) but the PC must be getting something else back from the Stamp during tha actual download. .I would suggest you look into "BASIC Stamp Programming Protocol v1.1.pdf " , part of Parallax PBASIC_Tokenizer documentation for answers to your problem.
    I sure will
    Cheers Vaclav
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-11 12:50
    Okay first I triple-checked my connection from my DB9 connector to the bs2 and removed the "extension" I made so it is a straight shot from the BS2 to the pc. I have no program running on the BS2 because yesterday I was writing a program before I removed it from the BOE and none of it had any serial communication. I read that pdf file and on the one I had it has an image on page 20 of what pins on the DB9 connector go to which pins on the BS2. I checked mine to make sure and it is good. I tried it on my laptop because for some reason my desktop is shutting off constantly but now on my laptop it says no/no for loopback/echo. I don't know if this is the problem but a while back support.parallax suggested I download an ftdi driver but I checked and it is only to emulate usb connections. My question is since my laptop is quite old (about 7-8 years) could there be a driver or something I should download to get the serial port to work?

    Thanks
  • Mike GMike G Posts: 2,702
    edited 2011-03-11 14:02
    If your laptop has a true serial port, look in the device manager for hardware conflicts.

    Use the BOE/STAMP to verify that the STAMP is functioning properly. If the STAMP/BOE are working, then you have a problem with your rig.
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-11 14:24
    How do I check for hardware conflicts? I've gone through but nothing shows up that is connected to the serial port. And yes it is a physical serial port not an emulated one. Stamp/BOE does work I had it running code yesterday.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-11 16:42
    Do you have the two .01uF caps on DTR and to ground?
    '
    DSR and RTS jumpered.
    '
    female DB9
    BS2

    PIN 1 N.C.
    PIN 2 Rx
    PIN 1(SEROUT)
    PIN 3 Tx
    PIN 2(SIN)
    PIN 4 DTR
    .01uF
    PIN 3(ATN)
    ' ' ' ' .
    ' ' ' ' 0
    ' ' ' ' 1
    ' ' ' ' u
    ' ' ' ' F
    'PIN 5 DSR
    PIN 4(VSS)
    'PIN 6
    ' ' ' |
    PIN 7
    PIN 8 N.C.
    PIN 9 N.C.
    '
    N.C.= no connection
    '
    Take a look at page 28 of the BASIC Stamp Syntax Manual.
    http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/SortField/0/Level/a/ProductID/143/Default.aspx
    '
    If this doesn't work, Will need more info.
  • Mike GMike G Posts: 2,702
    edited 2011-03-11 16:44
    How do I check for hardware conflicts?

    Open the device manager
    and open the Ports (Com & LTP) node and look. If the STAMP/BOE worked yesterday and not today... well you could have a problem. Or do you mean.. there's no reason to check because it worked yesterday?
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-11 16:56
    First to $WMc% yes everything is connected as you posted. I checked again after your post to make sure and everything seems to be in order.
    To Mike G I feel kind of dumb for not mentioning it but I have 1 desktop and 2 laptops. The desktop as I said is the one that detects the BS2 but because it shuts off randomly/frequently (maybe virus) I decided not to use it.
    The laptop I used for the usb/BOE setup works for the usb board and is a 2010 year computer. The other laptop (the very old one) I want to use because that is the only one with a serial port besides the desktop but unlike the desktop it will not detect a connected BS2. That kind of answers the question of if the BS2 is connected correctly because the desktop "sees" it but something is up with the laptop (maybe some update not installed but the laptop is not connected to the internet) that is preventing communication. I apologize for dragging this on but this is the only problem keeping me from getting my robot finally working and functioning.
  • Mike GMike G Posts: 2,702
    edited 2011-03-11 17:09
    So, you know that the laptop has a problem. You are connecting the BOE/STAMP via the serial port to the laptop. You are not using your rig, right? And you are having a problem finding the STAMP. But you know the STAMP in question works because you tested it with your PC. So now you're troubleshooting the laptop's COM port. Is that correct? If that's not correct, and you're going through your circuit (rig) then stop and verify the STAMP/BOE to PC via serial port first.

    Have you looked in the device manager? Is there a little yellow icon on the COM port? What is your COM port number?
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-11 17:32
    Yes thats absolutely correct.
    Well I went through device manager and there seems to be no yellow icon.
    I clicked default and the port number is com1 but it has a pulldown bar and it allows me to select any com number up to 5 even though there is only 1 serial port.
    The port settings are:
    bits per second: 9600
    data bits: 8
    parity: none
    stop bits: 1
    flow control: none

    advanced settings are
    use fifo buffers: checked
    receive buffer: set at 14
    transmit buffer: set at 14

    resources tab
    input/output range: 02FB - 02FF
    interrupt request: 03
  • RoHerman00RoHerman00 Posts: 22
    edited 2011-03-12 06:56
    Okay I ran it on both the old laptop and desktop. The desktop shows the message as I type on the keyboard like it should but the laptop doesn't show anything.
  • Mike GMike G Posts: 2,702
    edited 2011-03-12 07:35
    You could try removing the COM port in device manager and rebooting. Also look in the BIOS for settings.
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-03-14 08:10
    I went camping this weekend and forgot all about Basic Stamp!
    After briefly scanning this thread I see some good and some disturbing development.
    From the first post - which stated that the identification process works but loading the program indicates “COM in use”I gathered that you have most of the cable connection correct. By "cable connection " I mean from PC (BIOS) to Tx and RX pins on BS.

    By the way I would like to know who send this “COM in use “ message – Windows or Parallax editor.

    I do not get why you started troubleshooting BIOS and looking for "yellow" mark in Device Manager. If this "cable connection” was anywhere incorrect you would not get this far.

    Second – apparently you have three computers and they all behave differently, but all do not run your BS program, Am I correct? If so, I would suggest to work on the one who passed all the identification but had the “COM in use” message.

    Did you look at the document I suggested? It has some good info in it.
    For example it tells you that every data send to BS is echoed back to editor. That verifies that BS is getting data and the TX /RX connection is working.( No need to verify port setting.)

    On the other hand – the Echo parameter in editor identification message indicates only that the PC port is set to echo back You said that you do not see data you are typing on you PC - that tells that the Echo parameter in that PC port is not set. But the port us working and there is no need to look for yellow mark.

    I would suggest you try “Free serial port monitor” software
    http://www.serial-port-monitor.com/index.html when you get back to “COM in use” error message.

    Cheers Vaclav
  • Mike GMike G Posts: 2,702
    edited 2011-03-14 09:42
    From what I understand. The BOE/STAMP (no custom circuit) works on all platforms but one, the laptop. I had the OP stop troubleshooting the custom circuit to verify that the COM port on the laptop was functioning properly. It appears there is something wrong with the laptop's serial port as the loop back did not work, assuming pin 2 and 3 were connected together as described in the link provided. I suspect there is a problem with the custom circuit as well.
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-03-14 10:07
    Mike,
    My mistake, I was still thinking about the editor " loopback" (DTR-CTS). Unfortiunate choise of terminology on my part here..
    Still like to know who send the "COM in use". In theory ( my guess from the documentation) after the editor identifies the stamp type it should be looking for echos of data coming back from the processor itself only - during the initial RUN ( load data) process.
    .
    But since we got into Device Manager - it will also identify port in use, not sure about the icon. It may be the same yellow dot.
  • Mike GMike G Posts: 2,702
    edited 2011-03-14 10:18
    I just wanted the OP to check the device manager for conflicts. This post had a lot of variables and I was getting lost. So I tried to get the OP to go down one path and eliminate as many variables as possible.
  • vaclav_salvaclav_sal Posts: 451
    edited 2011-03-14 10:58
    For clarififation
    Both messages are posted by the editor
    Download Progress dialog identifies the port Basic Stamp is attempting to use and puts under ":device type" "can;t open port; port in use". I guess close enough for goverment work.

    Then you get :"Communication errror" dialog telling that "No Basic Stamp found on port COM 1" which is less precise than the first message.

    I need to correct myself - the Device Manager (Windows XP) does not show if the port is in use, in my case only unistalled port is identigied by "red cross" mark over the icon.

    For anybody who wants to konw - I used Windows " Hyper " Terminal to busy out the port where my OEM module is connected. And I get no echo here ! I am still looking where port echo is programmed. I'll ask Mr Google!

    Cheeers Vaclav
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2011-03-16 06:07
    Try this reinstall the Basic Stamp Editor and start over again do not have the Basic Stamp hook up to your computer until you have Basic Stamp Editor reinstalled use the latest Basic Stamp Editor on the Parallax product page

    Tell us what happen when you try this

    If you are using a USB to serial adapter plug the USB to serial adapter first to the computer with out the Baisc Stamp board and let your computer find the USB to serial adapter let the computer find all drivers and have install all drivers then hook up the Baisc Stamp board


    I hope this helps
Sign In or Register to comment.