Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ICSP with icd2 questions and bootloader?

Status
Not open for further replies.

seyyah

Advanced Member level 2
Joined
Oct 7, 2001
Messages
646
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
6,233
icsp with icd2

I'm using icd2. I never connected it to an external application except microchips demoboard. I will design a new application. I want it to be icd2 debuggable and programmable. Microchip shows the connection between icd2 and application as shown in the picture but i have some questions in my mind:

1- We use 5 pins: VDD, VPP/MCLR, PGC, PGD and VSS. During programming or debugging do we separate any of these pins from the application? If so which pins?
2- I'm using the following(reset.gif) circuit for mclr pin. Can't i use this with icd2?
3- Must i sacrifice any of the pins for icd2 connection?

Shortly what is the best choice to connect my application to the icd2?

I also don't know what bootloader is? Is it a program that allows the chip to be programmed with only 2 pins instead of 5? What's the condition for dspic? I read that dspic can program itself. If so does it need a bootloader? How can it be programmed and debugged while the chip is on the application board?
 

icd2 connection

Hi,

I will try to answer all your questions:
1.
A. You can only use ICD real time debuging if the PIC support this. All the reset can only be programed and not debug in real-time.
B. In the MPLAB When you choose the typr of PIC under select device, the green or read under "Microchip debuger tool support" - MPLAB ICD2 will tell you if you can debug ( green ) or just program ( red ).
C. Vdd is used so the ICD will know that the PIC is powerd. You can use the ICD2 to supply your board with Vcc, but i dont recomand that if you dont know what you are doing.
D. MCLR - is used to reset the PIC and also supply it with 13V when programing the FLASH.
E. PGD - Data too and from the pic
F - PGC - Clock to sync the data PGD
G. and Vss as ground.
H. If you want to debug the PIC in real time, then yes you cant use this pines as long as the ICD2 is connected. If you do want to use them then you will have to design your ciruit in such a way that it want interfear with the comunication of the ICD when you debug or program the PIC.

2. Yes you can, but to start with, dont use the diode and the cap. Only the resistor is a must.

3. When you connect the ICD as your picture in figure 2, the PIC will know that the ICD2 is talking to him when the PIC will see 13V in the MCLR. Nothing else needs to be configured in the PIC.
BUT: If you want to use the debug feature, you will have to tick the ( in MPLAB ) under Project, Build options, Project, you will find in one of the Tabs a place to Tick the ICD2.

4. As i said, the second picture is a good way to start connection your PIC to the ICD2.

5. Bootloader is a program like the BIOS in your computer. it loads itself and then the OS from the Hard disk ( more or less )... you first need to load to the PIC with the ICD2 or any otehr means and only if that pic has a serail port feature.
Its a very small program most of the time that start first when the PIC loads. if the bootloader cant find another program in memory it sets the serial connection pines so it will receive the program using the serial port ( 2 pines ).
if there was a program in th memory it can start runing the program after a short delay that was set in the bootloader program.

I have attached the ICD2 user guide for you to read. Please read it and you will have all your answers and much more.
Regarding the DsPic, you will have to read more about it after you will read the pdf i attached.

Good luck...
 

pic icd2 cable

I wonder that when we interconnect VDD(5V) and VPP(13V) doesn't this have a drawback? Must we completely separate pgc and pgd pins from the application by a jumper etc or does a resistor with a right value suffice?
 

wite bootloader for pic

I have connected a dspic30f4011 to the icd2 as in the figure2 but icd2 couldn't connect it and displayed an error like "Invalid target device id....."
I've connected the avdd and avss to the same terminals as vdd and vss. I checked the cable, it seems right. What may be the problem? What is the simplest connection to test it?
 

bootloader dspic4011

Hi,

Can you please copy past the complete message. I need to read what you got in order to answer your questions.

Thanks.
 

icd2 icsp connect,on wiring

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
 

icd2 connections and pinouts

Hi,

It looks like that your Vcc and GND are fine. The connection with the MCU is not working. it could be one of this two things:
1. Your PGD and PGC are not connected correctly.
2. Your Clock on the MCU is not working or not functioning correctly.

Please check this 2 and let me know.
Also, Regarding your previus question on the PGD and PGC. You can use this pines but you will have to connect a 4.7K resistor to speratet the PGD and PGC from your board.

Good luck.
Gidi.
 

icd2 connections

gidimiz said:
1. Your PGD and PGC are not connected correctly.
2. Your Clock on the MCU is not working or not functioning correctly.

1.PGD and PGC seems ok. I reversed but nothing changed.
2.What did you mean by clock? I tried different mcu's (dspic4011 and pic16f876a)
the result is same.

I have a demoboard also. It has 30f6014 on it. It's working with icd2. I compared my connections to it and it seems ok. I also reversed the connections but the result didn't change. I shortened the cable the result didn't change. But i tried to connect the cable to the demoboard with this cable it didn't work also . May be i couldn't connect it properly because the cable has no jack on one side of it and cables are free. But on my board i checked connections with a multimeter and its ok.
 

icsp connection for icd2

Hi,
Its very hard to debug the board if i cant see it. I can tell you that if your demo board is working, then you are doing something wrong. The first time i tried to build my own board, i had the same problem as you did. I found out that i didnt connect the wires correctly and the oscilattor wasnt runing ( thats whay i meant for clock ).
Again, Check that you have 4Mhz ( or what ever clock you are using ) in the oscliattor when you have the power connected.
Also, see the attached file. This are the correct connection that i made for my self to see how the ICD2 cable is connected.

***********************************************************
Tell connector cable colers and pic connections


1 RST Blue
2 VCC Yellow
3 GND Green
4 RB7/data Red
5 RB6/clck Black
6 NC White

*when the white cable is in the USB side and the blue is in the PWR side

************************************************************



If it works, let me know what the problem was.

Good luck.
 

    seyyah

    Points: 2
    Helpful Answer Positive Rating
icsp pic using icd2

gidimiz said:
1 RST Blue
2 VCC Yellow
3 GND Green
4 RB7/data Red
5 RB6/clck Black
6 NC White

You're great gidimiz. I started from the beginning and wire all the cables according to your post. And surprise! it worked. You saved my life thank you very much.
Actually main problem was the wrong wiring. I always tried like this:

1 RST white
2 VCC black
3 GND red
4 RB7/data green
5 RB6/clck yellow
6 NC blue

which is just opposite of the true colors. I think the figure in the icd2 document is mirrored figure. So i confused it. Actually i once tried to oppose all the pins but it didn't worked also. I think i also made another mistake when i tried true connections. Anyway i solved with your help now, thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top