In short: I am building a programmer as a school project, I am using 16F877A to program another 16F877A, I am using assembly language, I can program erased chips but I cannot program code or data protected chips because I couldn't achive to CHIP ERASE command worked. Do anyone know why this problem is happening?
DETAILED:
Hi, firstly I want to apologise for my bad english I wish I can explain my problem. I can not erase Pic16F877A configuration memory with using mine programmer, I am building a programmer for only programming Pic16F877A chip and only one program (as a beginning), this is a school project. I am using one chip to program another chip, as a project I have to use a pic to program another pic. I have achiaved these goals;
I can program chip when it is not code and data protected,
I can erase a pic when it is not code and data protected with bulk erase program memory command ( from this I am assure that my Vdd range is between 4.5V<Vdd<5.5V .
But I can not use chip erase command to erase a chip that have data or program memory or both of them protected, http://piclist.org/techref/postbot.asp?by=thread&id=Silicon&w=body&tgt=post subject:'[PIC] 16F87xA silicon bug (programming)' ) they says "wrote-load 3FFFh to data latches before chip erase command, howewer programming specification says this step does not required" I tried also this but I could not achive to program code or data, or code and data protected Pic16F877A chip, I think there is something wrong or not well described in the 16F87XA Flash Memory Programming Specification (39589C) or I am missing something. I want your help or advice to solve my problem any help will be appreciated. I spend a week and tried at least 200 variations of my program algorithm to to be able to use chip erase command but always I failed. I think I will loose my mind if I could not find a way to solve this problem.
My program algorithm to erase a code or data or code and data protected 16F877A chip is this
set VDD=5.00 V ;I am entering programming mode (HV programming)
set Vpp=13.0 V ;when I am doing these SCLK and SDATA also RB3 (PGM) are at the 0 V level
load data for program memory ;(I tried either 0000h and 3FFFh as a payload but the two of them did not worked) ( I tried to write 8 data latches with these two values but this is either did not worked)
Load configuration (000000) command (set pc 2000h) with data payload 3FFFh (ı have also tried without Load configuration command this is also not worked)
CHIP ERASE command ; I send 1Fh to the chip
wait 8 milisecond ( I also waited as long as one second but didn't worked)
set Vpp=0V
set VDD=0V ; after one mikrosecond from Vpp=0 , VDD became 0V so I am getting out of to programming mode
after these I am reentering the HV programming mode and writing the firstly configuration memory and then program memory ( I tried first writing program memory and then configuration word and ID words it does not matter two of them worked well with unprotected chip.
DETAILED:
Hi, firstly I want to apologise for my bad english I wish I can explain my problem. I can not erase Pic16F877A configuration memory with using mine programmer, I am building a programmer for only programming Pic16F877A chip and only one program (as a beginning), this is a school project. I am using one chip to program another chip, as a project I have to use a pic to program another pic. I have achiaved these goals;
I can program chip when it is not code and data protected,
I can erase a pic when it is not code and data protected with bulk erase program memory command ( from this I am assure that my Vdd range is between 4.5V<Vdd<5.5V .
But I can not use chip erase command to erase a chip that have data or program memory or both of them protected, http://piclist.org/techref/postbot.asp?by=thread&id=Silicon&w=body&tgt=post subject:'[PIC] 16F87xA silicon bug (programming)' ) they says "wrote-load 3FFFh to data latches before chip erase command, howewer programming specification says this step does not required" I tried also this but I could not achive to program code or data, or code and data protected Pic16F877A chip, I think there is something wrong or not well described in the 16F87XA Flash Memory Programming Specification (39589C) or I am missing something. I want your help or advice to solve my problem any help will be appreciated. I spend a week and tried at least 200 variations of my program algorithm to to be able to use chip erase command but always I failed. I think I will loose my mind if I could not find a way to solve this problem.
My program algorithm to erase a code or data or code and data protected 16F877A chip is this
set VDD=5.00 V ;I am entering programming mode (HV programming)
set Vpp=13.0 V ;when I am doing these SCLK and SDATA also RB3 (PGM) are at the 0 V level
load data for program memory ;(I tried either 0000h and 3FFFh as a payload but the two of them did not worked) ( I tried to write 8 data latches with these two values but this is either did not worked)
Load configuration (000000) command (set pc 2000h) with data payload 3FFFh (ı have also tried without Load configuration command this is also not worked)
CHIP ERASE command ; I send 1Fh to the chip
wait 8 milisecond ( I also waited as long as one second but didn't worked)
set Vpp=0V
set VDD=0V ; after one mikrosecond from Vpp=0 , VDD became 0V so I am getting out of to programming mode
after these I am reentering the HV programming mode and writing the firstly configuration memory and then program memory ( I tried first writing program memory and then configuration word and ID words it does not matter two of them worked well with unprotected chip.