CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC C or ICD2 Issue?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chAli



Joined: 14 Oct 2005
Posts: 4

View user's profile Send private message

PIC C or ICD2 Issue?
PostPosted: Thu Nov 03, 2005 10:53 pm     Reply with quote

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!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 03, 2005 11:25 pm     Reply with quote

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.
chAli



Joined: 14 Oct 2005
Posts: 4

View user's profile Send private message

PostPosted: Fri Nov 04, 2005 2:13 pm     Reply with quote

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,
chAli



Joined: 14 Oct 2005
Posts: 4

View user's profile Send private message

PostPosted: Fri Nov 04, 2005 2:17 pm     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 04, 2005 3:37 pm     Reply with quote

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).
PIC'n' My Nose
Guest







PostPosted: Tue Dec 06, 2005 12:06 pm     Reply with quote

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'
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group