A Message Board, Guestbook, or Poll hosted for your website.
DIY Electronics (Hong Kong) Message Board

Register Login New Posts Chat
www.kitsrus.com > Forums > PIC Programmer kits > ATTN: PIC16F88 / F819 Startup Issues, workarounds
 
Username:
Password:
 

Thread Tools  | Search This Thread 
Reply
 
Author Comment
 
KitsRUsBob
Registered: July 29, 2005
Posts: 419

    Feb 09, 2006 at 05:03 AM
Reply with quote#1

I have determined what the programming problem is with the NanoWatt series (PIC16F88, PIC16F818, etc). The explanation can be made understandable with an examination of the Programming Algorithm for the F88 (DS39607B).

DIY programmers are designed  in such  a way that VPP is applied with an approx risetime of 400uS. This has always been adequate before the nanowatt series was created.

The speed is a function of the gain of the VPP switch and the drive applied to it. Unfortunately, the F88 etc requires less than 250uS risetime (twice as fast) to prevent  the uP from starting normal execution (under certain circumstances). This gives rise to some peculiar symptoms such as (1) device can only be programmed once, (2) works only with a delay inserted before changes are made to the oscillator setup (INTRC used) or (3) works only with a delay inserted bnefore changes to portA are set (if MCLR is used as an output).

This problem is caused by DIY programmers having a slower VPP switching speed
than recommended. However, this problem never occurs if the PowerUp Timer is enabled (holds the DIY programmer in reset for 72mS) OR the MCLR is allowed to act as device reset (allows a POR RESET ACTION to occur, providing a few mS more of reset state before execution starts).

The action of the MCLR is the most serious, because if the PIC begins instructions and the MCLR is set as an OUTPUT, it will ignore the VPP pulse or might pull it down.

This problem has been difficult to find because I never imagined that anybody would want their PIC to start running without any powerup delays at all. Since the LF88 will run reliably at 2V, good practice should be to wait at least a few milliseconds to make sure the PIC is at proper VCC before execution begins.

There are three workarounds and a possible hardware fix for K149/K150 only:

Workarounds:

1. Make sure that the PWRUP Timer is always enabled. You can then setup any other configuration without problems.

2. Make sure that MCLR is configured to be a DEVICE RESET PIN. Even if the pin is NOT toggled, there is a short POR RESET delay that occurs. You can then setup any other configuration without problems.

3. Before setting up the portA pins, execute a 1/2mS delay by using a couple of
"decfsz,reg,f   loops". Personally, I believe that the powerup delay is a better idea, but this MIGHT get you to where you need to go.

Possible Hardware Fix:

The two VPP switches switch will switch faster if the 4.7K pulldown resistor is replaced with a 1K pulldown resistor. This means for the K149 that R11 and R12 are replaced with 1K resistors; for the k150, the R's are R10 and R11. If you wish to parallel another resistor with the old one, the new resistor should be 1200 ohms.

--Bob             
Stu_H
Registered: July 30, 2005
Posts: 94

    Feb 09, 2006 at 08:04 AM
Reply with quote#2

Nice detective work!

I have a serious purpose to this post though: If you are using DonkeyProg instead of MicroPro/P18 (to program some of the newer 18-series devices, if you didn't know already )then this advisory applies to you too - ALL the devices covered by DP are of the "nanoWatt" type.
Perhaps this explains why a few people have had trouble with DP failing to program - it'd be nice to know if the biasing fix above cures this...

It never affected me, and I've programmed 18F2520,2550 and 4520 devices with DP and 16F777 and 16F819 devices with MicroPro - all without any issues using a K149B.

__________________
-- Stuart

Blog at http://logicspark.blogspot.com/
KitsRUsBob
Registered: July 29, 2005
Posts: 419

    Feb 09, 2006 at 11:32 AM
Reply with quote#3

Hi, Stu!

Yes, this is what has been tying me up so bad. I am beginning to breathe easier, now.

I now have to actually FIX a couple of  K149s <G>!

--Bob

 

Previous Thread | Next Thread
Reply

 
Bookmarks
 
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google
 
Thank you for visiting.