Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Icd2

Status
Not open for further replies.

Angy

New Member
I get this warning when I connect to my prototype board.
ICDWarn0020: Invalid target device id (expected=0xA3, read=0x0)

This is what it says:
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0xA3, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready

So it passes the self test but it still throws the ABOVE warning.

The power on the software
target Vpp=11.02Volts
mplab icd2 Vpp=11.02Volts
Is this okay?

Connections:
connected all Vss &Avss to common
connected all Vdd &Avdd to Vcc
The MCLR pin is connected to a 10K which in turn connects to VDD
PGD AND PGC pins are connected to 24th and 23rd pins
The target Vdd=5.3 Volts approximately in the debugger as well the programmer mode.
Connecting the scope probes to 23rd and 24th pins shows the pulses

Is there anything I'm missing?

.
 
Yes, you're not reading what the 'error' says.

It's telling you that MPLAB can't find the PIC it's set to in your circuit - perhaps you don't even have it connected to a circuit?.

Assuming you do?, then set MPLAB to that PIC number, and the message (it's not an error) won't appear.
 
Thanks for the replies.
I have the power, osc connected to the pic. The MCLR pin is connected to Vpp of the icd2.And the configuration on the mplab is set for the 16f946 chip that I'm using.The self test passed but I still get the error. I understand that the error means that the icd2 cannot verify the target chip. Is there anything else I'm missing?
 
Thank you all. My programming PIN was not making good contact on the board. I can read the target now.
 
hi everyone, hope you can help me. at school i was given a general control board which includes an fpga (lattice) and a pic device. i am trying to read the code of the pic, but the programming male connector (the one that goes on the board) has pin 2 (Vdd) missing. i have tried several ways to connect everything so that i can read the code from the pic. but nothing seems to work. is there any way to connect things so that i can read the pic? because these two devices belong to an even bigger circuit and it would be quite complicated to remove the pic just to read it.

thanks a lot!
 
hi, no, it's not commercial. is there any solution like connecting some intermediate wiring or something like that. because the pin that is missing is the vdd one. if i power the target (the board) properly, and connect 5V to the cable that communicates the board with the mplab icd2, would that help? any solution like that?

thanks
 
hi, no, it's not commercial. is there any solution like connecting some intermediate wiring or something like that. because the pin that is missing is the vdd one. if i power the target (the board) properly, and connect 5V to the cable that communicates the board with the mplab icd2, would that help? any solution like that?
The VDD pin on a typical ICSP connection is optional. Just power the target separately.
 
The VDD pin on a typical ICSP connection is optional. Just power the target separately.

Depends on the processor, how it's connected, and how it's configured - if MCLR is configured as an I/O pin (like on a 16F628) then Vdd switching is absolutely essential. Even assuming it's configured as a RESET pin, it still needs the capability of pulling MCLR to ground as well as to 13V.

Basically you can't switch a running PIC to programming mode, so you have to select programming mode before it can run.
 
the device is a PIC16F877. when i connect the mplab icd2 via usb and power the target (it needs 24V the general board) this is what appears:

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x4D, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
... Failed Self Test. See ICD2 Settings (status tab) for details.
MPLAB ICD 2 Ready

i'm assuming that it has something to do with the pin that's missing, the vdd one. and on the power settings:

target vdd: 0.00
target vpp: 12.46
mplab icd 2 vpp: 12.46

also, i have selected the option "target has it's own power"
 
Can you post the circuit of the target board, or at least that around the MCLR and programming pins?.

It's quite possible that you need to do something (such as remove components, or short pins together) to allow access to the PIC.
 
hi, sorry for answering so late. this is the schematic of the board's connector. the VCC is the one that gives power to the entire board (not just the pic device) and it's 24V, the CR1 is a ceramic resonator. if you need anymore information please let me know. thank for your help
 

Attachments

  • pic programming connector.JPG
    pic programming connector.JPG
    80.5 KB · Views: 244
I'f you have an original ICD2 like me you must take out the 10K res. pull up from the PGD line.
When running in debug mode you don't need the 10K pull up on MCLR, the ICD2 does the work.
The ICD2 has internal 4,7K res. that will do the pull up/down when needed.

About PGM, i think that PGM is only used for low voltage programming... So don't connect it. (unsure on this)

About the Vdd from the ICD2, dispite what others may say, you must connected it to your target device, use a diode to prevent the ICD2 from powering your device, the reason is that the ICD2 uses a buffer on the outputs, this way it can work on any voltage level and with any PIC !!!

You can keep the MCLR pull up it does no harm, but that way your device is allways working, even when it isn't on debug/running mode on the MPLAB... It enter programming state an reset state but after that it starts running because it allways has 5V on it...

Have fun!
 
hi everyone, problem solved! i connected a wire from the pic's vdd pin to the connector's vdd and it worked. it was kind of a desperate measure, but it worked. now i have another problem hahaha i extracted an hex file from the pic's memory (which i converted to asm, and doing the best to understand how it works) but i don't know where to get information regarding pin configuration. on the hex file i extracted from the pic it doesn't appear...
 
from the pic device i extracted a program. but now i don't know which pins are inputs or outputs. there is no tris command (or something like that) i can post the code if you want
 
from the pic device i extracted a program. but now i don't know which pins are inputs or outputs. there is no tris command (or something like that) i can post the code if you want

The TRIS command was advised not to used a LONG time ago, well back last century - the recommended method is to write to the TRIS register.

Post your code so we can look - use code tags to surround it (click advanced to add the icon for it).
 
Code:
0000: 2827  GOTO   0027   
0001: 3FFF    0FFh
0002: 3FFF    0FFh
0003: 3FFF    0FFh
0004: 2805  GOTO   0005   
0005: 0000  NOP          
0006: 0009  RETFIE       
0007: 1283  BCF    3,5    
0008: 0197  CLRF   17h    
0009: 0191  CLRF   11h    
000A: 1683  BSF    3,5    
000B: 3031  MOVLW  31h    
000C: 0092  MOVWF  12h    
000D: 1283  BCF    3,5    
000E: 300C  MOVLW  0Ch    
000F: 0095  MOVWF  15h    
0010: 3019  MOVLW  19h    
0011: 009B  MOVWF  1Bh    
0012: 018B  CLRF   0Bh    
0013: 1683  BSF    3,5    
0014: 30FF  MOVLW  0FFh
0015: 0085  MOVWF  5
0016: 0086  MOVWF  6
0017: 0087  MOVWF  7
0018: 0088  MOVWF  8
0019: 0089  MOVWF  9
001A: 1107  BCF    7,2
001B: 1087  BCF    7,1
001C: 018C  CLRF   0Ch
001D: 1283  BCF    3,5
001E: 018C  CLRF   0Ch
001F: 302C  MOVLW  2Ch
0020: 0097  MOVWF  17h
0021: 009D  MOVWF  1Dh
0022: 0192  CLRF   12h
0023: 1512  BSF    12h,2
0024: 0008  RETURN
0025: 0064  CLRWDT
0026: 0008  RETURN
0027: 2007  CALL   0007
0028: 2025  CALL   0025
0029: 2828  GOTO   0028[COD
E][/CODE]
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top