General ICD2 questions

Status
Not open for further replies.

mramos1

Active Member
I hooked up the ICD2 to my target. I did not yet add the 10K (MCLR-VPP), but will add that later.

I get an unable to validate tartget. It is connected correctly. I pulled the chip out of the target and tried to program the chip in programming mode (again no 10K) and will not program.

I take it the 10K MCLR to VPP is required? Also, can I use the INT/OSC to run the debugger or must I run on a EXT/OSC?

Does the 10K stop me be programming with the ICD2?

Hope the 10K is my problem. Off to work on the cars, then I will tack on a 10K and see what happens.
 
Last edited:
the 10k will not stop you in programming PIC. because,from my observation, what ICD2 can do is put the Vpp/MCLR to Programming high voltage (12.75V to 13.25V accdg to datasheet) and 0V.

if you will be running your pic with the ICD2 connector inserted, it can release the MCLR line and let the 10K resistor take care of letting 5V on the MCLR pin for proper operation.
 
I added the 10K from MCLR to VDD, put the pic in the socket (not in the target board).

It looks like it will do a program and verify (see thumbnail). But if I hit verify and it fails (assuming that is my build memory against the chip flash)?

If I put the chip in the target it does not work either. I have WDT off, protect off, INTOSC on, etc..

Should a Program/verify, then a verify behind it pass both checks?
 

Attachments

  • new14.jpg
    118.8 KB · Views: 199
Last edited:
You have to be carefull when programming any PIC with ICD2 not to select internal osc and MCLR pin as general IO. MPLAB will warn you when you try to do this. You will succeed on the the first program attempt with no garrantee of success in the future because the ICD will be unable to reset the chip and the internal osc cannot be stopped.
 
OK, I gave up on the ICD2 since I designed the circuit without considering the ICD2 (3 pins).

Loaded WinPic and got out the trusty P16PRO40. It will not program it either.
It programs and fails on the verify. This is my first attempt at the 628A.. Here are the settings.. I bought 5 PICs. Maybe I should try another one. Do I need the VPP/MCLR 10K on the P16PRO40 as well for the "A" chips?

I tried low and high on the programming and I want to use the INT/OSC, tring to get away for AVR, and it is not going as fast as I would like

Off to read on the 628A programming..
 

Attachments

  • new15.jpg
    74.5 KB · Views: 168
Are you trying to program the 628A in circuit? If so you'll have the same problem as I described with the ICD2. The P16PRO40 has to be able to switch Vdd on the PIC when you set it for internal Osc and MCLR as IO. Otherwise the internal Osc will increment PCL before the programmer can place it in programming mode. This is how you have it set up right now with WinPic.
 
I am using the internal osc, it is a one time circuit and timing is not important. I am not using CLKIN, CLKOUT or MCLR on my target circuit (and did not add the 4K7 to MCLR; have it jumpered in now). Should I use the other internal OSC option?

I guess in the future I will plan on using an external osc (but I left Microchip for Atmel when I saw the internal OSC and no resistor to reset required) and also giving up some pins if I really think I need the ICD to debug.

Starting to miss AVR and even the PIC 16F84. hehehe..

BTW: If I hit program over and over it finally takes it. At least you just explained that issue so now I know what is going on far as that....

My new issue, I wrote the program in a couple pic basics. The one I paid for does not work, the other free ones do, but I ran out of free demo code space.. It is always something.
 
Hi,
I don't know how I missed this topic yesterday?!

I see Low Voltage Programming enabled. Don't know about win Pic, but with an ICD2 this will give you problems.

Also, as kchriste said, you should use the !MCLR as !MCLR when using internal osc.

You shouldn't have to give up the other two pins PGC and PGD, just be careful what they are connected to, or jumper them so you can disconnect during programming.

The 10k is to give the ICD2 control over !MCLR, but this is Microchip's programmer. I think some of the clones use a different value, so you might want to check what your ICD2 requires. (Are you using a clone, or the Microchip part?) I am now in the habit of jumpering this connection, to give the ICD2 complete control. Yes, you should be able to program the part with no resistor, but you will need to tie the pin high when you run.

I have had problems with my cable. The one which came with my ICD2 was almost 400 mm long, and worked on most development boards. However when using one of my Olimex boards, I had the device not found. I fixed this by making a short cable of about 150 mm. This is not the error you were getting though, so I doubt this is your problem. I think it has to do with configuration.

If you are using a compiler, you should check your listing file to make sure the proper config settings are being written. The "one you paid for" should give support, no?

Can you read the chip with the ICD2 in MP Lab, then look at your config settings? It looks like it is only program memory not getting written properly.
 
BeeBop. Thanks for checking in. I parked it I was so frustrated.

I soldered a 10K in my cable, that is 16" long and has a chip clip on the end.

I just hooked it up and did a read. Attached is the screen. But can I ICD with I am using the pins PGC/D are hooked too? I was gonna drop them from the code. I just want to be able to debug to see what the compiler gave me as the code does not work.

In CH-BASIC it started like it was supposed to. In Mikrobasic it is doing weird stuff. If I could step though the code and see that would be GREAT.. Of course mikrobasic does not use microchips ASM. CH does, but limits you to 50 lines.
It is funny the 2 good compilers (proton and ch-basic limited people and their products work, but the will move to another product because of that).

When are you coming back to Canada. hehehe.. I could call you cheap then

I think I am back to burn the chip, plug it in and run... I had that before ICD2..

Any help will be greatly appreiciated.
 

Attachments

  • new16.jpg
    50.1 KB · Views: 176
Last edited:
BeeBop. I went in programmer and read the chip, then set programmer to none, and selected ICD2 in debugger, hoping it would have the code in a hex buffer somewhere and I could attempt to step through it. Backwards from the norm.. And I get the attached.

I will tring loading the real ASM and programming again without low voltage and see what I get.. But here is what I get just tring to enter debugger attached to a powered target and ICD2 power jumper off. Mind you I burnt this PIC with Winpic/P16PRO40 not the ICD2, maybe it was looking for config bytes or a bootloader for the ICD.
 

Attachments

  • new17.jpg
    32.8 KB · Views: 158
Well, I hate to say it, but the time I have wasted AGAIN, I should have done it in Microchip assembler (I did the last project 12F509 in ASM it was not that bad and NO ICD2 at that time).

The last two ports in the last two PICBASICs (yes, I will name names. Mikrobasic and Mbasic) do not generate Microchip ASM files. So I can not
go on with the code and ICD2.

So back to ch-basic tomorrow. But I wrote it in ch-basic and it allows 50 lines of code on top of their software timers and so many times you can run it for free. The adware turned me off so I moved on, like Proton, ran out of space (50 lines), but what I had worked in both... I want to do a real (small) project, and get my ICD2 going, not bink an LED.

Question: Should I not be able to drop a 16F628a in the chip clip and program and debug it (power it from the ICD2) no target system just the chip.

TRIS all PINS and
Code:
top: 
goto top

and see the ICD2 be a debugger? And I want to use the internal OSC. Will this is a problem?
 
Mramos1, Whoa!

Slow down a bit, I hear the frustration! When I had my problems, I didn't get any help, but posting to a forum helped me get everything right in my head, and eventually, solved the problem. A big part of it was that I was frustrated, and because of that, missing the calm, cool logic which was needed to solve my problem.

ok,
I soldered a 10K in my cable, that is 16" long and has a chip clip on the end.
so the 10k is between the v+ and !MCLR? Is this correct?

Now, which ICD2 do you have, and how does the cable connect to it? Mine has the 6p6c modular (rj45?) style connector, which seems to me, not the greatest. The other end of the cable which I had problems with was a molex 6 pin female. It sounds like your cable is very similar in length to the one which gave me problems. Do you have a second cable you could try, or do you have the facilities to make one? (I have the tools, but they are already sent to Canada, and I'll be there in about two weeks. I could make and send you one then.)

You are also getting the same error I was with my long cable. I will find some links to where I posted my problems, and get back with these.

But can I ICD with I am using the pins PGC/D are hooked too?

It depends on what you have used them for. I have heard of problems when they are used for certain pins on LCDs or for driving LEDs. What are you using them for?
Having said this, I think I should tell you that I have rarely used mine as a debugger; I usually use it as a programmer. In this case, I think you should first get it to program the chip, and once that is working, tackle the debugging. I also think it would be quite helpful to reduce everything to the simplest case, get that working, then step ahead. (Ha, ha, no pun intended.)

Why don't we just try a simple flash one LED on one pin, with the 628A, using the internal oscillator, programmed with the ICD2. Once we can get that going, then let's move on. O.K?

Now I have to go back and re-read your other posts, and look at the pictures you posted. I'll be back right away.
 
OK, that second post, the error of not finding the right target, usually comes up when there is a problem on the PGD and or PGC pins. If the error relates to power, it is usually the !MCLR or v+, v- pins which are the culprits. I think I already asked how these are connected, oh wait. Are you just going to program the chip with a clip, or is it in a circuit?
 
Well, I hate to say it, but the time I have wasted AGAIN, I should have done it in Microchip assembler (I did the last project 12F509 in ASM it was not that bad and NO ICD2 at that time).

That is all perspective. Once you get past this you may start to view the time as learning, rather than waste.

Assembly is not bad at all, and what I like is that it helps me understand the chip. Why not just try the simple LED flash with assembly, so we can get your programmer working?

The last two ports in the last two PICBASICs (yes, I will name names. Mikrobasic and Mbasic) do not generate Microchip ASM files. So I can not
go on with the code and ICD2.

I didn't know that, do they use a different assembler, or none at all? Although they don't put out assembler, you could still build a hex file, and import that into MP Lab, and use the ICD2 to load your chip. Do they output files which can be used in MP Sim. These used to be .coff but I think now the format is .cod? If they don't, then you can't simulate them in MP Lab. I think tools which don't do this are not worth buying, myself.

Now I'm not an expert on, or even a user of basic, but I have heard people rant about proton+, perhaps that one is worth looking into.

I'm off to find you some links.
best wishes,
Robert
 
OK,
I will post the links I found on SparkFun, starting with my own problems, then some others which may, or may not be helpful. I wish some others would jump in here. Phalanx, I think, is an expert on these things. (Bill, are you around?)

**broken link removed**

**broken link removed**

**broken link removed**

**broken link removed**

**broken link removed**

**broken link removed**

These are just a few I came across, without a search, and they all relate in some way.

I'll keep my eyes open, but I do need to hear the details of how your chip is hooked up.

Talk to you later.
 

It is in the circuit. I did not try just a chip alone in the clip yet.

Sorry I sounded like I did, I think working through too many unknowns and it got me down.
 
BeeBop said:
Assembly is not bad at all, and what I like is that it helps me understand the chip. Why not just try the simple LED flash with assembly, so we can get your programmer working?

I think you are right. I will get a new chip, drop it in a breadboard with resistor and LED, and make sure the programmer works via my chip clip connector. I want to use the internal OSC as well. Will see if I can get that far. Then I will move back to my project.


They use a different assembler. So one more issue that made me throw my hands in the air. I think the LED flash in assembler is the way to go as you said. See if the debugger and programmer side are working. Then I will re-write the project in assember and use MPLABs and be done with it.

Now I'm not an expert on, or even a user of basic, but I have heard people rant about proton+, perhaps that one is worth looking into.

I looked into Proton+ after I found it. But by then the budget was lowered on some bad picks. But it appears to be the one.
 
Hi,
I looked into Proton+ after I found it. But by then the budget was lowered on some bad picks. But it appears to be the one.
Oh, I hate it when that happens. Then I end up waiting until I can get the one I should have bought in the first place. It usually happens to me when I'm trying to save a couple of bux, and by now, I should have learned, but....

Keep me posted. I'm going to have a look and see if I have another 628a, so I can try the same. I don't think I have one here, but I'm planning to go into the city on Saturday to grab a bunch of stuff while I still can. I have only two days left on which I can do this, so I'm going to try to stock up on the things which are cheap here, but expensive on the net. (Header pins, perhaps some character LCDs, and resistors, capacitors, 74xx chips.) I can take them back without duty, as I will say they are part of my lab which are used. (I hope!)
 
Oh so you are coming back that soon. Wow.

Yea, tonight, time allowing, I will clip just the chip on a breadboard and drop and LED and power from the ICD2.. Now can I use the internal OSC with the ICD2 right? Can I still program it?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…