In message <003301c0d49d$cc6810e0$3a5170cf@l9d1f7>, myke predko writes >Hi Nigel, > >What were the changes you made to the erase routines? I have used the >PIC16F84A in my El Cheapo without any problems, but I would like to know >what to do if it bites somebody. Hi Mike, I can't remember how the routine was before, it basically developed over a number of years - as you probably remember there were problems with the erase routine listed in the 16C84 datasheet, and I implemented changes based on information from the PicList. Here is the routine I currently use. ProgMode() turns MCLR on or off, Command() sends a command to the PIC, Outword() sends a 14 bit value. The values send (like BegPrg) are those listed in the datasheet. I notice I've actually commented a change for the 16F84A Procedure EraseAll; Var i : Byte; Begin {Clear Protect fuse} ProgMode(POn); Command(LdConf); OutWord($3FFF); {value to reset memory to} FOR i := 0 TO 6 Do Command(IncAdd); Command(1); Command(7); Command(BegPrg); Delay(ProgDelayTime); Command(1); Command(7); {Command(BegPrg); - removed for 16F84A} ProgMode(POff); {Clear Program memory} ProgMode(POn); Command(LdProg); OutWord($3FFF); Command(BegPrg); Command(ErsPrg); Command(BegPrg); Delay(ProgDelayTime); ProgMode(POff); {Clear Data memory} ProgMode(POn); Command(LdData); OutWord($3FFF); Command(1); Command(7); Command(BegPrg); Delay(ProgDelayTime); Command(1); Command(7); ProgMode(POff); End; -- Nigel. /--------------------------------------------------------------\ | Nigel Goodwin | Internet : nigelg@lpilsley.co.uk | | Lower Pilsley | Web Page : http://www.lpilsley.co.uk | | Chesterfield | Official site for Shin Ki and New Spirit | | England | Ju Jitsu | \--------------------------------------------------------------/ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.