Frustrated with 18F87J50


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default Frustrated with 18F87J50

    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.

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    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.

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    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.

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    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

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Christopher4187 View Post
    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.



    You must also have AVdd and AVss connected to VDD and Vss, even if your aren't using analog.
    DT

  6. #6
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    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?

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    Quote Originally Posted by Christopher4187 View Post
    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., 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.

    .
    Last edited by Darrel Taylor; - 31st March 2013 at 22:11.
    DT

  8. #8
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Frustrated with 18F87J50

    Darrel, if you were here I'd give you a big, fat kiss! 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!

Similar Threads

  1. HID USB on 18F87J50
    By pedja089 in forum USB
    Replies: 56
    Last Post: - 25th August 2011, 10:24
  2. Frustrated Modbus
    By shawn in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 2nd May 2011, 16:29
  3. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 15:26
  4. frustrated!!! HI ALL
    By jagger in forum General
    Replies: 7
    Last Post: - 2nd February 2008, 05:47
  5. 18F87J50 Success
    By GeoJoe in forum General
    Replies: 0
    Last Post: - 28th October 2007, 02:52

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts