Hi Robin, Thanks for the reply. Assuming the time is measured from the falling edge of the clock to the next falling edge (the command bits are latched in on the falling edge) we are waiting 20 mS when the 16f877 programing spec. only requires 2 mS. After some more tests I beleive that the problem is in the "begin erase programming cycle" and the "begin programing only cylce" command. After we issue one of these commands, the data WILL be written in to memory however, any further "read data from program memory" commands will only return 3fff. Even if we send a combination of "increment address" and "read data from program memory" commands we will still get 3fff when there should be data at those locations. Furthermore, if we reset the chip, and program the first location, advance the program counter then program the second location. The second location will not be programed, only the first location. It is almost as if, after a begin programing command (either erase or programing only) the chip gets stuck so that it cannot accept anything else and only returns all 1's to a read. It IS accepting commands in that the data pin is in high impedance until after a read command has been issued. This also is apparent when we do a bulk erase which is 'activated' by a begin programing command. We can not program any locations after that begin programing command without reseting the chip first. The bulk erase is successful but the final step of the bulk erase, the begin programing command leaves the chip in state where it can't do anything. -Jake Robin Abbott wrote: > > Jake > > This may be a stupid question but are you waiting 10mS (check data sheet for > exact time) for the PIC to complete the erase-program cycle before reading > back ? (BTW program only is faster) > > Robin Abbott - robin.abbott@fored.co.uk > > ************************************************************************** > * > * NEW from FED - WIZPIC - visual PIC development > * - see web site for more details ! > * > * Forest Electronic Developments > * http://www.fored.co.uk > * > ************************************************************************** > > ----- Original Message ----- > From: Jake Szot > To: > Sent: 28 November 1999 21:10 > Subject: 16f877 parallel programer problem > > > Help! > > > > A classmate and I are making a PIC16f877 programmer as a project in one > > of our courses and we've run into a problem. The PIC will not let us > > read data (properly) or advance the program counter while in program > > mode. Here are the steps we go through to program a location: > > > > 0. Issue a Bulk Erase Programing Memory > > 1. Reset the PIC by keeping RB6 and RB7 low and then bringing MCLR from > > 0v to 12.5v > > 2. Issue a Load Data for Program Memory command (6 clks) followed by > > clocking in the data (16 clks) > > 3. Issue a Begin Erase Programming Cycle command (6 clks) > > 4. Issue a Read Data From Program Memory (6 clks) to see if the data > > went in properly > > 5. Change our Data Out to High Impedance > > 6. Issue 16 clks to read the data from the PIC > > > > What comes out from the PIC (during these 16 clocks) is not what we > > programmed. It is all 1's. > > > > Now, if we perform a reset (ie step 1) and issue another Read Data From > > Program Memory (ie steps 4 through 6) we receive the correct data that > > we entered in! > > > > Further more, if we try to program the first two memory locations ie: > > > > 1. Reset the chip > > 2. Issue a Load Data For Program Memory > > 3. Issue a Begin Erase Programing Cycle > > 3. Clock in some data > > 4. Issue an Increment Address > > 5. Issue a Load Data For Program Memory > > 6. Issue a Begin Erase Programing Cycle > > > > Then reset the chip. We can read back the first location ok however the > > second location does not give us our data. Again it is all 1's. > > > > Any help would be greatly appreciated. Please try to respond to > > jakeszot@home.com as I don't know if I will be able to monitor this > > list for responses. > > > > Thanks! > > > > -Jake