View previous topic :: View next topic |
Author |
Message |
Markdem
Joined: 24 Jun 2005 Posts: 206
|
Help with PIC24 and ICD3 |
Posted: Wed Nov 07, 2012 4:57 am |
|
|
Hi All,
I know this is not really a CCS question, but you guys are always so nice and helpful.
I have a PIC24FJ256DA210 on a board I made myself. When I connect an ICD3 it returns a device ID of 00000000 which normally means it can’t see a PIC. During my debugging I tried to see if the ICD is outputting a clock with my scope and all of the sudden I could see my PIC. As long as I hold the scope probe on the ICSP clock line I can program the pic fine. Once programed, the PIC will run without the probe.
I am not touching the pin on the pic or the ISCP connector so I don't think it is a bad solder join. I have soldered a wire going from the trace to the probe so I am not putting any presser on the trace in case it was board flex making it work.
In any other board I have here (PIC16, PIC18 and DSPIC) it works fine. MCLR is tied high via 10K.
PIC VDD = 3.32v
PIC VCAP = 1.81v
It is almost like some form of capacitive loading making the ICD work, but I am stuck trying to work this one out.
Has anyone seen anything like this before, or have any ideas on what I can try to fix the issue?
Thanks
Last edited by Markdem on Wed Nov 07, 2012 5:28 am; edited 1 time in total |
|
|
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Wed Nov 07, 2012 5:20 am |
|
|
Just a quick update,
Scope off with probe touchingthe clock track - PIC will program.
Scope probe disconnected from scope - PIC will not program. |
|
|
Bill24
Joined: 30 Jun 2012 Posts: 45
|
|
Posted: Wed Nov 07, 2012 5:51 am |
|
|
Have you set a fuse for your clock e.g #use delay(clock=8000000).
Also try a PICKit 2.
I believe it possible to flash a PIC without this fuse set but not debug. |
|
|
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Wed Nov 07, 2012 4:31 pm |
|
|
Thanks Bill,
I don't think any of my code could be doing this as it happens before programming, but I do have a #delay int he code. I am not trying to use the debugger, just program at this point.
I will try a ICD2 today. I guess it will show if there is a problem with the ICD3.
Thanks |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Nov 08, 2012 12:51 am |
|
|
Quote: | When I connect an ICD3 it returns a device ID of 00000000 which normally means it can’t see a PIC.
|
Yes, it means there's a serious problem with the ICSP interface. The only case where I observe this is with a
broken ICD cable. Unfortunately I don't have ICD3, but various other adapters (ICD2, PICkit, RealICE, ICD-U).
All are working fine with PIC24.
Of course there may be an ICD3 problem, but I rather expect problems with your hardware. Without seeing a
circuit diagram and layout photo, it can't be determined. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Nov 08, 2012 1:40 am |
|
|
I use an ICD3 and typically, if the ICSP is mucked up in any way -- it can cause problems.
Microchip has very specific directions for implementing ICSP.
You should really post a schematic. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Thu Nov 08, 2012 2:13 am |
|
|
Hi Guys,
Thanks for the help. I don't think I have any connections the wrong way (PGD and PGC swapped) or anything as it would never work.
Not sure how to post a schematic here but it could not be simpler (it is a breakout board I use for testing.)
I have MCLR going to the MCLR on the ICD tied up to VDD via 10k. All VDD, AVDD and ENVREG connected to 3.3v and all VSS and AVSS to ground. All power pins are bypassed with .1uF. Vcap has a 10uF cap on it like the datasheet says. There is also a 10uF cap where the power comes onto the board.
I also have a 4MHz crystal with 18pF caps, but the problem is the same even if i remove this.
Besides the ICSP pins (RB1 and RB0) no other pins are connected to anything.
Like I mentioned before, everything works fine if I have a plugged in scope probe connected to PGC. I have tried a multimeter probe and it will make it work too. However a screwdriver (grounded or not) or finger don’t make it work. The scope probe will only work when it is plugged in but it does not matter if the scope is turned on.
I put the other channel of the scope in to VDD when I am connecting the ICD3 and can’t see any sags or spikes on the power rail. All nice and clean.
I check to see what would happen if I used the ICD3 to supply power. It did not work even with the scope probe but I have had some issues with this in the past so I will not put too much thought into it.
I tried my old trusty ICD2 and it works without a problem every time. To me it looks like an issue with the ICD3 but what could be doing this? This has me stumped.
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Nov 08, 2012 3:02 am |
|
|
You say 'no other pins are connected to anything'. There needs to be one. Ground.
Best Wishes |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Nov 08, 2012 3:05 am |
|
|
If ICSP is connected correctly without "forbidden" components (e.g. capacitors at PGD, PGC or MCLR,
and supply levels are O.K., then interfering signals or insufficient ground connection of the ICSP interface
can be a problem, in other words, typical breakout-board effects. That's why I asked for a photo.
The different behaviour of ICD2 versus ICD3 may be caused by faster operation of ICD3, which is usually
more sensitive to signal quality issues. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Nov 08, 2012 3:16 am |
|
|
Yes, the obvious things that the scope introduces, is a capacitance to ground, 'if plugged in'. Tend to suppress very high frequency signals to some extent, and also (of course) the scope probe will introduce a ground.
Best Wishes |
|
|
juliogtd
Joined: 01 Jan 2009 Posts: 6
|
Re: Help with PIC24 and ICD3 |
Posted: Mon Jul 29, 2013 2:16 am |
|
|
Hi All, I have a PIC24FJ256GB106 on a board I made myself.
It happens exactly the same as a Markdem, when I connect an ICD3 it returns a device ID of 00000000 and I can not program, verify or debug the device.
Well, I do not really like Markdem happens because, even connecting a probe get it to work (by the way, PGC and PGD electrical signals are clean and free from noise).
There is no component between ICD3 and programming pins PGD3 and PGC3, and Reset pin only has a 10K pull-up resistor, as shown in Figure 2-4 of MPLAB® ICD 3 In-Circuit Debugger User’s Guide for MPLAB X IDE
(http://ww1.microchip.com/downloads/en/DeviceDoc/52081A.pdf).
ENVREG pin is connected as is indicated in Figure 2-2 Regulator Enabled (ENVREG tied to VDD) of IC24FJXXXGA1/GB1 Families Flash Programming
Specification (http://ww1.microchip.com/downloads/en/DeviceDoc/39907a.pdf).
The only pins connected are those shown in Figure 2-3, i.e.: VDD, VSS, AVDD, AVSS, VUSB and ENVREG; and the remaining pins are off (high impedance).
PIN VDD= 3.3 V
PIN VCAP= 2.5 V
As discussed by the Engineering Technical Note ETN #29, MPLAB® ICD 3 VPP Increased Current Sink Modification (http://ww1.microchip.com/downloads/en/DeviceDoc/ETN29_MPLAB_ICD%20_%20VPP_CURRENT_SINK.pdf) ICD3 resistances have been replaced with values of 100 ohms.
ICD3 works fine with other boards based on the dsPIC33FJ256GP506 (also self-made) and testing it with ICD 3 TEST INTERFACE MODULE indicates that everything is correct.
I also tested with Pickit 3 programmer and it gives me the same problem (when I connect it returns a device ID of 00000000 and it does not work).
I do not know what else to do...
Has anyone any idea?
Thanks |
|
|
Markdem
Joined: 24 Jun 2005 Posts: 206
|
|
Posted: Mon Jul 29, 2013 3:01 am |
|
|
I should of updated this post, but must of forgotten.
I "sort of" found what the issue was. Don't ask me why but reducing the VDD voltage to the PIC below 3v will make it work. I sort of lost interest in trying to work out why as I did not end up using the PIC24 after not been able to get the integrated GFX working with the LCD I had.
Just remember I did not need any "Increased Current Sink Modification" on my board.
Also, I think I remember that VCAP should ~1.8 volts. It is coming from the vreg for the core. Been that high, I would think you have some supply issues. Check the datasheet to make sure you have all the power pins right. What cap have you got on VCAP?
Lastly, remember that my ICD2 worked fine, as did my PICKIT3 when I finally got one. It was just the ICD3 that was giving me issues.
Might be useful to say that I have not had any issues since on any other of my boards. It just was with PIC24. I would love to make another one, but just don't have the time.
See how you go anyway. Would love to see if you have the same issue. |
|
|
juliogtd
Joined: 01 Jan 2009 Posts: 6
|
|
Posted: Mon Jul 29, 2013 4:44 pm |
|
|
Hello, I have finally discovered what is the solution to the problem: it happens that I used the pin pair PGC3-PGD3 and, as I said, did not work (despite having the MPLAB option "Emulator functions are shared with PGEC3/PGED3" selected and also "#fuses ICSP3").
I changed the pair, I used PGC1-PGD1 and it all works correctly.
I do not understand why this happens because in the document "PIC24FJXXXGA1/GB1 Families Flash Programming
Specification" is said that:
"All of the devices in the PIC24FJXXXGA1/GB1 families
have three separate pairs of programming pins,
labelled as PGEC1/PGED1, PGEC2/PGED2, and
PGEC3/PGED3. Any one of these pin pairs may be
used for device programming by either ICSP or
Enhanced ICSP. Unlike voltage supply and ground
pins, it is not necessary to connect all three pin pairs to
program the device. However, the programming
method must use both pins of the same pair."
But ... the problem is solved (unfortunately I'll have to modify the PCB).
Thank you for your quick reply. |
|
|
|