I've been working on a PIC programmer for my 16F88. So far I've met a mild degree of success, but I've run into a strange roadblock. I think it may have something to do with my reset routine. The Microchip documentation is... well... lacking, to put it generously. I've used the 16F88 Programming Specification document up until now, but I'm finding it more and more difficult to uncover specific answers.
So here's my issue. My program burns 4 words into the program memory, increments, then burns 4 more. I then reset the device and attempt to read the 8 words that were just burned. When I do this, it successfully reads the first 4 words, but not the last 4. During my investigation, I reset and attempted to read the 8 words a second time immeditately after the first read attempt. In other words I did this:
1) Reset 2) Burn 8 words 3) Reset 4) Read 8 words 5) Reset 6) Read 8 wordsI was able to see only the first 4 words from step (4), but none of the words from step (6). This is what made me think that something is wrong with my reset command, like maybe it is not setting the address counter to 0x00 correctly. My reset routine looks like this (using ICSP protocol):
1) MCLR and PGM low, then 2) PGM high, then 3) MCLR highCan anyone note a clear flaw in my program here? For thoroughness, here is the pseduo-code from my program so far:
Reset Bulk Erase Begin Erase End Programming Reset For a = 1 to 4 Load Data for Program Memory Burn(data[a]) if (a != 4) Increment End For Begin Programming Only Cycle End Programming Increment For a = 5 to 8 Load Data for Program Memory Burn(data[a]) if (a != 4) Increment End For Begin Programming Only Cycle End Programming Reset For b = 1 to 8 Read Data From Program Memory Read(data[b]) Increment End For