Freezing PIC !


Closed Thread
Results 1 to 16 of 16

Thread: Freezing PIC !

  1. #1
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73

    Question Freezing PIC !

    Hi all,

    I run into a very strange thing and I’m stuck. The following has happened 3 or 4 times before and again today and I cannot figure out the reason why: Suddenly the PIC freezes after I transferred to it a newly compiled program. It does not help to reset or cycle power, its frozen solid. There are no errors when compiling (MCS+/MPASM) and non from the programmer and its software (WISP648/xwisp2 ver 1.9.5)! Every time it has happened I have ended up having to re-installing MPLAB, PBP and MCS. After this tedious manoeuvre I re compile the program and the PIC come to life again. This is no different with another PIC, another circuit or a different program and it can strike at any time (at least I haven’t noticed any pattern yet). I have upgraded my XPP to service pack 3 but this made no difference.

    So.. my dear friends, have anyone have experienced something similar or have got any clues?

    Thanks!

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    We have no program to view!!!
    We have no idea which PIC you are using!!!
    We have no idea what this PIC is supposedly trying to accomplish!!!
    Are you writing over the code space in the PIC (writecode, etc)?
    Are you sure your power supply is solid?
    Can you pull the PIC out, put it back in and have it work again?
    Is this device attached to a PC most of the time?
    So, while you included a lot of information, I don't think the bulk of it is of any help.

  3. #3
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Hi skimask,

    There’s no program to view since it can happen with any program from a simple blink a LED to slightly more advanced stuff.
    As mentioned it’s not device related since it happened with different PIC’s 16F648, 16F88, 16F688 and 16F886 if they have something common. I have tried to remove pull-ups and pull downs to no avail. The program is verified 100% OK by the programmer everytime.
    I am not exactly sure what you mean by “writing over the code space”, I am a rookie and I’m not challenging the boundaries in any way (as far as I know).
    The power is good and solid according to my scope and hasn’t caused any glitches before.
    I haven’t tried to pull and reinstall the PIC, it’s a proto board and the programmer is permanently connected (ICSP kind).
    It is connected to my laptop while I am trying out different programs.

    Thanks!

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Does your programmer have a "erase before program" option?
    And is it set to erase?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi PICante,
    You know . . . I'm thinking. . . when you set all that stuff (programs) up in your PC it returns everything to default settings, and then you may or may not go in and rearrange things to your liking, Where am I going with this you say? Maybe your programmer is somehow getting changed from intel hex file output to something else. I think in MCS, under view, program options or whatever it says (I am using my wife's computer so I am telling you this from memory), anyway in there where you change assemblers, there are check boxes which set the assemblers output type, and maybe it is getting it's settings changed.<br>
    Edit: on my own computer now. . . Open up MCS, click on the tab marked View, Scroll down the list to "Compile and Program Options" click on this and a window will open, Under the Blue bar labled Compile and Program Options are 3 tabs. Click on the tab marked Programmer. On the lower 1/2 of this tab, right side are 3 check circles, marked as follows INHX8M , INHX85, and finally INHX32. The first one marked INHX8M should be checked.<br> Check this as the source of your problem.
    Last edited by Archangel; - 13th September 2008 at 08:02.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Hi Dave & Joe,

    No matter which tab (Compiler, Assembler or Programmer) the setting is INHX8M. The alternatives in my version are INHX8M, INHX8S and INHX32. However this felt like closing in on it since I can program the PIC successfully with any file not compiled after this “disease” strikes.

    The programmer performs a (target erase) before slamming the new stuff, the “DOS” window for the programmer looks like this:


    Code:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corporation
    
    C:\PIC>set XWISP2=port 3
    
    C:\PIC>x 64
     xwisp2 version 1.9.5 for Windows (Jan 24 2008, Open Watcom C/C++ 1.70)
    File 64.hex loaded and is Intel Hex format conforming
    Detected programmer: Wisp648, firmware version 1.23
    Target: 16F688 revision 06 (ID=1186)
    Target erased
    Transferring program to 16F688 via Wisp648
    Transferring program memory...100%
    Verifying program memory......100%
    Transferring data memory......100%
    Verifying data memory.........100%
    Transferring ID memory........100%
    Verifying ID memory...........100%
    Transferring fuses memory.....100%
    Verifying fuses memory........100%
    Write-Verify operation terminated successfully in 3.58 seconds
    Putting target in run mode
    xwisp2 terminated successfully in 5.30 seconds

    Thanks guys!

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi, Picante

    At First,You should try to read the device and compare its memory to the "original" HEX ...

    with another programmer ...

    CONFIG Word writing ( or loading ) problem ???

    My easypic5 made it to me once or twice ... as the config word location depends on which IDE was used ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Bonjour Alain,

    So, what you suspect is that something changes in the HEX file while transferred to the device?

    Thanks!

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Something like that ... I know some IDEs which place the config word in another file than the HEX , whose programmer often losts the "header file" ( where config is located ) location...

    most of time when there has been compilation errors before ... and an errorless compilation (since the IDE opening ) is always followed by a good chip programming.


    Ahhh ... reliable IDE's ... where are you ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Thanks Alain,

    I am not sure how you mean: “most of time when there has been compilation errors before ... and an errorless compilation (since the IDE opening ) is always followed by a good chip programming”… and where exactly do you suggest I look for the misplaced file in my environment?

    Remember I am kind’ a green in this area! :-)
    Last edited by PICante; - 14th September 2008 at 15:35.

  11. #11
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    it’s a proto board and the programmer is permanently connected (ICSP kind).
    This would be my 1st suspect. If the device programmer isn't releasing /MCLR it would
    cause it to hang. It may also be causing problems by leaving it connected to the PIC pgm
    and data pins.

    Have you tried disconnecting your programmer & resetting power to your proto board?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  12. #12
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce,

    Yes I have tried this even though this programmer is supposed to be internally disconnected as it puts the PIC in run mode. I also tried to removed pull-ups and pull-downs while programming.
    However as mentioned before the PIC accepts and run any program not compiled after this “disease” strikes? And this includes programs running in the exact same hardware.

    Thanks Bruce.

  13. #13
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Strange problem for sure. I would create two copies of the same program. Something simple
    like blink1.bas and blink2.bas. Compile blink1.bas and keep it in a separate directory outside
    of my usual code files directory.

    Compile blink2.bas and compare the two .hex files. The next time this happens, recompile
    blink2.bas and compare the .hex files again.

    If they're different you have it narrowed down to some part of the compile process. That
    should make it easier to nail down.

    I would also try reinstalling stuff one at a time. I.E. reinstall MCS, then test it before you
    reinstall PBP or MPLAB. It may be only one of these getting screwed up.

    I had some odd problems recently after installing XP service pack 3 where XP would not allow
    me to save a ton of various file extensions. I had to do this;
    http://www.winhelponline.com/blog/re...in-windows-xp/
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  14. #14
    Join Date
    Nov 2007
    Location
    Chicago
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile Freezing PIC

    I have experienced this when my programming cable is left plugged into the board.
    It doesn't release the PIC from reset is my theory.

    Also check to be sure your haven't left your PIC programmed for debug.
    Not sure that causes anything your experiencing but I had done that once before and while running the PIC would occasionally lock up and have to be reset.

    Good Luck

  15. #15
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Good point on the debug thing. A while back someone here was having a similar problem
    when using MCS to compile.

    They were clicking on ICD Compile/Program VS compile/program. And of course the PIC
    did nothing since it wasn't being controlled by the MCS ICD.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  16. #16
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Talking Back on tracks!

    It’s now all re-installed and works just fine again! Tried different variations of hardware and software but I couldn’t provoke it to fail again. There are no problems leaving the programmer connected all the time, the PIC starts running as soon as the programmer is finished. Only difference now is a slightly newer version of MPLAB the 8.10. I have followed Bruce advice to create two copies of a simple program and store one of them in a safe place if (God forbid!) it ever happens again.

    Wayne>
    Once I made a mistake using an NC micro switch on one of the pins used by the programmer and the programming failed. I can imagine some programmers can when connected disturb the PIC in a similar way. When I discovered my mistake I just needed to push and hold the switch while the programmer was running and it worked fine. (I took me awhile to find it though!).

    Thank you very much guys for being here!

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. 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
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23: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