ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)

Hello,

I bought the UAV dev board and the MPLAB ICD2 programmer. I am receiving the following message when trying to connect to the board:

ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)

The programmer is working fine through USB and all self tests pass OK.

The UAV Dev Board works OK with the preloaded software without being connected to the programmer.

Do you know what could be happening and how can I get it programmed from the ICD2?

Thanks and regards.

Views: 7321

Reply to This

Replies to This Discussion

Dante,

The first thing to check are the power options under the programmer settings. Make sure that the ICD2 is not trying to supply power to the board. If that option is checked, uncheck it.

Next, I have a question for you. Are you using the recommended ICD2?

http://www.sparkfun.com/commerce/product_info.php?products_id=5

Some folks (myself included) bought a PIC-ICD2-Pocket, and had some problems with it. If you have a PIC-ICD2-Pocket, that could be the problem.

Assuming that you have the right ICD2, where did you connect the 6 wire programming cable to it? There are two places that you could connect, only one of them will work. You should connect to the 6 pin header that is between the USB and the RS232.

Another thing to check is the continuity of the 6 wire programming cable. It is possible that one of the wires is broken or is not making a good connection with its pin.

I am in the process of writing up a "getting started" document, I will have it finished in a day or two. Here is a link to a rough draft.

In any case, I will work with you to get your board programmed.

Best regards,
Bill Premerlani
Hello Bill,

I took your advice and exchanged my Pocket-ICD2 with the recommended Olimex ICD2 from Sparkfun. Still having the same errors.

--------------------------------------------------------------------------------------
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 ready for next operation
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 ready for next operation
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 ready for next operation
----------------------------------------------------------------------------------------
All voltages are correct.

The errors occur while running MPLAB 8.30 using the student or demo version of the C compiler you recommended. I’m running Windows XP.

I installed MPLAB 7.50 and the student and demo C compilers, both work fine no errors. When I go back to 8.30 the errors return.

What version of MPLAB are you running?

Any ideas?

Greg Gibbons
Bill,
Thanks for the input on this and taking care.
Yes I am using:
http://www.sparkfun.com/commerce/product_info.php?products_id=5
Programming wire is connected as you describe, Vdd power is 4.92v (on its own power), Continuity is ok in the 6 cables.
Still receiving the same error message and cannot program the board, same errors as described by Greg.
Currently im running MPLAB 8.30 version I'll try to downgrade to 7.5 just like Greg did and see what happens.
Same question, what version of MPLAB are you running Bill?
Thanks
Greg,

Are you saying that you are able to do the programming with MPLAB 7.50 but not with MPLAB 8.30?

If so, that is very useful information to everyone who has my board, and I thank you for it, I will add it to the list of things to try.

I am running MPLAB 8.30, and I am not having any problems with it, so this is puzzling to me.

If there are any PIC ICD2 experts out there who could shed some light on this, your help would be very much appreciated.

Thank you very much,
Bill Premerlani
Bill,

Yes, 7.50 works fine. I can program the Dev board many times without errors. I just finished uninstalling every version of MPLAB, the C compilers and the remaining folders left behind on the hard drive. I ran Norton utilities- registry clean and reinstalled MPLAB 8.30 and the eval C30 compiler. Again no luck, it can not tell what part it is. So I reinstalled 7.50 again no errors and no problem programming the dsPIC30F4011.

Needless to say I will stay with 7.50 untill someone figures this issue out.

Greg Gibbons
Greg,

This is very useful information. Thank you very much.

Everyone else,

This is a mystery to me. If there are any PIC experts reading this who are willing to offer an opion, here are some of the clues:

1. Some folks are having trouble programming the dsPIC30F4011.

2. Some folks are using the Olimex USB/RS322 ICD2 from SparkFun, some are using the Olimex PIC-ICD2-Pocket. There have been problems with both types of ICD2s, there have successes with both types of ICD2s.

3. I am running IDE 8.3. I cannot get my PIC-Pocket to work.

4. Most folks are probably running a relatively recent version of IDE.

5. The most commonly reported problem is that the ICD2 fails to connect to the PIC.

The obvious things have been checked.

Help!!

Bill
Here is a "Getting Started with PIC Programming" guide that might help.
Bill Premerlani
Dante,

Hopefully, by now you have your ICD2 working. If not, there is one more thing you might try. Try connecting your ICD2 to the DevBoard with something besides the 6 wire cable, even if the 6 wire cable checks out ok. You could use individual single wire jumpers, or a pair of 3 wire female-female servo cables. Be careful to get the correct pin sequence, refer to the 6 wire cable to see what it is. Pin 1 of the ICD2 connects to pin 1 of the UAV DevBoard, etc.

The reason I suggest this is that I suspect there are some cables that have an intermittent problem. When I bought a PIC-ICD2-Pocket, it arrived with one of the wires pulled out of the connector. I have 4 of these cables, so last night I tried gently tugging on the wires. A couple of them slipped right out. So I took them apart to repair them. (I soldered them) In the process I discovered that some of the connections were not crimped very tight, and in a few cases the crimp was on the insulation, and the connection was made only by the end of the wire touching the connector.

This could lead to an intermittent connection. The cable might test ok when you disconnect it, but when you connect it, it might not be.

So, if you are able to make get your ICD2 working by connecting it with jumpers or a pair of servo cables, then there is a problem with your 6 wire cable. In that case, contact SparkFun to get a new cable.

Best regards,
Bill Premerlani
Bill,

That was one of the first things I checked as well. Both the recommended ICD2 and the PicPocket cables had marginal crimps and a wire pulled out. Obviously poor quality. Even after repairing the cables I had the problems I mentioned prior.

If anyone is using MPLAB 7.50 you must add the the file p30f4011.gld to the Linker script folder in View-> Project window.

Greg Gibbons
Bill & Greg,
Ive deinstalled 8.30 then downgraded to MPLAB 7.5 and BRAVO! it works!
No more error messages, MPLAB "sees" the target board now.
The quality of the 6 wire connector is really poor, i also experimented the intermittency problem, sometimes pulling in and out a couple of times is needed to make it work. Yes, continuity is ok when checked unconnected but problem is there, i guess poor quality components.
Now i will try to build some of the test programs and see what happens, i will let you know.
Dante,

I am very glad to hear that you are up and running by following Greg's advice. Thank you, Greg.

Regarding the 6 wire cables, I called SparkFun today, they are going to take a closer look into the quality of those connectors. In the meantime, you should contact SparkFun technical support and ask them to send you a free replacement cable.

I found that the female-female servo cables have the right pin spacing, you could use a pair of them to connect your board to the ICD2. Be very careful to get the right connection sequence by referring to the 6 wire cable.
Hardware now seems to be working ok, as I said above now I can program the board using 7.5, but new problems get me stucked...
Im trying to compile the rollPitchYaw example but i receive the following error message:

Executing: "C:\Archivos de programa\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F4011 -c -x c "analog2digital.c" -o"analog2digital.o" -g -Wall
analog2digital.c:43: warning: `__no_auto_psv__' attribute directive ignored
Executing: "C:\Archivos de programa\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F4011 -c -x c "main.c" -o"main.o" -g -Wall
main.c:15: error: syntax error before numeric constant
main.c:15: warning: type defaults to `int' in declaration of `_FICD'
main.c:15: warning: data definition has no type or storage class
Halting build on first failure as requested.
BUILD FAILED: Thu May 14 10:09:13 2009

Maybe i am missing something basic but it keeps me stucked since yesterday.
(p30f4011.gld was added to the Linker script folder as Greg said)

Reply to Discussion

RSS

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service