This is a multi-part message in MIME format. ------=_NextPart_000_00B4_01C698F0.19F94F60 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Jim Robertson wrote: > Sounds like a more severe form of a problem I described on the piclist > back in late Feb 2005. Notice I also refer to a Mod 8 erase issue. > > Below is a cut and paste to save you digging though the archives. > > ... > >> Fortunately, there is a easy work around. If the write latch is >> preloaded with 0x3FFF the problem does not manifest. >> Note that the Programming specs says this step is not required. >> the reality is that with some (not all, some) silicon revisions it is. I ran into a similar problem with the original 16F877 (I think that was it) a long time ago. I remember figuring out that the write latches needed to be loaded with 3FFFh for the bulk erase to work, even though this was not mentioned in the programming spec. It sortof makes sense that this might be needed. Since then I've always sent data of 3FFFh with any erase command and I haven't had problems. That's probably why I never ran into this case for the 16F87xA. I've attached the source code of the erase subroutine for the 16F87xA. This is in the file PICPRG_16.PAS in the PICPRG source directory in case anyone wants to see more of the code. All my PIC programmer software, including source code and build scripts, and be downloaded from http://www.embedinc.com/picprg/sw.htm. ------=_NextPart_000_00B4_01C698F0.19F94F60 Content-Type: text/plain; format=flowed; name="x.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x.txt" { *************************************************************************= ****** * * Subroutine PICPRG_ERASE_16F87XA (PR, STAT) * * Erase all erasable non-volatile memory in the target chip. * * This version is specific to devices that use the CHIP ERASE command, * like the 16F87xA family. } procedure picprg_erase_16f87xa ( {erase routine for 16F87xA} in out pr: picprg_t; {state for this use of the = library} out stat: sys_err_t); {completion status} val_param; begin picprg_reset (pr, stat); {reset target to put it into = known state} if sys_error(stat) then return; picprg_cmdw_writing (pr, stat); {indicate the target is being = written to} if sys_error(stat) then return; picprg_send6 (pr, 2#000000, stat); {send LOAD CONFIGURATION command} if sys_error(stat) then return; picprg_send14ss (pr, 16#3FFF, stat); {send the data word for this = command} if sys_error(stat) then return; picprg_send6 (pr, 2#111111, stat); {CHIP ERASE} if sys_error(stat) then return; picprg_cmdw_wait (pr, 0.010, stat); {force delay before next = operation} if sys_error(stat) then return; picprg_reset (pr, stat); {reset target to guaranteed known = state} if sys_error(stat) then return; end; ------=_NextPart_000_00B4_01C698F0.19F94F60 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ------=_NextPart_000_00B4_01C698F0.19F94F60-- ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products