Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 18th November 2007, 02:12 AM   (permalink)
Default dsPIC30F4011 and ICD2

THe ICD2 is not recognizing my dsPIC. I am not sure why. I wired up the pull-up resistor to MCLR, and applied power to all the Vdd/Vss and AVdd/AVss pins with bypass caps, as well as running out the PGC,PGD, MCLR, Vdd, Vss lines to an ICD2 jack. I select the ICD2 as the programmer in MPLab as well as the device but it just doesn't seem to be get a device ID from the PIC when I choose "connect". I tried it with another PIC18F (modified to it's pins of course as well as changing the selected device), and it still didn't recognize it, but the universal programmer verifies that PIC18 is working (but it doesn't support the dsPIC so I can't use it). I also selected the configuration bits to use the default PGC/PGD pins as the com port, and not some alternate ones (but it shouldn't matter since my PIC only has one PGX pair of pins anyways, only the EMUx pins have alternates.

Am I missing something subtle? I am pretty sure I got everything in the manual but it still isn't working. I remember to select the right device and upload the right OS to the ICD2 and the ICD2 passes it's own self check so it seems to be working.

What I described is exactly what I did, nothing more. Did I miss something? I shouldn't be having the problem with the hardware since it's the barebones wiring but it's just not working.

Last edited by dknguyen; 18th November 2007 at 02:20 AM.
dknguyen is offline  
Old 18th November 2007, 10:38 AM   (permalink)
Default

Have you measured the supply voltage with the ICD2? It is under programmer - settings - voltages, I think. You can use that to check the PIC power is getting through to the ICD2.

If that is OK, make sure all the connctions are correct, and then look at the MCLR, PRGD & PRGC with a 'scope, while attempting to program. There should be 3V square data signals on all of them. If not, you might have shorts or too much capacitance on the lines.

I have programmed a wide range of PICs with an ICD2, (10F200 .... 24FJ32G002) and the only problems have been down to connctions, power supply or something stopping the ICD2 from asserting the voltages.
Diver300 is offline  
Old 18th November 2007, 10:53 AM   (permalink)
Default

Quote:
Originally Posted by Diver300
Have you measured the supply voltage with the ICD2? It is under programmer - settings - voltages, I think. You can use that to check the PIC power is getting through to the ICD2.

If that is OK, make sure all the connctions are correct, and then look at the MCLR, PRGD & PRGC with a 'scope, while attempting to program. There should be 3V square data signals on all of them. If not, you might have shorts or too much capacitance on the lines.

I have programmed a wide range of PICs with an ICD2, (10F200 .... 24FJ32G002) and the only problems have been down to connctions, power supply or something stopping the ICD2 from asserting the voltages.
I know it's not shorts and not something stopping the ICD2 from asserting (at least not MCLR anyways). Maybe it really is capacitance or something. I''l try again this week...we already got a one week extension because none of the lab equipment supports our uC.
dknguyen is offline  
Old 18th November 2007, 03:11 PM   (permalink)
Default

I read on the Internet that other people had the same problem and several hypotheses were made:
- cross-talk between PCD and PGC lines.
- power not sufficient for dsPIC30F programming operations.
- troubles after using ICD2 debugger. Have you programmed the uC succesfully before experiencing that issue? In that case, I believe that a "bulk erase" can bring your chip back to its original state (supported if Vdd>4.5V).
- ...
eng1 is offline  
Old 18th November 2007, 06:12 PM   (permalink)
Default

Quote:
Originally Posted by eng1
I read on the Internet that other people had the same problem and several hypotheses were made:
- cross-talk between PCD and PGC lines.
- power not sufficient for dsPIC30F programming operations.
- troubles after using ICD2 debugger. Have you programmed the uC succesfully before experiencing that issue? In that case, I believe that a "bulk erase" can bring your chip back to its original state (supported if Vdd>4.5V).
- ...
I've programmed them before but using a MELabs programmer. THis is my first time using my ICD2 as a programmer or as a debugger. It's been sitting in the closet forever.
dknguyen is offline  
Old 18th November 2007, 10:20 PM   (permalink)
Default

Do you have pullups on the PCD and PGC lines? If you do, it won't work.
__________________
--- The days of the digital watch are numbered. ---
kchriste is offline  
Old 18th November 2007, 10:23 PM   (permalink)
Default

Quote:
Originally Posted by kchriste
Do you have pullups on the PCD and PGC lines? If you do, it won't work.
I do not. Just straight wires.
dknguyen is offline  
Old 19th November 2007, 10:20 PM   (permalink)
Default

Are you using USB or RS-232 to connect your ICD2 to the PC? If you use RS-232, you will need to power ICD2 with 9v power supply. If you power your PIC via ICD2 you will need power supply connected to ICD2 even if you use USB.

The next possible cause for your symptoms is Windows device driver for ICD2. Look at the MPLAB's release notes for the explanation how to fix that.

Also, check if you can use ICD2 in debugger mode with your PIC18. You will
need working clock on your micro - configure internal clock if necessary. If not, most likely your ICD2's output drivers are dead.
felis is offline  
Old 19th November 2007, 10:48 PM   (permalink)
Default

Quote:
Originally Posted by felis
Are you using USB or RS-232 to connect your ICD2 to the PC? If you use RS-232, you will need to power ICD2 with 9v power supply. If you power your PIC via ICD2 you will need power supply connected to ICD2 even if you use USB.

The next possible cause for your symptoms is Windows device driver for ICD2. Look at the MPLAB's release notes for the explanation how to fix that.

Also, check if you can use ICD2 in debugger mode with your PIC18. You will
need working clock on your micro - configure internal clock if necessary. If not, most likely your ICD2's output drivers are dead.
I'm using USB and have external power going to the board itself. This is a brand new ICD2- could something be wrong with it? Because we've already gotten a one week extension just because the damned thing won't work. The PIC18 isn't mine so I would have to find that person again. Perhaps I should hook up an oscilloscope to the PGC and PGD pins to see what they are doing?
dknguyen is offline  
Old 19th November 2007, 11:09 PM   (permalink)
Default

Check if Windows driver is correct. It's very easy to install the wrong one. Look in the MPLAB release notes - there is a procedure for deleting the wrong driver and installing the right one.

Also, paste here what is printed in MPLAB "output" window when you try to connect it.
felis is offline  
Old 19th November 2007, 11:53 PM   (permalink)
Default

I isntalled MPLab and C30 first. After that I plugged in the ICD2 and it kind of installed itself. THe ICD2 also passes it's self test and all so it seems like I can communicate with the ICD2, just not the uC. Would the wrong driver still allow the ICD2 to pass a self-check and not recognize the IC? THe PC is in the lab at school right now so I'll post the stuff when I get there (maybe, the PC isn't connected to the net and I don't have a USB key).

I found a copy on the net though what happens:

Code:
Connecting to MPLAB ICD 2 
...Connected 
Setting Vdd source to MPLAB ICD 2 
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0) 
...Reading ICD Product ID 
Running ICD Self Test 
...Passed 
MPLAB ICD 2 Ready
dknguyen is offline  
Old 20th November 2007, 12:33 AM   (permalink)
Default

Code:
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)
I'm playing with my ICD2 right now. It gives this diagnostics when PIC is not connected to ICD2 or when it's connected but not powered up.

At that point I'd start checking connectivity :-). I made couple snapshots of PGC and PGD pins just after pressing "Connect" in MPLAB "Programmer" dropdown so you know how they should look like.
Attached Images
File Type: png pgc_and_d_analog.png (6.4 KB, 12 views)
File Type: png pgc_and_d_digital.png (3.7 KB, 12 views)
felis is offline  
Old 21st November 2007, 06:07 PM   (permalink)
Default

After 30 hours of debugging and 3 of those hours being helped by a TA, I found the problem...the PIC wasn't pushed into the breadboard hard enough- hard enough so that all of the pins I would normally measure to check if it's connected made contact (like power pins and reset), but none of the others.

BAAHHHHH

That's probably not as bad as noticing the power isn't on, but my record for that is two or three hours....not 30 hours.
dknguyen is offline  
Old 21st November 2007, 06:13 PM   (permalink)
Default

Quote:
Originally Posted by dknguyen
After 30 hours of debugging and 3 of those hours being helped by a TA, I found the problem...the PIC wasn't pushed into the breadboard hard enough- hard enough so that all of the pins I would normally measure to check if it's connected made contact (like power pins and reset), but none of the others.
Yet another reason for NEVER using breadboards!
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 22nd November 2007, 05:38 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Yet another reason for NEVER using breadboards!
Yeah I don't use breadboards at home either...but this is school. I should get some wire wrapping stuff.
dknguyen is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 02:12 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker