In message <199803152246.RAA23663@scdh-99.umd.edu>, Matt Bennett writes >I've built my own programmer (a serial programmer for both the EPROM >and Flash parts) and it programs great. I'm having problems with the >"bulk" erasing of the program and data areas. My first problem is >ambiguity in the data sheet. In the data sheet it reads: I could never get it to work either, eventually someone advised me to add an extra "Begin Programming" command. >Bulk Erase Program Memory >To perform a bulk erase of the program memory, the following >sequence must be performed. >1. Do a "Load Data All 1's" command. * add "Begin Programming" command here. * >2. Do a "Bulk Erase User Memory" command. >3. Do a "Begin Programming" command. >4. Wait 10 ms to complete bulk erase. > >But there are two "load data" commands, one for "load data for program >memory", (000010) and the other, "load data for data memory" (000011). >Ok, I assumed that if I was erasing the program area, I'd use "load >data for program memory", and similarly for the data area. Sounds >logical to me, but... it doesn't work. > >It *does* seem to erase the memory location that I'm currently at, >in either the program or the data area, but I was under the impression >that a "bulk" erase would erase *all* of the respective memory locations >(data or program). > >So, does the "bulk erase" erase one or all memory locations, and >if it does erase them all, how do you actually do it? Have you >made the procedure in the data sheet actually work? Here is the EraseAll prodcedure used in both my DOS(TP7.0) and Windows(Delphi 1.0 and 3.0) software 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; >If you're the one who helps me solve this problem, I'll treat you >to your favorite coffee/tea/soda/beer the next time you are in >the Washington, D.C. area! That's not a great offer!, I'm not very likely to get across there :-). -- Nigel. /--------------------------------------------------------------\ | Nigel Goodwin | Internet : nigelg@lpilsley.demon.co.uk | | Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk | | Chesterfield | | | England | | \--------------------------------------------------------------/