Searching \ for 'Erasing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Erasing'.

Truncated match.
PICList Thread
1999\05\31@215134 by Tony Nixon

picon face
Hi all,

I bookmarked this URL for erasing PIC 16F84's that so I could use the
info later, but it has dissappered. It appeared on this list a few weeks

Does anyone else have the method of bulk erasing that was posted here.

Best regards


PicNPoke - Multimedia 16F84 Beginners PIC Tools.

1999\05\31@221634 by Myke Predko

Hi Tony,

Here is the code that I used for the "El Cheapo" programmer I wrote about a
few weeks ago on:

Erase()                         //  Erase the 16F84's Program Memory
{                               //   Procedure Documented in DS30262A

int  i;


 CMDWrite( 0, 0x03FFF );       //  Code Protect Defeat Code
 for ( i = 0; i < 7; i++ )
   CMDSend( 6 );
 CMDSend( 1 );
 CMDSend( 7 );
 CMDSend( 8 );
 RTCDlay();                    //  Use the Long Delay
 CMDSend( 1 );
 CMDSend( 7 );

 RTCDlay();                    //  Wait for Everything to Complete


}  //  End Erase

It was taken directly from Microchip document DS30262A.  "CMDSend" sends the
six bit command string and "CMDWrite" sends the six bit command string with
a 14 bit data word (which is shifted up by two to get a sixteen bit word
that is serially sent to the PICMicro).

Good luck,


{Original Message removed}

1999\05\31@222827 by Mark Willis

face states:

"Gone: Mail for info."

 Mark, Intrigued <G>

Tony Nixon wrote:
{Quote hidden}

1999\06\02@212240 by Thomas Vogels
(This is another try to post this message to the piclist.  Sorry, if
it shows up twice now.)


 the important information from that website is that Microchip's
description of the commands is, uh, wrong?  After the BULK_ERASE you
should actually send data (14 1's).  Here is a snippet of C code (if
you have read AN 589 (?), it should look familiar).

/* Check Table 2-1, DS30262B-page 5 */
#define LOAD_CONFIG     0
#define ERASE_CMD_1     1
#define LOAD_DATA       2
#define READ_DATA       4
#define INC_ADDR        6
#define BEGIN_PGM       8
#define LOAD_DATA_DM    3
#define READ_DATA_DM    5
#define ERASE_CMD_2     7
#define BULK_ERASE      9
#define BULK_ERASE_DM   11

pic16f84 (PROG_MODE, 0);

fputs ("Erasing ...", stdout);

/* Disable code protect */
pic16f84 (LOAD_CONFIG, 0x3fff);

for (i = 7; i-- > 0; ) {
   pic16f84 (INC_ADDR, 0)
for (i = 2; i-- > 0; ) {
   pic16f84 (ERASE_CMD_1, 0);
   pic16f84 (ERASE_CMD_2,;0)
   pic16f84 (BEGIN_PGM, 0);

/* Erase everything */
pic16f84 (BULK_ERASE, 0x3fff);  /* twiddle thumbs for 10ms */
pic16f84 (BEGIN_PGM, 0);        /* ... and again */
pic16f84 (RESET_MODE, 0);

pic16f84 (RESET_MODE, 0);
fputs ("\nDone.\n", stdout);

Note that BULK_ERASE has to be followed by a 10ms pause, and have I
mentioned that you must send data after the command (all ones).

Bug me if you need more info.  The above works reliably.
Thanks go to Dave Tait & Nigel Goodwin who orignally helped me with
the same problem.


-- (Tom Vogels)   Tel: (412) 268-6638   FAX: -3204

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...