Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pickit 2 overwriting 16F internal EEPROM

Status
Not open for further replies.

Mosaic

Well-Known Member
Ok, I can't seem to get the Pickit2 (V2.61) to stop overwriting the EEPROM in a 16F886. Even whn I deselect it the internal EEPROM is rewritten by the hex code EPROM (0x2100 allocation) .
I have CPD as off and CP as on:

#include "P16F886.inc" ; processor specific variable definitions
__CONFIG _CONFIG1, _IESO_OFF & _FCMEN_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO & _BOR_ON & _LVP_OFF & _CP_ON &_CPD_OFF & _MCLRE_OFF &_INTRC_OSC_NOCLKOUT; EEPROm data not locked to allow readout before reflashing and rewrite after firmware changed.
__CONFIG _CONFIG2, _WRT_OFF & _BOR40V

Any advice on this?
 
You have to de select it on the programmer!

Pickit 2 and 3 have a "preserve eeprom" check window and it can stop any data being overwritten... If you use MPLAB then it will always clear the eeprom ( fills it with 0xff )
 
By "MPLAB," I assume you mean ICD3. Are you sure ICD3 erases eeprom? Using MPLAB IDE 8.92, one has a choice for retaining it, which is the same option screen I get for PicKits:
upload_2017-6-28_4-28-14.png


John
 
y "MPLAB," I assume you mean ICD3. Are you sure ICD3 erases eeprom? Using MPLAB IDE 8.92, one has a choice for retaining it, which is the same option screen I get for PicKits:
He mentions pickit2 but not the IDE so I assume pickit2 ( older ) so possibly MPLAB 8.xx
 
No MPLAB. Just a load hex and flash, I did deselect the EEPROM with the PICKIT2. It still overwrites.
 
It does...I am really not sure why it appears unreliable.
I am usung the standalone PK2 s'ware.

EDIT
It seems that if I deselect the EEPROM and try to reflash the hex autoload sequence of the PK2 renables the EEPROM writes.

I must load the hex, then deselect the EEPROM, then flash to get it right.
 
Last edited:
Your hex file must contain the EEPROM data. You could try removing it manually. This page explains the sections of the hex file.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top