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. Here is a detailed description of the problem. On page 5 of DS30262C : "TABLE 2-1: COMMAND MAPPING FOR PIC16F83/CR83/F84/CR84" This I will refer to later. On page 8 of DS30262C, section 2.3.1.9 : ================================== 2.3.1.9 BULK ERASE PROGRAM MEMORY After this command is performed, the next program command will erase the entire program memory. To perform a bulk erase of the program memory, the following sequence must be performed. 1. Do a tLoad Data All 1Fsv command. 2. Do a tBulk Erase User Memoryv command. 3. Do a tBegin Programmingv command. 4. Wait 10 ms to complete bulk erase. If the address is pointing to the test program memory (0x2000 - 0x200F), then both the user memory and the test memory will be erased. The configuration word will not be erased, even if the address is pointing to location 0x2007 For PIC16F84 perform the following commands: 1. Issue Command 2 (write program memory). 2. Send out 3FFFH data. 3. Issue Command 1 (toggle select even rows). 4. Issue Command 7 (toggle select even rows). 5. Issue Command 8 (begin programming) 6. Delay 10 ms 7. Issue Command 1 (toggle select even rows). 8. Issue Command 7 (toggle select even rows). Note: If the device is code-protected (PIC16F84A), the BULK ERASE com-mand will not work. ==================================== My understanding of this portion of text is the following, please correct me if I am wrong : For PIC16F84 (code protection disabled), based on Table 2-1: - Issue command LOAD DATA FOR PROGRAM MEMORY, DATA=0x3FFFh - Issue command LOAD CONFIGURATION, DATA=???? (what is the meaning of "toggle select even rows" here) - Issue command READ DATA FROM DATA MEMORY (what is the meaning of "toggle select even rows" here) - Issue command BULK ERASE PROGRAM MEMORY. (what is the meaning of "begin programming" here, if command 8 is something else?) - Delay 10ms. - Issue command LOAD CONFIGURATION, DATA=???? (what is the meaning of "toggle select even rows" here) - Issue command READ DATA FROM DATA MEMORY (what is the meaning of "toggle select even rows" here) This sequence of commands does not work. This is what I can figure out from the text. Please clarify this for me. Thank you. Taking the command sequence from the first paragraph and performing: - Issue command LOAD DATA FOR PROGRAM MEMORY, DATA=0x3FFFh - Issue command BULK ERASE PROGRAM MEMORY - Issue command BEGIN PROGRAMMING - Delay 10ms This sequence does not work either. Note: I performed these commands as the first thing after entering programming mode. Also, code protection is NOT active. On page 9 of DS30262C, section 2.3.1.10: =========================== 2.3.1.10 BULK ERASE DATA MEMORY To perform a bulk erase of the data memory, the follow-ing sequence must be performed. 1. Do a tLoad Data All 1Fsv command. 2. Do a tBulk Erase Data Memoryv command. 3. Do a tBegin Programmingv command. 4. Wait 10 ms to complete bulk erase. For PIC16F84 perform the data memory). 5. Send out 3FFFH data. 6. Issue Command 1 (toggle select even rows). 7. Issue Command 7 (toggle select even rows). 8. Issue Command 8 (begin data) 9. Delay 10 ms 10. Issue Command 1 (toggle select even rows). Issue Command 7 (toggle select even rows). // should this be line 11? Note: All BULK ERASE operations must take place at 4.5 to 5.5 VDD range. ============================== This is even more confusing. The numbering of lines continues, but in the previous section, when taking PIC16F84 as a separate case, the numbering restarts from 1. I cannot understand what commands to perform here : - Issue command ??????????, DATA=0x3FFFh - Issue command LOAD CONFIGURATION, DATA=???? (what is the meaning of "toggle select even rows" here) - Issue command READ DATA FROM DATA MEMORY (what is the meaning of "toggle select even rows" here) - Issue command BULK ERASE PROGRAM MEMORY (this is command 8 in Table 2-1. Why not BULK ERASE DATA MEMORY? what is the meaning of "begin data" ?) - Delay 10ms - Issue command LOAD CONFIGURATION, DATA=???? (what is the meaning of "toggle select even rows" here) - Issue command READ DATA FROM DATA MEMORY (what is the meaning of "toggle select even rows" here) This section seems incomplete and with errors, maybe not just typos. Considering the first paragraph, lines numbered 1 through 4: - Issue command LOAD DATA FROM DATA MEMORY, DATA=0x3FFFh (is it DATA or PROGRAM MEMORY, it is not clear) - Issue command BULK ERASE DATA MEMORY - Issue BEGIN PROGRAMMING - Delay 10ms This sequence does not work either. Note: All programming operations were performed while supply of the device was 4.97V-4.99V, which was monitored continuosly. Note: All other commands work properly as described in this document and I have succesfully programmed several devices with this programmer and programming software. It has been developed under FreePascal 1.04 (DOS Go32v2) and it will be released under the GNU Public License version 2 as soon as I can make these commands to work. It will be available at http://members.tripod.com/andrei_b. References used for this development: - PIC16F84 datasheet - PIC16F84A datasheet - PIC16C84 datasheet - AN 589 - A PC based development programmer - DS30262C - EEPROM Memory Programming Specification PIC16F8XX Thank you in advance for your help. Andrei Boros aka Andrix. __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/ -- 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