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.

General ICD2 questions

Status
Not open for further replies.
Now can I use the internal OSC with the ICD2 right? Can I still program it?
Yes, I have done that, it shouldn't be a problem. I'm not sure about debugging it that way, but for sure you can program it.

If you can, though, it would be best to power it seperate, with its own supply.

Yes, I'm coming back that soon. I was hoping to travel a bit first, but I'll have to do that another way. It isn't the best time to travel South East Asia, though. There are still monsoons in a lot of places, although I think a lot of China would have excellent weather at this time of year.
 
Yea, we just started hurricane season here.. The stress kills ya after the last two years we had here is Florida.. But a great place otherwise. Too bad my RV is leaving for football season in a coulpe weeks. You could come here, I feed ya, you play on the beach, fish boat all day and show me how to make this dang thing work :D.. I think my issue is, I love the internal OSC, Atmel spoiled me to death (every project I ever did work except one with the Tiny11, why I went to see how the pics are now). Also, changing chips with no major code changes.

I have to get used to a couple PIC I like and stick with them. I picked the 628a, 629 and 675 as my first ones. Already did a project with 12f509 and it was not bad.. No ICD2 and external OSC 32.8Khz.

So far tonight. I have the pic, powered by the ICD2, LED (portb.1), and program done (stole it from Nigel and change a couple lines to make is "A").

I think I am gonna have to dig up some caps and xtal. I have lots of 4Mhz xtals so not a big deal to see it work.

I will delete the attachment later to free space for electrotech, but here is the shot.
 

Attachments

  • new19.jpg
    new19.jpg
    106.7 KB · Views: 145
Oh boy, you guys have sure had your share in the last couple of years. No doubt it raises the stress level!

Ha, if I came there I'd have to feed myself, so I could get you to show me how to do the AVRs. :)

Looks like you are still trying to debug? I have come up against that error, but can't for the life of me remember how it got solved. Can you just write the program to the PIC? I'd try it with the internal osc. first.

I have to get used to a couple PIC I like and stick with them.
That is good advice. I'm all over the place with PICs, but that seems to be working for me. BUT, I also have some AVRs which I have only done a couple of things with, but am able to get working. Also have a couple of the Phillips LPC ARM7 boards, but all I could get going was flash a led stuff. I put those on the shelf for now because they were just a bit beyond me for now. Perhaps I need to increase my shmart supply to use them. :D
 
BeeBop said:
Oh boy, you guys have sure had your share in the last couple of years. No doubt it raises the stress level!

Ha, if I came there I'd have to feed myself, so I could get you to show me how to do the AVRs. :)
AVRs are great.. I only left them because I bought some old Tiny11, and I have their products (no clone) and could not get a response on the programmer not working on the high voltage parallel programming. It was a mistake buying that chip. But figure lets go back and look at the PIC, now, hundreds of dollars gone, and still looking at assember and I can not blink an LED. heheheh..

Looks like you are still trying to debug? I have come up against that error, but can't for the life of me remember how it got solved. Can you just write the program to the PIC? I'd try it with the internal osc. first.
I did that hoping to power via ICD2. Did not fly so getting 5DCV supply out. Now I still have that 10K tacked in the MCLK/VPP, but it programs fine.

I did see in programming download ICD2 OS, and thought. DUH, but need that to play. It download that fine, went back to IDC and no pullup on the MCLR on breadboard (need to add that, that was always my problem with the pics).

But I still get

ICDWarn0020: Invalid target device id (expected=0x89, read=0x83) same thing.

Will program it via ICD programmer and drop 5V on and see if it blinks. That would at least be a step forward. The ICD2 has not been a lot of fun. I am building and inchworm as well. But maybe I will stop for a bit. :) I am used to burn/try-it and when I worked at it for a living way back the ICE machines were great. But this is a pain. I tried to pull the manuals and Abobe locks up.. Grrrrr.

That is good advice. I'm all over the place with PICs, but that seems to be working for me. BUT, I also have some AVRs which I have only done a couple of things with, but am able to get working. Also have a couple of the Phillips LPC ARM7 boards, but all I could get going was flash a led stuff. I put those on the shelf for now because they were just a bit beyond me for now. Perhaps I need to increase my shmart supply to use them. :D

:p I think that might be my problem too. Not enough time to try them all, and not enough time to read all the manuals.
 
Good news. I can program it in circuit and reset and release, so that beat up and down. One of my knees are shot from a hurricane/ladder thing.. So that is a plus. And running on internal OSC.

I think I can pull the 10K from the clip and just add them to my circuits, otherwise I think that will get me like the 16F84 days..

Bad news. Can not ICD with internal OSC, or there is something I am missing or it is broke. I would think if it programs it is not broke, only 5 wires going to it.

It keeps giving me the ID missmatch, also tells me code in chip does not match when I try to F8 (step over). I did try to download the OS to it in program, then tried ICD. I will go look for a ICD2 starters manual that will not break Adobe now.
 
O.K., just to check on my understanding -
I did that hoping to power via ICD2. Did not fly so getting 5DCV supply out. Now I still have that 10K tacked in the MCLK/VPP, but it programs fine.

I did see in programming download ICD2 OS, and thought. DUH, but need that to play. It download that fine, went back to IDC and no pullup on the MCLR on breadboard (need to add that, that was always my problem with the pics).

But I still get

ICDWarn0020: Invalid target device id (expected=0x89, read=0x83) same thing.

So the thing programmed when you tried the ICD2 in program mode, but couldn't read the target when you tried it as a debugger?

If that is the case, then for sure your cable is fine, and the problem is either the fact you are trying to debug, OR the lack of a pull up on !MCLR. So try adding the pull up and see what happens. If it works, then that is the only thing. (although you should be able to do this without the resistor)

I'm getting very close to time to go to work, and I see you made another post since I loaded my reply.

Adobe has given me lots of grrr too.

Bad news. Can not ICD with internal OSC, or there is something I am missing or it is broke.

I think it's something you (and I) are missing. It would be a good idea, too, to check on Microchip forums. I'm sure this is talked about there.

I'll try to look at the docs too, but it might be a while before I'm back.
 
What do you have on RB6 & RB7?

What about MCLR? I usually use 10K-22K with a 1N4148. Some omit the diode but it'll draw slightly more current from VPP when programming.

PS I really pooched Q4 on the PCB layout I sent you, make sure to get all the pins going to the right places. I had it pretty much turned around, check the current rev E schematic (now on my site)
 
Beebop. Sorry, went to play basketball with the kids.

Will try the pullup, that was the killer in the old (F84) days. Also, my cable, I made is 18" long.. Could that be it. All the links you sent, they were talking 4" cables.

Thanks for all the help..
 
William At MyBlueRoom said:
What do you have on RB6 & RB7?

6=PGC and 7=PGD (I hot glued the connectors to a chip clip). I am going to convert it to pin clips later so I am not locked to a certain PIC, but pretty sure that is what I did (I can ohm it out). If they are backwards will it program a chip? It does that for sure. I still have the LED blinking. Might drag the target back out.

What about MCLR? I usually use 10K-22K with a 1N4148. Some omit the diode but it'll draw slightly more current from VPP when programming.

On my breadboard test circuit (target board is parked now) I have nothing, but on the ICD cable, I put a 10K VPP to VCC (VDD). But I will add it to all circuits from now on. I did not add the diode on the cable.

PS I really pooched Q4 on the PCB layout I sent you, make sure to get all the pins going to the right places. I had it pretty much turned around, check the current rev E schematic (now on my site)

Will pull it rev E and probably redo the board. I want to try transparancy paper over photo paper this weekend. I used sockets for chips so I can pull them. I got all the transistors right. But my drill bit ripped up the pads so bad. I was bridging solder to leads.. I was gonna do the new one anyway. OR wait for a blue board to be honest. That sounded cool. Or purple:D
 
Hi,
What about MCLR? I usually use 10K-22K with a 1N4148. Some omit the diode but it'll draw slightly more current from VPP when programming.
I never use the diode because Microchip recommends not to, yet many users do this with success. I have heard that a weaker pullup (>10k) works better, but have always gotten the 10k to work.
Will try the pullup, that was the killer in the old (F84) days. Also, my cable, I made is 18" long.. Could that be it. All the links you sent, they were talking 4" cables.
The cable seems to be a touchy thing, and I think it is the weak part of the ICD2, myself. The cable which came with my ICD2 had about the same length as yours, and worked fine for most boards, however, on some boards it didn't. The short cable I made (~4 inches) works well on all of them. But then, your cable programmed the chip, so I would think it should be O.K.

6=PGC and 7=PGD (I hot glued the connectors to a chip clip). I am going to convert it to pin clips later so I am not locked to a certain PIC, but pretty sure that is what I did (I can ohm it out). If they are backwards will it program a chip?

Well, PGC is Programming Clock, and PGD is Programming Data, so that should give the answer you need here. It would probably program, but incorrectly.
Perhaps you do have them backwards? I'm thinking of this ->
It keeps giving me the ID missmatch, also tells me code in chip does not match when I try to F8 (step over).

Microchip says NO CAPACITORS on PGD or PGC - they will prevent fast transitions on the data and clock lines during programming and debug.
They also say NO PULLUPS on PGD or PGC - they will divide the voltage levels since the ICD2 has pulldowns (4.7k) on both pins.

William, I am waiting until I get back to Canada to try out your ICD2. Nice looking board, and very kind of you to provide. In fact as far as boards and schematics go, your site offers great resources. The twisted assembler is grrr, well I can develop source myself if I want to do... :) The problem I always had with making PCBs was in the drilling. I always seemed to mangle the thing when drilling. Looks like I'm not the only one! :D

Mramos, I enjoy helping, or trying to; all too often I have been drawn into crappy, negative, and counter productive diatribes on this board, which make me feel awful about myself, and humans in general. Focusing on electronics, and those problems, is joy, even in the most frustrating times. Life is too short to spend time being angry about that over which I have no control. :D

O.K. I have a bit of a break, so I'm going to read up all I can on debugging.
 
Last edited:
Hmmm,
I just read this on Microchip forums:
With PIC16F627A/628A/648A devices, it is mandatory that RA1 (pin 20 on 16F627A) is tied to GND (0V) during programming. The Mid-range reference manual for PIC devices (this can be found on the microchip website) suggests this in the chapter on In circuit serial programming (ICSP). However, it is an easily unseen suggestion when browsing through the manual, and after a couple of weeks wondering why my target device could not be validated, I have finally tied the RA1 pin low and what-do-ya-know... it works. Keep this in mind is ICDWarn0020 or ICDWarn0052 appears when trying to program/connect to the device...

and also:
If you can connect and program, but can't debug - suspect PIC oscillator -gets me every time!
If you can connect but can't even progam - suspect cable. I've spent hours and hours messing with cables to get ICD2 to work (but I don't now!). A good reference is Olin Lathrops ICSP article.
 
Last edited:
Beebop: You were a lot of help and all the links, I see I am not the only one :). And Bill and Mike K8LH are great ICD guys too.

You are gonna have fun getting back on EST when you return :p

Last night adventures ended at. I am sure Data and Clock are right. As I can blink the LED, and I added a delay and put the uC in reset, burn new delay, and release and it blinks away at the new speed. So will assume cable is fine and the board is fine. But I get that weird ID when it go in debug. It must be the internal clock, but I will keep tring. If nothing else the ISP was worth all the work.

I might cut the cable in 1/2 and try that tonight.
 
Last edited:
BeeBop

Just read your last post. Yea. I think it is the internal OSC. That sort of stinks. But hey, I can program away without the screw driver to pop the chip out all the time. Or write 100% working code. haha.

The weird chip ID not matching just confuses me. I will add the caps and xtal back in and see if I can at least blink the LED in debug so I know the ICD it working 100%.. But it programs in-circuit great. And I will still cut the cable down, it is way to long. When I made it that seemed like a great length.
 
mramos1 said:
Well, this link explains it all I guess. The ICD-2 will not debug the 16F628A without some header adapter.. This also explains why the external osc did not work either.. I seem to buy chips that I can not use. Tiny11, not 628A. Someone said use the F88.. At least I know the deal now.

http://forum.microchip.com/tm.aspx?m=83169&mpage=1&key=&#83497
Ah yes, there is a "Special" debug version of the 628A that comes with the connector. The standard 628A does not have the debug mode. The 16F88 87x and most 18F do have the debug stuff.

I found out the hard way too. :(

Here's a sneak peak at the Cricket Pro. The expansion connector is also for the ICD2 mode. It's not a complete schematic yet...
 

Attachments

  • Cricket Beta Pro.gif
    Cricket Beta Pro.gif
    30.2 KB · Views: 174
Last edited:
Whoops, guess I didn't dig deep enough. :eek:

Then I'm just going to buy F88 chips when I go to town. :D

Glad that the problem is solved!

Now I'm going to take another look at that schematic William just posted...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top