SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop

    Then what is the purpose of using a PBP compiler if it is not taking care of such cases?

    I may want (and have needed in the past) very fast loops. It is the responsibility of the compiler to add that @clrwdt in between. Not mine. After all if I wanted to mess with assembly I would not use PBP, right?

    That is why I see it as a bug.

    Maybe I am wrong though...

    Ioannis

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop

    PBP does handle it in, dare I say, >99% of cases. Here's one, fairly unrealstic case, where it doesn't.
    I don't think PBP analyses the code in the details and determine exactly where to insert CLRWDT, I think it's more in line with what Richard says that the macros used by the various PBP statements either included a CLRWDT or they don't. When they get combined into a larger assembly listing it's "sprinkled" with CLRWDT instructions.

    In this case the code resulted in assembly listing without any CLRWDT inserted. During >20 years of use I've never had that problem. That doesn't mean no one else have - apparently.

    I mean, if you REALLY wanted to squeeze the most out of the PIC you'd turn off the WDT anyway in order to not waste time clearing it.

    Out of curiosity, can you post an example of such a tight, endless loop, that you've used?

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop

    If compiler does not analyze this case then it is a problem. I really cannot remember having such a problem over my 25+ years of using PBP.

    Will try to find that tight loop I tried many years ago when discussed it with Darrel and maybe it was on a F628 chip.

    Will need time for this as it was long time ago...

    Ioannis

  4. #4
    Join Date
    Aug 2011
    Posts
    457


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop

    I may want (and have needed in the past) very fast loops. It is the responsibility of the compiler to add that @clrwdt in between. Not mine.
    I disagree. If the compiler adds a CLRWDT in between every single instruction then there's no point in having it in the first place.
    It's not going to detect a "fast loop" you make in your code.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - PIC seems to RESET unless I add a PAUSE in Mainloop

    I do understand fully. But also think there is a way compiler can detect that when needed. Sure it should not fill all over the place the CLRWDT!

    Ioannis

Similar Threads

  1. Unsupported new PIC 16F18015 - how to add?
    By wjsmarine in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th May 2023, 12:24
  2. Outside the Mainloop
    By pescador in forum General
    Replies: 10
    Last Post: - 26th April 2016, 18:34
  3. Replies: 6
    Last Post: - 28th October 2014, 07:08
  4. pic reset sometimes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd January 2008, 18:27
  5. Pic - reset
    By jrt4fun in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 19th September 2006, 20:12

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