David wrote: :It seems the bulk erase commands work like the load data :commands and need data. Here's what I do: : :1. send 001001 bulk erase program memory :2. send 0111111111111110 all 1s data (padded with 0s) :3. send 001000 begin programming :4. delay 10ms : :With a similar sequence for bulk erase data memory. Or the other sequence that came up earlier (and which I have tested to work properly). To erase the program memory: 1. Send 000010 011111111111110 "load program all ones" 2. Send 001000 "begin programming" 3. Send 001001 "bulk erase program memory" 4. Send 001000 "begin programming" 5. Wait for 10ms or more. To erase the data memory change above: 1. Send 000011 011111111111110 "load data all ones" 3. Send 001011 "bulk erase data memory" If you do the bulk erase program while in the test memory also the ID's will be erased. In addition, if the code protection is on also the configuration will be erased. I don't know what the guys at Microchip actually intended the erase procedure to be, they have not answered my questions. Anyway, the document on programming the 16F8X (DS30262A) gives the sequence I show abvove, without step 2. As to David's sequence, the doc says bulk erase command does not take data, but maybe it does as you can conclude from the fact that David's code works. Had I a PC, a logic analyzer and a PicStart+ I would check what procedure Microchip uses for the bulk erase. -- Lauri --- For more info.