In message <20010222105307.93898.qmail@web10803.mail.yahoo.com>, Andrei B. writes > I have built my own programmer for the PIC16F84 based on Microchip's >AN589 "A PC based development programmer" and written the programming >software for it based on Microchip's DS30262C "EEPROM memory >programming specifications". > All commands work just fine, except for the BULK ERASE PROGRAM MEMORY >and BULK ERASE DATA MEMORY. > Information in DS30262C is very confusing and there are also a lot of >typos in the section explaining the correct sequence of commands to >perform Bulk Erase. This has always caused lots of problems, it just doesn't seem to work as MicroChip state in their documentation. This is the Delphi routine I use in my programmer, it was developed from lots of tips and advice from this list!. Even if you don't read Delphi (Pascal), it's easy to understand, the Progmode() procedure switches the PIC to programming mode, depending on the value passed. Command() sends a command to the PIC, OutWord() sends 14 bit data, and Delay() is a routine to wait a specified number of milli-seconds. The command values passed use the names given in the datasheet (LdConf etc.). 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); 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 list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics