I'm at a loss


Closed Thread
Results 1 to 17 of 17

Thread: I'm at a loss

  1. #1
    Join Date
    Jan 2010
    Posts
    88

    Default I'm at a loss

    Hello,

    OK, can't seem to figure this one out. I have a PIC16F628A that I have written code for. I try to program it and I get this, "Target Device does not match selected device". Now, the funny part is this...I have the microcontroller device ID entered correctly, as well as the ICSP pins connected correctly.

    When I've made a mistake in the past on other chips and clicked program, the above message occurred immediately. What's happening now is the status bar runs about 3 times and then I get the message. It looks like it's going to program, but then it fails. Any thoughts? It's not my programmer because it'll program other chips, but as soon as I try to program the 628A, it fails after 3 status bar sweeps. Thoughts?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Please post your code & a picture of MCS if you can. I will assume you have selected the appropriate PIC in MCS, yes?
    Are you using MCS Plus? Does it support ICD for that chip?
    Last edited by Archangel; - 10th November 2013 at 04:45.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Hmm, you usually get that message immediately not after three sweeps. Is that message showing when the programmer is doing the verification? Try to use programming only without verification. Are you using the diode in the Vpp chip pin?
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    If you are programming in system, try doing it with the target power turned on. Maybe the PICKIT is unable to support the current drain. I've seen similar, but only when powered by the PICKIT-II or III. If you're programming the chip stand-alone, I don't know. Maybe a short video showing the problem will help diagnosis.

  5. #5
    Join Date
    Jun 2004
    Location
    Michigan
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Sounds like you have some capacitance on one of the programming lines delaying a signal.
    Chuck Hellebuyck
    Electronic Products
    http://www.elproducts.com
    [email protected]

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Quote Originally Posted by ERMEGM View Post
    Hello,

    OK, can't seem to figure this one out. I have a PIC16F628A that I have written code for. I try to program it and I get this, "Target Device does not match selected device". Now, the funny part is this...I have the microcontroller device ID entered correctly, as well as the ICSP pins connected correctly.

    When I've made a mistake in the past on other chips and clicked program, the above message occurred immediately. What's happening now is the status bar runs about 3 times and then I get the message. It looks like it's going to program, but then it fails. Any thoughts? It's not my programmer because it'll program other chips, but as soon as I try to program the 628A, it fails after 3 status bar sweeps. Thoughts?
    I always get such a message when I forget to enable power to the target with my PK2 or 3 ...

    moreover, the Pickit current capacity is limited ... sooo, couldn't your board draw too much current ??? ( as you talk about ICSP ...)

    and in the end, I remember a Microchip errata sheet about this subject for some series of those programmers ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    I'm not familiar with the Pickit but I have gotten a similar message when I haven't properly isolated the programming pins. I usually put a switch in the circuit to disconnect the rest of the circuit. If you look in the manual it recommends some minimum values when connecting your circuit.

  8. #8
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Thanks for the replies guys, but I am not using a Pickit. I have setup my boards to match the pin layout of my U2 programmer. I just use a wire harness from the U2 to my boards. It's quick and easy that way.

    What I meant about the sweeps is the status bar indicator. It usually fills about 3 times and then it would fail.

    I don't know what the problem was, but I placed another 628A on another board and tried programming it. That worked. I removed the first PIC on the first board and replaced it with the second PIC. Tried to program the second PIC on the first board and it failed immediately, however, I found a very tiny solder joint between 2 pins and I removed it. Now it works fine.

    Don't know if something was wrong with the first PIC or if there was a tiny solder joint, but I'll have to play with that PIC later. Don't know why it would run through it's sequence and then fail.

    I'd post some code, but it's over 1000 lines. But with respect to errors in the code, the PIC would still be programmed with the faulty code and fail on run, not programming.

    And yes, the correct PIC was listed in both programs.

    Thanks again guys.

    Tony

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    I figure it can erase and program just fine with the solder jumper, but then fails on the verify. Most likely why you see the status bar fill a few times then fail.

    Robert
    AKA Captain Obvious

  10. #10
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    More likely it screws up the erase, and the programming as well, but doesn't know that until it tries to verify.

  11. #11
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    OK, back to square one. Here's what I have. Obviously there is some interference with the signals.

    My programming pins are connected to the appropriate terminals. RA5, RB6 and RB7 are being used, but they are being used as inputs, so they have a 10k pull-up resistor on them which gets pulled to ground when the tactile button is pressed (RA5), or the optocoupler is activated on the other pins (RB6 and 7).

    When I try programming my pic on the completed board, it fails. When I program it on the board with just the PIC and header pins, it programs just fine. Is one of the components causing the interference? Anyway to isolate this or just redesign the board to not use those pins other than for programming?

    Thanks,
    Tony

  12. #12


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    I don't know if its a typo but the 10k resistors on RB6 and RB7 are in series to isolate external circuitry. See 32028a, 91016b, 51474a etc.

    George

  13. #13
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    The 10k resistor is part of the pull up resistor of the optocoupler.It's a 5 volt supply through the 10k and then to rb 6. Same setup for rb7. Rb 6 and 7 are driven high, then pulled low when triggered. Standard setup.

    Should I apply power to the circuit when programming it, maybe?

  14. #14


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    circuit diagram?

  15. #15
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Quote Originally Posted by ERMEGM View Post
    The 10k resistor is part of the pull up resistor of the optocoupler.It's a 5 volt supply through the 10k and then to rb 6. Same setup for rb7. Rb 6 and 7 are driven high, then pulled low when triggered. Standard setup.

    Should I apply power to the circuit when programming it, maybe?
    Why don't you use the internal pull-ups in your chip? The following is from the melabs webpage

    http://melabs.com/support/icsp.htm

    From the website
    1. If possible, dedicate the Programming Clock and Data pins to ICSP. If you must also use these pins for other purposes on your board, some thought should be given to the type of hardware that is connected. The best case is to use the programming pins for normally-open, pushbutton inputs. As long as you don't push the buttons while programming, the switches won't affect things at all.

    If loads are connected to the clock and data lines, they must not interact with the clock and data signals. Capacitive loads will cause problems. High-impedance loads are usually ok. LEDs with current-limiting resistors are less desirable, but usually don't cause problems.

    You should always prototype and test the ICSP connections before sending your PCB design out for fabrication.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Well, I'm certain that the chip has to have power supplied during program and I'm certain you're going to have to pull the MCLR pin high or disable it for the chip to work.

    Since there really isn't a standard installation all bets are off as to what those pull ups will do. The pins have to change state to transfer data and the pull ups may prevent that from happening. I've taken to putting a switch to disconnect the rest of the circuit if I must use the ICSP pins for other purposes. An easy way to find out would be to unsolder the resistors and attempt programming. That would be the one way you'll know if that's the issue.

  17. #17
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: I'm at a loss

    Some boards isolate the 2 programming pins via jumpers while performing ICSP.

Similar Threads

  1. Power loss - Brown out?
    By clocks in forum General
    Replies: 5
    Last Post: - 25th October 2010, 10:56
  2. Strange pic 16f877a memory loss
    By DavyJones in forum General
    Replies: 23
    Last Post: - 6th July 2009, 20:27
  3. Memory Loss??
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th October 2006, 11:10
  4. 8 port Signal Loss Detector, possible to use a pic?
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2006, 15:59

Members who have read this thread : 0

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