Need help / verification error and invalid target id warning PIC16F877


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2013
    Posts
    2

    Default Need help / verification error and invalid target id warning PIC16F877

    Hi, I am a university student and I am trying to go over some tutorials that were given to me by my supervisor and I am encountering some strange errors. It should be noted that this is my first time I am attempting PIC programming so all I know for sure is that I am following the tutorial step by step so it is pretty clear to me that something is happening that was not suppose to happen.
    I am using MPLAB IDE v.7.4 and MPLAB ICD2 as the controller. My PIC16F877 is connected onto a PIC board which has a 20MHZ crystal a MAX232 and is connected onto the controller using an RJ11 connector. The PIC is powered by an external adaptor of 5V/1A and there are also 8 LEDs onto all B pins.
    The code I am using is a basic LED counting test:

    //LED counting test.c
    #include<16F877.H>
    #pragma fuses HS,NOWDT,NOPROTECT,NOLVP
    #pragma use delay(clock=20000000)

    void main()
    {
    int value;
    set_tris_b(0x00);
    for(value=0; value<=60; value++)
    {
    OUTPUT_B(value);
    delay_ms(1000000);
    }
    }

    MPLAB gives me a warning and an error

    Warning:
    ICDWarn0020: Invalid target device id (expected=0x4D, read=0x1FF)
    Error:

    ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x3000, Val Read = 0x3FFF)

    I’ve been looking around through the internet for similar topics but I can’t seem to figure out what’s wrong. What got me really confused is the fact that I bought a new PIC just to try and see if it got fried, and the first time I tried to program it, it worked. But the weird thing is after being programmed once it started the same problems as the previous PIC.
    I also tried to set the memory locations as manual like some forums suggested but nothing changed.

    The Self test numbers are:
    Target Vdd: 5.04
    Target Vpp:12.46
    MPLAB ICD 2 Vpp:12.54

    And additional info:
    Oscillator HS
    Watchdog timer OFF
    Power Up timer OFF
    Brown Out detect ON
    Low Voltage Program DISABLED
    Flash Program write ENABLED
    Data EE read protect OFF
    Code Protect OFF
    Thanking you in advance,
    Kyriacos Makris

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: Need help / verification error and invalid target id warning PIC16F877

    Hi,
    Have you selected the correct target device in the MPLAB IDE?
    Name:  Select device.png
Views: 715
Size:  24.8 KB

    If you have then it sounds to me like a problem with the communications between the device and the ICD2. But I don't have any experience with the ICD2 debugger/programmer...

    /Henrik.

  3. #3
    Join Date
    Jan 2013
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Need help / verification error and invalid target id warning PIC16F877

    yes it is the right device.
    If thats the case,then what are possibilities that can make that go wrong?What do i need to do?

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: Need help / verification error and invalid target id warning PIC16F877

    Possible causes....
    Faulty ICD2
    Faulty or wrong cable between target board and ICD2
    Problem with the powersupply on the target board
    Target board contains circuitry that prevents the ICD2 from functioning:

    Name:  ICD2.png
Views: 1783
Size:  80.3 KB

    Make sure you read and understand the section in the ICD2 manual that covers the hardware connections. There's also a complete chapter on troubleshooting which I suggest you read.

    Apart from that I'm afraid I can't help much since I don't have an ICD2 myself. Since you have a supervisor perhaps you could consult him/her.

    /Henrik.

Similar Threads

  1. Warning & Error Messages
    By cc1984 in forum Forum Requests
    Replies: 16
    Last Post: - 23rd May 2011, 16:09
  2. Warning (and other Compilation Error) Messages
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 6
    Last Post: - 9th September 2009, 01:29
  3. Error[126] & Warning[220]
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 12:48
  4. ICDWarn0020: Invalid target device id
    By pravec065 in forum General
    Replies: 3
    Last Post: - 4th August 2008, 13:43
  5. Replies: 8
    Last Post: - 24th April 2008, 22:19

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