PIC keeps resetting when executing subroutine


Closed Thread
Results 1 to 16 of 16

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Just for fun, replace the tranistor driveres, buzzers, lamps with LEDs.
    Could still be a hardware problem and this will tell.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Dec 2003
    Location
    WI
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    I can remove the buzzer and lamps by unplugging a connector and the PIC still resets as I can see what's going on with the LCD screen. I tried a different computer and the result is the same.....

  3. #3
    Join Date
    Dec 2003
    Location
    WI
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Maybe you are browning out due to inadequate power supply
    I checked that also with my scope. Power is solid.

    I am using a 2A DC/DC converter PT6212E-5 on my circuit board with plenty of bulk capacitance. I have used these parts on many of my other PIC projects without problems. I am using a 3S1P Lipoly battery pack that can supply 30A cont current for my 12V input until it can be installed. I am using PBP V2.46 with the patch installed and the latest beta programming software with my epic programmer. The epic software on CD V3.30 gives the same reset problem...

    Jason

  4. #4
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I know the following is commented out, but not sure what is going on here:
    Code:
    'ADCON0 = %11000001
    'ADCON1 = %10001110
    
    'trisa = %00001110
    'trisb = %11110111
    You want to make sure all the analog inputs (ADC and Comparators) are set to digital. Also I think your TRIS directives are backwards (i.e. desired output are inputs and viceversa). Again this is commented out, but you should be defining these things at the beginning.

    Not sure what the real problem is, but somehow I think you are having a stack overflow.

    Try replacing the "GOsub warning" with "GOto warning"; and "RETURN" with "GOto monitor".

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


    Did you find this post helpful? Yes | No

    Default

    Try the attached file removing the .txt

    Also as languer noted, your TRIS set up is commended out. Why? According to your variables, there is a conflict with the TRIS settings. Perhaprs an input is not biased and seen as high or low irrelevant what you really do on the pin.

    Ioannis
    Attached Files Attached Files
    Last edited by Ioannis; - 26th August 2009 at 10:39.

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis, I would also modify label light as per the attached code, because otherwise if portA.0 is zero then program will put high binlight and end.

    Code:
    light:
    if PORTA.0 = 0 then
    high binlight
    else
    alarm = 0 
    endif
    GOTO Monitor
    
    end
    Al.
    Last edited by aratti; - 26th August 2009 at 12:16.
    All progress began with an idea

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Nice Al. I missed that!

    Ioannis

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. 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
  3. PIC chip resetting. Very weird
    By The Master in forum Off Topic
    Replies: 0
    Last Post: - 28th October 2007, 17:07
  4. Pic resetting
    By malc-c in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st January 2007, 21:00
  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