In message <19990124162727.22841.qmail@hotmail.com>, mahfoud rahal writes >Hi, > >I'm working on a PIC16C84 programmer project. All programming commands >given in DS30189D documentation from Microchip are working fine except >for "BULK ERASE PROGRAM MEMORY" and "BULK ERASE DATA MEMORY" witch are >001001 and 001011 respectively. > >For example, in chapter 2.3.1.8 (BULK ERASE PROGRAM MEMORY) >the doc says: >1- Do a "Load Data All 1's" command >2- Do a "Bulk Erase User Memory" command >3- Do a "Begin programming command" >4- Wait 10 ms to complete bulk erase > >so, my programmer send: >1- 000010 0111111111111110 >2- 001001 >3- 001000 >4- wait 10 ms > >When I read back the chip, no location of the Prog Mem changed, >am'I missing something or is there some mistakes in DS30190D. >Any idea ? > >Note: I can do the equivalent operation by writing 3FFF in all program >memory locations but this consumes much more time. I could never get it to work either, eventually someone told me that you needed to add an extra 'Begin Programming Command' before the 'Erase' command - this would be at '1.5-' in your numbering scheme above. This is the routine I use for totally erasing the chips, it's written in Delphi/Turbo Pascal - same routine works in either. It should be fairly easy to see what's going on. Procedure EraseAll; Var i : Byte; Begin {Clear Protect fuse} ProgMode(POn); Command(LdConf); OutWord($3FFF); FOR i := 0 TO 6 Do Command(IncAdd); Command(1); Command(7); Command(BegPrg); Delay(PgmCfg[Current].Settings[DelayTime]); Command(1); Command(7); Command(BegPrg); Delay(PgmCfg[Current].Settings[DelayTime]); ProgMode(POff); {Clear Data memory} ProgMode(POn); Command(LdData); OutWord($3FFF); Command(BegPrg); Command(ErsDat); Command(BegPrg); Delay(PgmCfg[Current].Settings[DelayTime]); ProgMode(POff); {Clear Prog memory} ProgMode(POn); Command(LdProg); OutWord($3FFF); Command(BegPrg); Command(ErsPrg); Command(BegPrg); Delay(PgmCfg[Current].Settings[DelayTime]); ProgMode(POff); End; -- Nigel. /--------------------------------------------------------------\ | Nigel Goodwin | Internet : nigelg@lpilsley.demon.co.uk | | Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk | | Chesterfield | Official site for Shin Ki Ju Jitsu | | England | | \--------------------------------------------------------------/