ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2

Author
vaughanatworld
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2006/02/15 19:19:13
  • Location: Boston, MA
  • Status: offline
2006/02/15 19:29:41 (permalink)
0

ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2

I am trying to connect to an ICD2 and am having problems with the XP COM2 port even before getting to the ICD2.
 
I can connect to an ANSI terminal with hyperterminal and I can communicate with pipes via \temp\com2. Therefore I am confident I have a good hardware (USB to RS232 adapter) and a good device driver ( standard windows XP).
 
I can not do any connections with MPLab (7.31) and no characters are ever sent out com2. The error messages from MPLab are:
 
Connecting to MPLAB ICD 2
ICDWarn0027: The selected baud rate is not supported by your system.  Chances are it will work anyway, but if persistent communications occur, consider switching to a lower baud rate.
ICD0019: Communications:  Failed to open port: (Windows::GetLastError() = 0x2, 'The system cannot find the file specified.
')
ICD0021: Unable to connect with MPLAB ICD 2
MPLAB ICD 2 Ready

I am sure I am not the first person to see this problem.
Can someone point me at a solution?
 
Thanks
 
Brian
 
#1

17 Replies Related Threads

    kalpak
    Super Member
    • Total Posts : 3265
    • Reward points : 0
    • Joined: 2004/03/12 23:01:40
    • Location: India
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/02/15 19:45:47 (permalink)
    0
    You can change the baud rate in the debugger setup. BTW, how are you powering the ICD2?
    #2
    vaughanatworld
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2006/02/15 19:19:13
    • Location: Boston, MA
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/02/16 07:25:17 (permalink)
    0
    The problem occurs inside MPLab. The program can not even open the I/O port. This is occurs so early in the process that the baud rate doesn't even matter. The ICD2 doesn't even have to be powered or even connected for the problem to occur.
     
    I suspect it has something to do with MPLab thinking the I/O port is already open by some other program. I just don't know how to clear it or reset it. Rebooting the machine does not help.
     
    It would be interesting to know what serial port API library Microchip is using in MPLab. There are two that I know of that Microsoft provides plus others in the market place. I am just trying to find a thread to pull on so I can get this thing going.
     
    I will have to conduct experiments with a desktop machine with a PCI card based serial port; try Windows XP, 2K, NT, 98, 95 etc until I find a working combination. Too bad.
    #3
    Spedley
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2005/09/08 07:07:23
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/05/06 12:16:34 (permalink)
    0
    I have the same problem, did you find a solution?
    #4
    Guest
    Super Member
    • Total Posts : 80499
    • Reward points : 0
    • Joined: 2003/01/01 00:00:00
    • Location: 0
    • Status: online
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/06/22 11:54:44 (permalink)
    0
    I just had the same exact problem.  I am using a RadioShack USB-to-Serial converter and it worked fine for Terminal, bootloading (tinybldr), and even with the picStart Plus.  The default com port setting for the adapter is anywhere from Com6 to Com8 depending on which USB port I plugged it into.

    In the advanced tab where you disable the FIFO buffers, I had an option to change the COM port.  Changing it to COM2 solved my problem and my ICD2 works great.  Maybe the ICD2 Serial driver is unable to talk to com ports above 4?

    Let me know if this works for you . . .

    EDIT:  I just reread your message and it seems you are already using com2, so this solution will not work for you, but it may work for other people using USB-to-Serial adapters.
    post edited by JDieringer - 2006/06/22 11:56:37
    #5
    Whacko
    Super Member
    • Total Posts : 277
    • Reward points : 0
    • Joined: 2003/11/25 14:19:32
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/06/25 07:08:46 (permalink)
    0
    Is there a specific reason why you are not connecting via the usb? Is it an original ICD2 or a clone you are using?
     
    Whacko
    #6
    Guest
    Super Member
    • Total Posts : 80499
    • Reward points : 0
    • Joined: 2003/01/01 00:00:00
    • Location: 0
    • Status: online
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/10 06:30:02 (permalink)
    0
    Thank you for JDieringer.
    I have done this modification as you depicted. Now,My icd2-rs232 working very well with usb2rs232 device.I can use this in my Laptop that only have usb peripheral interface.
    good job.
    #7
    Guest
    Super Member
    • Total Posts : 80499
    • Reward points : 0
    • Joined: 2003/01/01 00:00:00
    • Location: 0
    • Status: online
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/11 16:09:06 (permalink)
    0
    Hello !
     
    Read this message :
     
    http://forum.microchip.com/tm.aspx?m=145639
     
    This is probably because you select a port and MPLAP takes one other... (MBLAB work great with Port 1,2,3 but with higher port some problems occur. Especially if you have a "hole" in the port list (ex : port 1 & 2 : computer serial port, 3 : nothing, 4 : your usb to serial converter. MPLAB takes port 3 and not 4 !! )
    #8
    UARTer
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2006/07/16 12:46:36
    • Location: 0
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/12 10:05:31 (permalink)
    0
    Hello, I also have the same problem.  I have read couple of forum topics regarding this problem.  However, I have not found a suitable solution to my connectivity problem.  Odd thing is, it worked fine 3 days before, and now it seems to be unable to connect.  I have not done any changes to the settings either.
     
    I am currently connecting through USB and am not selecting any of the COM1 or COM2 (others are not available in Wizard Setup for ICD 2)
     
    I am unable to run a self test because MPLAB cannot see the programmer at all!
     
    This is what I get when I try to connect:

    Connecting to MPLAB ICD 2
    ICD0019: Communications:  Failed to open port: (Windows::GetLastError() = 0x2, 'The system cannot find the file specified.
    ')
    ICD0021: Unable to connect with MPLAB ICD 2

    MPLAB ICD 2 Ready

     
     
    Also, I tried disconnecting the programmer and connecting it back to my PC, and Windows XP says that the "USB Device Not Recognized"!  It is as if the drivers for ICD 2 were lost and cannot be assigned again.  I need help on how to fix the problem, thanks in advance.
    #9
    jotalinux
    Super Member
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/07/29 14:17:18
    • Location: Portugal
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/28 17:02:37 (permalink)
    0
    Hi
    Recently, they had returned my ICD2 to me that was loaned.  The ICD was functioned one time in a Microchip seminary are a couple of years or even less.

    I already read all manuals up side down, forward and backwards and nothing.
    I have to all "POD's" and programmer boards to emulate/program 10f/12F/16F/18F.
    Oh..i have to, PICDEM-2 and PICDEM-2 PLUS.

    Normaly i work with true emulators, but now i like to try something with this.

    I receive this when i "debug / connect" MPLAB 7.41:
    ..and the same if in programmer mode.

    Connecting to MPLAB ICD 2
    ICD0021: Unable to connect with MPLAB ICD 2
    MPLAB ICD 2 Ready


    And this when i try download O.S.:

    Downloading Operating System
    ICD0021: Unable to connect with MPLAB ICD 2
    ...Download Operating System Failed
    ICD0029: Connected tool is not an MPLAB ICD 2:  Product ID = 0x0 (MPLAB ICD (1)) "Yes it is Note *1"
    ICD0082: Failed MPLAB ICD 2 operation
    ICD0082: Failed MPLAB ICD 2 operation
    ICD0082: Failed MPLAB ICD 2 operation
    ICD0082: Failed MPLAB ICD 2 operation
    MPLAB ICD 2 Ready

     
    Note *1: device connected is "POD" with PIC16F648A to emulate 16F628A.

    The result is the same with COM or USB. Any suggestions?
    Sorry for use this thread, seems indicated.

    Regards
    post edited by jotalinux - 2006/08/28 17:26:08
    #10
    plugwash
    Super Member
    • Total Posts : 332
    • Reward points : 0
    • Joined: 2006/04/07 13:45:54
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/28 18:50:07 (permalink)
    0
    As well as what has been already mentioned apparently some usb to serial converters miss out the ground connection. Try plugging a usb cable into a spare port and connecting a crocodile clip lead from the usb connector shell to the targets ground.


    #11
    jotalinux
    Super Member
    • Total Posts : 457
    • Reward points : 0
    • Joined: 2006/07/29 14:17:18
    • Location: Portugal
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/08/28 19:33:10 (permalink)
    0
    Thank you so much but doens't works.
    I give up..the price of this tool doens't justify this waste of time.

    Once again...thanks for suggestion
    Regards 
    post edited by jotalinux - 2006/08/28 19:55:46
    #12
    vaughanatworld
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2006/02/15 19:19:13
    • Location: Boston, MA
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/09/11 08:32:53 (permalink)
    0
    I ran a series of tests on a single desktop machine with standard serial ports. I loaded XP then, Win 2k, then Win 98. Both XP and Win 2k failed in the usual way. Win 98 worked correctly. All instances were configured with MPLab 7.31
     
    I did this test a number of months ago. For the past number of months I have been using the USB connection with no problems.
     
    I sure would like to have a rational explanation as to what is going on with the MPLab serial driver.
     
    Brian
    #13
    mhwang
    Junior Member
    • Total Posts : 97
    • Reward points : 0
    • Joined: 2006/11/10 14:43:14
    • Location: Los Angeles, CA
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/11/24 21:00:14 (permalink)
    +1 (1)
    I also had the same problem with the ICD2.  Opening the WinXP device manager and disabling and the enabling the ICD2 seems to fix the problem temporarily.
    #14
    Whacko
    Super Member
    • Total Posts : 277
    • Reward points : 0
    • Joined: 2003/11/25 14:19:32
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2006/11/25 04:00:30 (permalink)
    0
    Make sure that there isn't another thread running that uses the serial port, could be a modem or terminal program, dnc etc. It is usually the case.
     
    Whacko
    #15
    manikya
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2007/03/26 03:11:31
    • Location: 0
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2007/03/26 03:43:57 (permalink)
    0
    Hi, Hope someone can help me with a similar problem. I am trying connect to a mplab icd2 programmer through a rs232 com port. The rs232 is a USB to serial convertor from Aten Technologies(As I have no com port on my laptop, had to resort to buying a 232 adapter on usb). I have checked the com port adapter using a terminal which echoes characters fine (IRQ5). But on Mplab icd2, have set the correct interrupts and still getting a error of communication as follows
    ICD0019: Communications:  Failed to open port: (Windows::GetLastError() = 0x2, 'The system cannot find the file specified.
    ')
    ICD0021: Unable to connect with MPLAB ICD 2
    MPLAB ICD 2 Ready

    The device manager indeed shows the serial bridge to be present and working. In system Information under software environment notice the driver for Aten serial adapter is loaded. The windows Serial.sys is not loaded, could this be causing the problem?  In a previous post it is stated that anything above com4(mine defaults to com5) cannot work for mplab, Any way of getting around this problem?  I tried to set the com port to a lower value but then the other com ports say they are in use! How do check each com ports allocations? The laptop has built in bluetooth, modem, wifi, lan,do these also get to use these com port numbers. I have tried disabling the modem. Is there any way I could allocate and rearrange the com ports so I can get a number less than 4 as suggested? Under bios I notice there is no option to fiddle with com port settings as this laptop has no irda or a physical com port. The laptop is a acer 5500z. Mplab version 7.4  communicating to a pic icd2 programmer setup. Any help is greatly appreciated, Thanks in advance!
    #16
    manikya
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2007/03/26 03:11:31
    • Location: 0
    • Status: offline
    RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2007/03/28 02:59:46 (permalink)
    0
    Managed to get the mplab icd2 to communicate with mplab ide through the usb to serial adapter. Had to set the port as com1 under device manager, port settings advanced. Forced it to use com1, now its working fine!
    #17
    kmorri09
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2011/06/30 07:26:13
    • Location: 0
    • Status: offline
    Re: RE: ICD0019: Communications: Failed to open port: (Windows::GetLastError() = 0x2 2011/06/30 08:25:06 (permalink)
    0
    I'm using a PIC16F886 Chip through the PICkit Serial Analyzer and debugger MPLAB IDC 2. It is connected to the Analyzer through USB but I am getting the errors:

    ICD0019: Communications:  Failed to open port (USB): (Windows::GetLastError() = 0x2, 'The system cannot find the file specified.
    ')
    ICD0021: Unable to connect with MPLAB ICD 2 (USB)

    This is similar to the errors some of you above got, but I can't solve it using your solutions! I've tried switching to COM1 and COM2 in the debugger in MPLAB. One help menu said that the driver may not be installed, but it seems like it is, I've installed and updated everything possible. Does anyone have any idea how to solve it?
    #18
    Jump to:
    © 2017 APG vNext Commercial Version 4.5