View previous topic :: View next topic |
Author |
Message |
chAli
Joined: 14 Oct 2005 Posts: 4
|
PIC C or ICD2 Issue? |
Posted: Thu Nov 03, 2005 10:53 pm |
|
|
I've been having issues programming PICs with my ICD2 lately. I've been using the PIC16F877A with huge successes for the last few months, but have decided to re-write my code, and use a 16F737. When I compiled the code, it ran well - but when I tried to program the chip - it failed.
I tried several 16F737 chips with no success.
Here's the weird part (to me, anyway): When I 'read' the chip (from MPLAB 7.21) and then program it - it works fine, but the program doesn't actually work when I run my circuit. Very strange.
At first I thought it may just be an anomoly with this type of chip, but when i attempt to program ANY other chip (besides the 87xA's) it fails (but can 'connect' and 'verify' these chips).
I'm still pretty new to this stuff, and PIC C has been great at getting me started pretty fast - but has anyone else encountered these issues?
Is this PIC C related, or ICD2 related?
Are there any known problems with PIC C and MPLab V7.21?
Are there any known 'bugs' with the 16f73 and PIC C v3.222?
Oh - the hard/software I'm using is listed below:
Hardware:
- ICD2
- Universal Programming Module
Software:
- CCS PIC C (v3.222)
- MPLab (v7.21)
PS. I'm guessing that the first suggestion will be to check my connections on the Universal Programming Module - but, trust me, I've done that many times! |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 03, 2005 11:25 pm |
|
|
Post a small program that shows the problem. If you can post something
as simple as an LED flashing program or a Hello World program that
doesn't work, that would be best. Be sure to post all #include, #fuses,
and #use statements. |
|
![](templates/subSilver/images/spacer.gif) |
chAli
Joined: 14 Oct 2005 Posts: 4
|
|
Posted: Fri Nov 04, 2005 2:13 pm |
|
|
Well ... looks like I've 'solved' this problem on my own. I've decided to include a detailed explanation to (hopefully) make some people laugh.
So I've been using PIC C (version mentioned above) for a few months and have got off to a great start with the PIC16F877A. My circuit uses the ADC, PWM, and digital I/O really well - and has really gotten our project team off the groud very fast. (Thank you CCS!)
When we analyzed our power consumption, as well as PCB real-estate, the shift to a 28 pin PIC16F737 looked like a good idea. We could move from a 40 pin chip to a 28 pin chip, and were offered an 'extra' PWM channel.
Great.
So I ordered a few 16F737's, and when I received them - the program (that compiled perfectly) would not program the chip successfully. There were always (not so?) random failures.
It should be noted that I am using the Microchip ICD2 with the Universal Programming Module and programming over a USB interface.
So - here is an insight into my moment of discovery (aside: 1.5 months has elapsed since the first failed programming attempt): I had a look at the ICD2 'poster', as most junior programmers are directed, and it turns out that you need to plug in the AC wall power AND the USB to make it work. Who knew?
Oh ... everyone except me.
So the end result is the fact that I'm a bit of an idiot. But hey - everything works great now. The program migrated really well, and we had no issues upon preliminary testing.
Thanks for all the prompt responses to posts on this forum - it continues to be a HUGE asset to anyone programming PICs with PIC C.
Thanks, |
|
![](templates/subSilver/images/spacer.gif) |
chAli
Joined: 14 Oct 2005 Posts: 4
|
|
Posted: Fri Nov 04, 2005 2:17 pm |
|
|
One more thing ...
A very interesting note that comes out of this is the fact that I successfully programmed (and tested) multiple programs on the PIC16F877A and the PIC16F88 with no programming failures without the thing plugged in.
I think that's pretty interesting.
Also of note: If you don't have the ICD2 plugged into the wall, and program over USB, you can 'read' a chip and then program it - and it works fine. I'm guessing this is because of loading different memory addresses, but I still think it's a bit weird (and slightly useless because the programs don't actually work in circuit).
Anyway - that's (hopefully) it for this thread. Sorry for any wasted time.
Cheers,
C |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Nov 04, 2005 3:37 pm |
|
|
I don't have any of the problems you describe because I always use
self-powered boards. My PIC boards always run from a battery or a
"wall wart" power supply. I never power them from the ICD2 (either
through USB power or the external Microchip "brick" power supply). |
|
![](templates/subSilver/images/spacer.gif) |
PIC'n' My Nose Guest
|
|
Posted: Tue Dec 06, 2005 12:06 pm |
|
|
The power supply inside the ICD-2 is marginal at best.
It has a very limited output current.
It's fine for programming a single chip usually but not for powering much more.
I always use an external power supply to eliminate any odd behavior due to inadequite power supply stability.
Also note that even with the external wallwort power supply on the ICD-2 it can and will overheat if too much power is consumed.
Good luck and have fun PIC'n' |
|
![](templates/subSilver/images/spacer.gif) |
|