View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
ICD-U as a programmer |
Posted: Sun Jan 30, 2005 5:46 pm |
|
|
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
|
|
Posted: Sun Jan 30, 2005 6:00 pm |
|
|
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
|
|
Posted: Mon Jan 31, 2005 7:11 am |
|
|
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
|
|
Posted: Mon Jan 31, 2005 8:49 am |
|
|
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 |
Posted: Mon Jan 31, 2005 10:00 am |
|
|
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
|
|
Posted: Mon Jan 31, 2005 5:09 pm |
|
|
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
|
|
|
Guest
|
|
Posted: Tue Feb 01, 2005 8:18 am |
|
|
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
|
|
Posted: Tue Feb 01, 2005 8:57 am |
|
|
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
|
|
Posted: Tue Feb 01, 2005 11:44 am |
|
|
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
|
|
Posted: Thu Feb 03, 2005 4:53 pm |
|
|
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
|
|
Posted: Sun Feb 06, 2005 5:38 am |
|
|
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
|
|
Posted: Sun Feb 06, 2005 1:12 pm |
|
|
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
|
|
Posted: Tue Feb 08, 2005 4:08 am |
|
|
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
|
picpac ICD is not standard. |
Posted: Tue Feb 08, 2005 8:33 am |
|
|
|
|
|
|