PDA

View Full Version : Strange problem programming 16f88



Picstar
- 2nd March 2012, 10:34
Hello Guys and Gals,
I just entered some test code into my Pic 16f88 and now I can't get it to do anything, including re-program. The code I entered was simple enough:


Start:
Trisa = %00000000
Porta = 0
for I = 1 to 20000
next I
Portb.1 = 1
pause 5000
goto start

Is it possible that my chip is stuck in a loop that will not allow me to reprogram? I've tried this on three chips and zapped every one of them. Stick in a different chip and load a DIFFERENT program and every thing works fine. Any ideas?

retepsnikrep
- 2nd March 2012, 15:42
The 16F88 has a hideous hardware issue and if you set MCLR to OFF in your CONFIG it becomes almost impossible to program in my experience. You must leave MCLR ON and pull the pin upto 5v with a 10k resistor so you effectively lose a pin.

You can recover it by tweaking with the programing voltages, but its a royal PITA and there are several threads on the internet and prob on here as well. I buggered up quite a few before I found about it.

http://www.picbasic.co.uk/forum/showthread.php?t=14568

retepsnikrep
- 2nd March 2012, 15:54
Resolution

Thanks to Toley for sending me a few of the problem PIC16F88 parts. This problem is unique to 18-pin parts that share the Timer1 oscillator with the PGx programming pins. Parts included are the PIC16F88, 87 and possibly the 818, 819, 62xA, & 648A.

The problem occurs when the device is programmed so that:
1) It uses the internal oscillator
-and-
2) The MCLR pin is turned off to use as a digital input instead
-and-
3) The program code enabled the Timer1 Oscillator in the T1CON register. (The sooner this is enabled after the reset vector the more likely the problem is to occur.

This problem can be prevented by avoiding one of the 3 conditions above.

It is possible to recover parts with this issue. To do so, follow these steps in the PICkit 2 Programmer software:

A) Put the part on a breadboard or other jig where it is only connected to the 5 PICkit 2 programming signals.
B) Open the PICkit 2 Programmer application v2.40 (or later). Select "Device Family > Midrange"
C) Set the PICkit 2 Programmer VDD voltage box to 3.0 Volts
D) Select "Device Family > Midrange" again; it should now detect the part
E) If the part is not detected in D), reduce the VDD by 0.1 volts and try again. Repeat until the part is detected.
F) Select the WRITE button. It should now erase the part.

You will now be able to program & use the part normally at 5.0 Volts VDD.