PDA

View Full Version : PIC16f877A first 8 bytes destroyed after closing PicKit2 programmer app....



LakisFM1
- 8th February 2010, 23:05
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

Archangel
- 9th February 2010, 00:51
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


DEFINE OSC 4
TRISB = 0
OPTION_REG.7 = 0 ; ENABLE PORTB PULLUPS

LOOP:
portb.0 = NOT portb.0
PAUSE 500
GOTO LOOP

LakisFM1
- 9th February 2010, 06:35
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 ...

Archangel
- 9th February 2010, 06:42
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.

LakisFM1
- 9th February 2010, 07:05
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!

LakisFM1
- 9th February 2010, 08:13
Now at work ,
another pc , another pickit2 (hardware) programmer same symptom !
(pickit app same version , 2.61 , and OS 2.32.00) :mad:

LakisFM1
- 9th February 2010, 08:40
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.

mackrackit
- 9th February 2010, 11:42
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?

LakisFM1
- 9th February 2010, 12:44
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.

Dick Ivers
- 11th February 2010, 21:32
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.