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

ICD-U as a programmer
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go
View previous topic :: View next topic  
Author Message
Guest
Guest







ICD-U as a programmer
PostPosted: Sun Jan 30, 2005 5:46 pm     Reply with quote

I just purchased a ICD-U for use as a programmer... the price was right as it was discounted....

I can read and write HEX files to my target hardware (homebrew) with a PIC16F876 but when I swap that chip for a PIC18F252 (which should be pin for pin compatible) the download (obviously with a different HEX file) fails with verification errors. Any ideas? (I have a 20MHz ceramic resonator).

I have a custom cable.. I actually took the supplied cable and chopped it in half and bared the wires... I have B6, B7, MCLR, Vdd and Vss wired. B3 connection is floating at ICD-U and is tied to an LCD display on the target.

Should this work?

Thanks,
Gavin
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Jan 30, 2005 6:00 pm     Reply with quote

Not sure about the ICD-U but with my ICD-S20 you need to reprogram the PIC inside the programmer with slightly different code depending on if your target is in the PIC16 or PIC18 family.

Check your ICD-U documentation for information about target firmware changes.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Guest








PostPosted: Mon Jan 31, 2005 7:11 am     Reply with quote

The firmware seems to suggest it works for both PIC16 and PIC18?

I unplugged the LCD but still the same issue.

I wonder if it is a hardware issue... I had a previously programmed 16F876 in the socket connected to a 20MHz Ceramic Resonator. I have just swapped the 16F876 for a new 18F252. Should a blank 18F252 be able to work in that configuration? It is working to some extent since the ICD recognised it to be an 18F252.

I presume the voltage levels are the same as before... re-programming the 16F876 worked fine.

Regards,
Gavin
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon Jan 31, 2005 8:49 am     Reply with quote

One other thing, make sure you are NOT trying to use the LVP (low voltage programming) feature on the PIC18F. Use the #fuse directive "NOLVP".
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
A different guest
Guest







ICDU as a programmer
PostPosted: Mon Jan 31, 2005 10:00 am     Reply with quote

Gavin -

I did exactly the same thing as you, except I moved up to a "18F452" part. I also used to use an ancient rev. of MPLAB (5.6???) and a serial port ICD unit. Anyway, I yanked out the 16F877 and replaced it with an 18F452, and it worked - once I had the fuses worked out as rwyoung mentioned.

Once in a while after programming a part and checking the fuses, they ARE NOT set exactly as the ASM listing or C source code #fuse statements. I don't understand this.

Good luck,
Bill
Guest








PostPosted: Mon Jan 31, 2005 5:09 pm     Reply with quote

Thanks but I still can't get it to work...

I think I have the connector wired correctly but perhaps I have it back to front... for the ICD to recognise the chip as 18F252 does this imply that at leave B6 and B7 are wired correctly??
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

ICD header pinout
PostPosted: Mon Jan 31, 2005 5:39 pm     Reply with quote

I always use this as my spec. As it comes from microchip.
page 11 or 7 depending on how you look at it.
http://ww1.microchip.com/downloads/en/DeviceDoc/51331a.pdf

It also has a good section on what NOT to do.
Guest








PostPosted: Tue Feb 01, 2005 8:18 am     Reply with quote

Still no joy... I guess I need to swap the part out... perhaps I have a dodgy one.

Incidentally I do have a pull-up R on MCLR; my value is 100k a bit bigger than the 47k mentioned.... I am assuming my larger value is fine.

Regards,
Gavin
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 01, 2005 8:57 am     Reply with quote

You are still just trying to get the two to talk.
Follow the instructions on page 12.
Use a 1k to 10k pullup from mclr to Vdd.
and double check your wireing.
I don't think your part is bad.

You can find Vss (that is ground) by checking continuity from the metal shield of the USB conector on ICD-U40 to the the phone cable wires. When you find Vss(ground) then you can figure out which is pin 1 and then you can wire the header!

1.Vpp/MCLR bar
2.Vdd
3.Vss(ground)
4.PGD
5.PGC
6.

See how Vss is 3rd one over from pin 1.
Then check that these wire are going to the correct PIC pins.
Guest








PostPosted: Tue Feb 01, 2005 11:44 am     Reply with quote

The wiring is probably right... it works perfectly with a 16F876 in the slot

Might be the value of R and different tolerances in the 18F252?
Guest








PostPosted: Thu Feb 03, 2005 4:53 pm     Reply with quote

Well I did some measuring with my voltmeter (I don't have a scope)

With the circuit disconnected from the ICD...

I see 4v96 on Vdd and I measure 100kOhms between Vdd and MCLR

When I connect the circuit to the ICD...

During programming I see 12v58 on Vpp

Using the PIC18 Interface Test Buttons in ICD gives...

Vpp 12v58
Vdd 3v933
Vss 0v107

I don't understand why the ICD is pulling my well regulated 4v96 down to 3v933

My target chip is PIC 18F252-I/SP

Any clues in any of that?

Thanks in advance,
Gavin
Guest








PostPosted: Sun Feb 06, 2005 5:38 am     Reply with quote

I'm on the point of giving up...

It works fine with 16F876 but will not operate correctly with 18F252...

It must be due to my hardware...

Incidentally my clock is a 20MHz ceramic 3 pin resonator...
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 06, 2005 1:12 pm     Reply with quote

I think your Vdd is too low for 5V programming of the PIC18F parts.

1) How are you generating the Vdd?
2) Are you using the PGD, PGC, PGM pins for other tasks?
3) What other hardware is being controlled by the PIC? If its I/O pins are in some unknown state, can that hardware draw too much current from the Vdd rail?
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Guest








PostPosted: Tue Feb 08, 2005 4:08 am     Reply with quote

The circuit uses a simple voltage regulator to get 4v96 on Vdd

However I do see Vdd fall to 3v933 when programming.

I wonder if some external components are causing a drain during the programming process... if not it is the ICD that is pulling the voltage down...

Is there a way of reducing the load put on my circuit due to the ICD?

I guess my only other option is to start looking at out of circuit programming... rather defeats the point of the ICD.

Regards,
Gavin

PS

The circuit I am programming is a PICPAC, its schematic is on the www.byonics.com website.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

picpac ICD is not standard.
PostPosted: Tue Feb 08, 2005 8:33 am     Reply with quote

Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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