Jump to content
Ian Smith

I Seem To Be Killing My Pic16f88s...

Recommended Posts

Not really a C question.. but...

 

I have been using the free version of SourceBoost C to play around and had it working for a few attempts, but the I seem to have done something bad with my config fuses because after programming the chips, they can't be read or written to anymore. I have two programmers, the latest a PICkit2 does not even see the 16F88 after it's been programmed.

 

Suspecteding the fuses, I changed them to 3FFF 0000 with the same exact code, and that programms correctly and leaves me with a chip I can continue to read and write flash data to.

 

Here is what I was using to compile...

 

#pragma DATA _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_IO

#pragma DATA _CONFIG2, _IESO_OFF & _FCMEN_OFF

 

If I change the lines to following, it does program and verify...

 

#pragma DATA 0x2007, 0x3FFF

#pragma DATA 0x2008, 0xFF

 

Is there anything in my _CONFIGs that would be killing my ability to re-program these? Am I somehow activating code protect? Any way to recover the chips? The PICkit2 has a erase option, but it won't enable it since it doesn't see any of the messed up chips. Anyone have an idea what I am doing wrong? Square plug in round hole?

 

Thanks!

Share this post


Link to post
Share on other sites

I've used the following successfully on a 16F88 (when looking up these settings in the data sheet note that Fosc uses bits 4, 1 and 0; can be confusing):

#pragma DATA 0x2007, 0b11111101010000	//Config1
#pragma DATA 0x2008, 0b00				//Config2

 

I recall reading about a special low voltage setting which can be used to recover Pics. You'll need to troll through some of the posts: http://forum.microchip.com/tt.aspx?forumid=15

 

David.

Share this post


Link to post
Share on other sites

Do your programmers use Low Voltage programming mode?

 

Your config has LVP_OFF which would cripple the chips if you only have LVP mode.

Share this post


Link to post
Share on other sites

Ahh... that could be it. I assume the PICkit2 is low voltage only?

 

I have a Warp-13 that has never worked quite right. It uses the same pins to program, so it's low voltage as well?

 

Is there any way to reset the PICs back to blank so they can be used again?

Share this post


Link to post
Share on other sites
Ahh... that could be it. I assume the PICkit2 is low voltage only?

 

I have a Warp-13 that has never worked quite right. It uses the same pins to program, so it's low voltage as well?

 

Is there any way to reset the PICs back to blank so they can be used again?

 

Use a high voltage programmer and set the LVP bit high!

NB a bulk erase does this.

 

You might be able to frig the pickit by applying 12 volts (say from some batteries) to the Vpp pin then performing a bulk erase (assuming the pickit impliments bulk erase ).

 

Dont try this during a program cycle as the programmer has to apply and reapply the program voltage during different phases of programming and I doubt you would be able to guess when to apply 12V.

Share this post


Link to post
Share on other sites

I'm not sure if PicKit2 does low voltage programming but it definitely does high voltage (the manual refers to a 12v Vpp). No mods are needed to the programmer. The config I gave you works perfectly on a default install of PicKit2.

 

It is normal to link the Pic's MCLR pin to Vdd with a 10k resistor to prevent a floating input and random resets. While you are struggling, make sure nothing else is connected to the MCLR, PGD or PGC pins as extra circuitry can interfere with programming, especially the clock pin.

dt.

Share this post


Link to post
Share on other sites

Hmmmmmmmm!

 

Sounds like a problem I had some time ago with the 12F629 pic using a MikroElectronika EasyPic2 dev board.

 

I could program the device straight from the packet but never erase it again to reprogram. I too thought I had blown them and had a nice pile of these chips that I could not reuse.

 

I eventually tracked the problem down to the supplies not being switched in the correct sequence. The Vdd (+5V) arrived when the USB cable was plugged in, then Vpp to program it. This chip requires the Vdd to be cycled as well as Vpp to reset the device internals.

 

I ended up having to build my own programmer which cycles the supplies in the correct sequences and have had no problems ever since.

 

I use the EasyPic2 for all other pics. Just not the 12F629.

 

My tupence worth :rolleyes:

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Success!

 

I ran into a 'bug' in the PIC part itself. I found the solution here: http://forum.microchip.com/fb.aspx?m=306403

 

The 16F88 and a few other chips become unprogrammable if you use MCLR as an IO pin, you use the internal osc, and you set TIMER1 to use the internal osc as a clock source.

 

If you do all three, you can no longer program the part. The post gives the solution to recovering the chips.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...