View Full Version : Frustrated with 18F87J50
Christopher4187
- 31st March 2013, 15:24
I have the demo board and my program works just fine. I designed a circuit board and now I can't even get the damn thing to program. Forget blinking an LED! If I see "Target does not match selected device" one more time I will take a sledehammer to my computer!
I checked the voltage levels and they are roughly the same as the demo board.
I checked the VSS and VDD pins and all have 0V and 3.3V respectively.
The PCD and PGD lines are routed correctly and not shorted or connected to any other pin or ground.
I have the MCLR going from VDD to 12K ohm resistor and then to pin 9.
I've been trying to program this board for 3 days and I can't do it. I know it's hardware but I don't know what else to check. I've changed the PIC 3 times just to rule that out.
AvionicsMaster1
- 31st March 2013, 17:38
I'm assuming your trying to program the chip using ICSP. I'll also assume you're using the PGD and PCD lines for something in addition to ICSP. If you isolate those lines using a switch to disconnect them from your circuit during programming and then reconnect once programming is complete then ICSP should work. You could also switch the MCLR line if you wanted but I've found that is often unnecessary.
Something to try is put your PIC back into your demo board and see if it will program. If it does then I'm guessing your programming lines are loaded. In lieu of a schematic and/or code, that is my best but not only guess.
Christopher4187
- 31st March 2013, 18:05
Yup, trying to program using ICSP. I'm not using the PCD and PGD lines for anything other than ICSP. When you say switch the MCLR line, what do you mean?
I can put the PIC into the demo board but it was a PITA to solder on my circuit board. As far as minimums, you only need to power the VSS and VDD lines, as well as route the correct pins to PCD, PGD and MCLR.
In reference to the MCLR, I followed the Microchip schematic for the 18F87J50 demo board with a slight deviation. They have VDD---> 15K ohm--->820 ohm--->pin 9 (MCLR). The point between the two resistors has a 10nF cap to ground, which I believe is only for the switch to manually reset the PIC.
I have VDD----->12K ohm---->pin 9 (MCLR). I have a .1uF cap to ground at the MCLR input.
When I attempt to program the PIC, the MCLR line drops to ~.5VDC, which is just about the same as the demo board.
Jerson
- 31st March 2013, 18:27
Hi Christopher
I use the 18f85J90. My guess is you may have pin 12 tied to 3V3. VDDCore is a stand alone pin that is tied to a capacitor to smooth the internal core vdd.
Some fundamentals to check (I use a TQFP device)
RB6 (pin 52) is Clock PK3 pin 5
RB7 (pin 47) is Data PK3 pin 4
VDD (3V3) on pins 24,25,32,48,71 PK3 pin 2
GND (0V) on pins 11,31,51,70,26 PK3 pin 3
MCLR (pin 9) PK3 pin 1
Darrel Taylor
- 31st March 2013, 20:28
I have VDD----->12K ohm---->pin 9 (MCLR). I have a .1uF cap to ground at the MCLR input.
You should not have a CAP directly on the MCLR pin.
It interferes with the timing of the ICSP signals
The resistor you left out, isolates it from the MCLR pin.
Typically, all you need is a pull-up resistor, unless your VDD rise time is slow and it need to stay in reset longer.
You must tie the ENVREG pin to 3.3V to enable the on-board regulator. With a CAP on the Vcap pin.
http://support.melabs.com/DT/87J50_3V.gif
You must also have AVdd and AVss connected to VDD and Vss, even if your aren't using analog.
Christopher4187
- 31st March 2013, 20:45
Hey Jerson - long time no talk. Thanks for the tips. I'll try them out in a little bit.
Darrel - I didn't have the cap on the MCLR originally. If I understand you correctly, I can get rid of the cap and the smaller resistor and just use 12K ohm?
Regarding the AVdd and AVss pins, I didn't see anywhere in the datasheet where it states you have to have it connected even if you don't use the analog pins. I may have missed it but I didn't see it mentioned. I had first left it unconnected and then connected it after looking at the demo board schematic. This couldn't have damaged the PIC, could it have?
I see a "mistake" on my ENVREG pin. My brain must have been shut off last night!. I intended to tie the ENVREG pin to Vdd through a 1K ohm resistor. I tied it to the wrong side, which means it is actually tied into MCLR. Hmmmmm, I can see how that would cause serious problems with programming. As far as programming, does the ENVREG pin need to be set up correctly only to program?
Lastly, on my Vcap (pin 12) I have a .1uF ceramic cap to ground. Is this an issue?
Darrel Taylor
- 31st March 2013, 21:03
Darrel - I didn't have the cap on the MCLR originally. If I understand you correctly, I can get rid of the cap and the smaller resistor and just use 12K ohm?
Yes, the pull-up resistor is all you need.
Regarding the AVdd and AVss pins, I didn't see anywhere in the datasheet where it states you have to have it connected even if you don't use the analog pins. I may have missed it but I didn't see it mentioned.
Look in the Programming Spec (http://ww1.microchip.com/downloads/en/DeviceDoc/39644l.pdf)., Table 2-1 PIN DESCRIPTIONS (DURING PROGRAMMING):, Note 1: "All power supply and ground pins must be connected, including analog supplies (AVDD) and ground (AVSS)."
This couldn't have damaged the PIC, could it have?
Unlikey, but you never know.
Lastly, on my Vcap (pin 12) I have a .1uF ceramic cap to ground. Is this an issue?
Recommended Vcap is between 4.7 - 10uF.
See datasheet table 28-4: INTERNAL VOLTAGE REGULATOR SPECIFICATIONS
Added: Table 2-1 in the programming spec. also says VUSB should be tied to VDD during programming.
.
Christopher4187
- 31st March 2013, 21:21
Darrel, if you were here I'd give you a big, fat kiss! :eek: Ok, maybe not a kiss but......
The ENVREG pin and the MCLR pins were both problems. Fixed them both and it programmed on the first try. Thanks!
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.