Stopping at 3 minutes!!!


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Stopping at 3 minutes!!!

    if calFlag = 0 then
    goto CalSensor
    else
    gosub ReadSensor
    endif
    You could try changing this gosub to a goto ReadSensor.

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Stopping at 3 minutes!!!

    Hi,

    Without looking at the PIC's datasheet I think that the problem might be with the following line

    ADCON1 = 255 ' Make everything digital (no analog)

    Don't you need to define PORTA.0 as analog?

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Stopping at 3 minutes!!!

    Hi,
    Just a thought and question:
    Are you sure that it is the PIC that stops? I've never used the MCS Debugger but is it possible that IT is either stopping itself (so that you THINK the program has stopped) or perhaps IT is actually stopping the PIC? Have you tried running it without the ICD?

    And, what others have said: ALL subroutines to which you jump with a GOSUB must, at some point, end with a RETURN or bad things will happen. I haven't looked that close at your code but perhaps you've just been "lucky" that it works and that after three minutes there's been exactly the amount of GOSUBS without RETURN to make the stack tip over. I don't know, just thinking out loud.

    /Henrik.

  4. #4
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Stopping at 3 minutes!!!

    Hi All!
    Again my sincere thanks to everyone! For Robert, the whole "system" is digital and there is no analog. The sensor only puts out digital information. Yes, it appears that the "Gosub" where Jerson located it was the error! Changed it to a "goto" and now everything runs longer than 3 minutes! FYI, the PIC never stopped running as Mclk would continue to change just the "FromSensor" would stop changing. So Henrik you were right (as usual!) I had just been lucky. By the way, I put everything on a small board, added a bunch of capacitor (probably overkill) so at the input and output of the TXB0101 there are a 470mf, 100mf tantalum, 01 ceramic, and on the bottom of the board, a 1mf tantalum on the input and output of the MCP1700-3002E voltage regulator! Best to all, Ed

Similar Threads

  1. Stopping repeated messages
    By GatorGuy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 20th October 2011, 19:40
  2. Stopping a roll over when incrementing a count
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th May 2011, 22:06
  3. Help with stopping a loop with a serial receive on 16F876.
    By Ceetee in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 28th December 2010, 19:48
  4. 10,20,30,40 minutes
    By helena in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st March 2007, 12:04
  5. stopping USART setup
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th December 2003, 19:29

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