PIC16f877A first 8 bytes destroyed after closing PicKit2 programmer app....


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2010
    Posts
    30

    Default PIC16f877A first 8 bytes destroyed after closing PicKit2 programmer app....

    Hello to the forum,

    Using PicKit2 i write/verify a hex file on 16F877A , all ok.

    I even load another file and back read the 877A and all still ok.

    BUT then i close the pickit application,
    when i re-open Pickit application and read the 877A the first 8 bytes are FF , the rest bytes are proper.

    My program has nothing to do with on-the-fly code-programming to overwrite the first 8 program memory bytes ...

    The program is (now only a simple port-toggle , problem is still happening ...)


    OPTION_REG.7 = 0 ; ENABLE PORTB PULLUPS

    LOOP:
    portb.0 = not portb.0
    GOTO LOOP
    Last edited by LakisFM1; - 8th February 2010 at 23:11.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LakisFM1 View Post
    Hello to the forum,

    Using PicKit2 i write/verify a hex file on 16F877A , all ok.

    I even load another file and back read the 877A and all still ok.

    BUT then i close the pickit application,
    when i re-open Pickit application and read the 877A the first 8 bytes are FF , the rest bytes are proper.

    My program has nothing to do with on-the-fly code-programming to overwrite the first 8 program memory bytes ...

    The program is (now only a simple port-toggle , problem is still happening ...)


    OPTION_REG.7 = 0 ; ENABLE PORTB PULLUPS

    LOOP:
    portb.0 = not portb.0
    GOTO LOOP
    Hello LakisFM1,
    Welcome to the forum !
    I have some thoughts, which manifest as questions.
    Here goes . . .
    Are you compiling this code using PBP and MCS ?
    If so, Make sure to choose, " Compile " and Not, " ICD Compile " There is a world of difference in the hex output between these. As I usually do not use the ICD, I have unchecked it's selection in the toolbar settings, so as to avoid tripping myself.
    EDIT: Anyway here is your code working for me
    Code:
    DEFINE OSC 4
    TRISB = 0
    OPTION_REG.7 = 0 ; ENABLE PORTB PULLUPS
    
    LOOP:
    portb.0 = NOT portb.0
    PAUSE 500
    GOTO LOOP
    Last edited by Archangel; - 9th February 2010 at 01:50.
    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
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    First, thanks for the interest and quick reply.

    Yes i already lost 1 day in the past , have done this error pressing ICD compile while not seeing it closely
    This also affects only the operation of the program , not the hex-data itself.

    But unfortunately this is not the case i do press simple compile.

    Tried also other 877A, also recompiled and tried in 874A and LF877A , still have the same problem in all...
    the only though i have is to try an old PICKIT2 programmer software version , but i have to downgrade firmware too .

    ps....
    Found a strange solution...I program the PIC , i remove PIC from the socket , Close App , then Re-open App , Insert PIC in socket , Read PIC and data is now OK.
    Seems that something destroys the 8 bytes while closing or opening the PICKIT2 programer software..

    ps2... leaving PIC in while closing is OK..
    leaving PIC while OPENING the app the first 8 bytes are FF!...
    To check if this is a bug of read , opening again the app and inserting pic afterwards then i see clearly the data are really destroyed ...
    Last edited by LakisFM1; - 9th February 2010 at 06:58.

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


    Did you find this post helpful? Yes | No

    Default

    Hmm, I just put a chip on the breadboard, hooked up an LED, a resonator and the appropriate wires to the PICKIT2 and programmed it in place with the code posted, and it works. I actually used an 16F876A, so you MAY have more to do for a 877A.
    The PICKIT2 (at least mine ) can be a little temperamental sometimes, and tries to code protect the chip, a trick I found is to select another chip, then select the correct chip, then without loading a file, click the write button, then program in the file.
    Last edited by Archangel; - 9th February 2010 at 06:48.
    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.

  5. #5
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    i re-edit the message some minutes ago , so you may not see it.

    At this time seems that PIC programmed ok
    , but leaving it in socket while opening the app destroys the 8 bytes.

    I dont have 876A

    going to work now to test another pickit2 programmer....
    Have a nice day!

  6. #6
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Now at work ,
    another pc , another pickit2 (hardware) programmer same symptom !
    (pickit app same version , 2.61 , and OS 2.32.00)

  7. #7
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Finally is pickit's app bug.

    Just installed pickit 2.01 with the according firmware and all ok!!

    (next up is to see in which version introduced this bug , i will post as soon as i have results...

    result: PICKIT 2.40 is the latest working ok.
    Last edited by LakisFM1; - 9th February 2010 at 08:49.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LakisFM1 View Post
    Finally is pickit's app bug.
    I doubt that...
    ps....
    Found a strange solution...I program the PIC , i remove PIC from the socket , Close App , then Re-open App , Insert PIC in socket , Read PIC and data is now OK.
    Seems that something destroys the 8 bytes while closing or opening the PICKIT2 programer software..
    The PICkit2 does not have a socket. How do you have it connected?
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    with a small 40pin ICsocket > 6pin breadboard...

    I retried second time to use 2.55 still not working, so back to 2.40 for sure.

    I suspect is a bug of the Firmware 2.32.00 used both in 2.61 and 2.55.

  10. #10


    Did you find this post helpful? Yes | No

    Default

    I had the similar problem with PICkit 2 and 16F88. When PICkit 2's software was re-opened, a READ operation would erase some or all of the programming. The problem went away when I used chose Manual Device Select instead of automatic select. SW v2.61.

Similar Threads

  1. Help MCS with PICKIT2 programmer question
    By luminas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st February 2008, 17:57

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