16F88 code locking pic ?


Closed Thread
Results 1 to 12 of 12
  1. #1

    Default 16F88 code locking pic ?

    Greetings,

    I've seen somewere on the internet that someone after programing a pic the programmer could no longer recognize the pic ( burning only with that specific code).

    From what i understood it was something about using the internal oscilator and MCLR getting a state where the programmer could not access programming mode.

    My question is:

    Are you guys familiar with this issue ?

    How can this happen and how can it be avoidable ?

    Thanks in advance

    RJC

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    it's probably a JDM or else based programmer.

    i do remind an error 0000 or something like that, not sure if the following is what you're looking for
    http://www.picbasic.co.uk/forum/showthread.php?t=1915

    Basically MCLR voltage wasn't high enough, PGM wasn't tied to GND while programming, the PGC/PGD where much too loaded and/or target supply was noisy. Another thing happened with EPIC without the XP printer poll patch installed
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi Mister-e,

    It wasnt a low voltage problem.

    This one could program any device at any time but with this specific code the pic could no be programed ever again.

    I think that was mentioned that the program burned sets some pins in a way that the programming pins cannot be used to re-program the pic.

    It was also mentioned that this phenomenon may occour when these pins are programed this way combined with using the internal oscilator.

    .

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Ok...i think i found it...

    Quote "If you've programmed the PIC so that it uses the internal oscillator AND have programmed the MCLR pin as an IO you'll have this problem. This is because the programmer will no longer be able to reset the PIC or stop the oscillator before entering programming mode."

    http://www.electro-tech-online.com/m...ills-pics.html

    Is this valid for any pic that supports these features ??

    EDIT: It also says that you can still program it anyway...
    .
    Last edited by ruijc; - 30th November 2007 at 15:36.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Snipped from web:
    I believe that the "JDM Programmer" is cheap and very useful PIC Programmer. However, since "JDM Programmer" cannot control VDD, the algorithm "VPP before VDD" is inapplicable. Programming to the latest device from this reason may go wrong when using CONFIG settings as "Internal oscillator" "MCLR OFF".
    I've seen that, it's a downfall of a basic JDM style programmer.

    The jdm always supplys power and cannot bring VPP high before powering the pic.
    (This is how to get to programming mode with MCLR disabled).

    I use a newer JDM style programmer that doesn't have this problem.
    I use 16f88's (628a, 648a) with intosc and mclr off, without any problems.
    Was one of the first things I tested with the "enhanced jdm" programmer.

    Other programmers don't have this problem, the pic CAN be re-programmed.
    (just not with a cheapo JDM)

  6. #6
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    MELabs actually helped me solve this issue over the phone.

    If you use MCLR as an input pin, then you need to delay at least two seconds before configuring the osc drive... these are notes I made in my code... and they work.


    ' Turn PGC (PORTB.6) & PGD (PORTB.7) into inputs (tris.x =1)
    ' Disable hardware Crystal drive
    ' Pause ~2 seconds.
    ' This allows the PIC to reset for programming. Otherwise, it's a hit & miss for programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Tenaja,

    this means i have to always ( everytime i use internal oscillator AND have programmed the MCLR pin as an IO ) include a small code before the actual code, right ?



    BeforeCode:

    input portb.6 ' Turn PGC (PORTB.6) & PGD (PORTB.7) into inputs (tris.x =1)
    input portb.7 ' Turn PGC (PORTB.6) & PGD (PORTB.7) into inputs (tris.x =1)

    ' Disable hardware Crystal drive -> What is the simplest way to do this ?

    pause 2000 ' Pause ~2 seconds

    Codestart:

    ' and here starts the program

    .

  8. #8
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    No, it's not when using the internal osc.

    It's when using the internal osc, but the external osc driver as an interrupt... I'm using it with a 32khz crystal for RTC functions, but running the PIC off of the internal 8mhz osc.

    If you aren't using the mclr as an input (you are leaving it open for mclr use) then you have nothing to worry about. It is only if you are using the mclr as something out of the ordinary. It has to do with the mclr pin allowing it to reset the pic to allow reprogramming.

  9. #9


    Did you find this post helpful? Yes | No

    Default

    Is there a mod that can be done to the normal JDM programmers ?

    Where can i find the new JDM programmer for me to build ?

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11


    Did you find this post helpful? Yes | No

    Default

    there is a mod for the jdm but the time messing with it, and the freeware software to work with it and adding configs for unsupported chips etc. you would be MUCH happier paying the 40 bucks for a PicKit2. seriously i have spent way too much time screwing about with mine to get it to be able to program a 16c717 and 18f4553 i'm buying one myself after christmas.

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yup that's what i repeat over and over here and there since awhile
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PIC Basic Code Understanding
    By pr2don in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th June 2010, 15:33
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. PIC Code Template
    By asguard in forum mel PIC BASIC
    Replies: 4
    Last Post: - 4th December 2006, 12:28
  5. Code for I2C Slave
    By Balachandar in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st November 2006, 19:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts