Why is my PIC18F452 reseting?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Vincent's Avatar
    Vincent Guest

    Exclamation Why is my PIC18F452 reseting?

    Hi this is my second posted Thread on this Forum.

    The problem is i belive my PIC 18F452 is reseting it's self every 20 to 30 interrupts it recives via RS232. Is this possible?
    Or is the reset a result off overflowing Stack?

    The µController has to carry out several HSEROUT and A/D operations after receiving an interrupt .
    I do not know if this data is stored on the PIC after ist send or read?

    Many thanks

    by NVM

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


    Did you find this post helpful? Yes | No

    Default

    everything is possible, your code will help us to point you on the most possible problem.
    Steve

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

  3. #3
    Vincent's Avatar
    Vincent Guest


    Did you find this post helpful? Yes | No

    Smile The CODE

    Thanks again mister_e!

    I would like to post the hole program CODE but it is to long!
    Im not sure whitch parts of the program are necessary?
    is there a posibility to send it to you?

    The program is the same like the one in my other posted thread
    "Controlling an 240x128 LCD touch panel"

    thanks

    by NVM

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


    Did you find this post helpful? Yes | No

    Default

    Hi NVM, Where i am right it's almost impossible to get in touch with all the hardware you have. I have 2-3 pending project for some user here (no no no not free ) and i have some daily 'asian medecine' session to take. Couldn't be impossible to check your whole code... but if it's a rushing project and it can be publish here, you can even use the file attachement and post the whole thing here.

    I sent you my e-mail in your PM.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    This does sound like stack overflow reset. You can turn this option off in config word for a quick test, but to fix it, make sure whenever you use a CALL or GOSUB, that you RETURN instead of GOTO to get back.
    Regards,

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

  6. #6
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default I use this to test a stack overflow

    Hi,

    Have a look at the code below and modify according to your needs to test a stack over/underflow

    Code:
    INIT:
    'BELOW IS A CHECK FOR STACK ResetERROR FOR DEBUG ************************************
    IF STKPTR.7 = 1 THEN        ' CHECK FOR STACK POINTER OVERFLOW
    HSEROUT ["STACK OVERFLOW"]  ' DUMP DATA TO LCD
    STKPTR.7 = 0                ' CLEAR STACK POINTER OVERFLOW BIT
    GOSUB DLY5K                 ' CALL THE 5 SECONDS DELAY SUBROUTINE
    ENDIF
    
    IF STKPTR.6 = 1 THEN        ' CHECK FOR STACK POINTER UNDERFLOW
    HSEROUT ["STACK UNDERFLOW"] ' DUMP DATA TO LCD
    STKPTR.6 = 0                ' CLEAR STACK POINTER UNDERFLOW BIT
    GOSUB DLY5K                 ' CALL THE 5 SECONDS DELAY SUBROUTINE
    ENDIF
    Regards

    Sougata

Similar Threads

  1. Serial communication with pic18f452
    By tamersoss in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th December 2007, 21:27
  2. communicating pic18f452 with pic16f877a
    By tamersoss in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th July 2007, 19:54
  3. migrating to pic18f452 from 16f877a
    By tamersoss in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th June 2007, 08:39
  4. PIC18F452 Compile Problem
    By scottl in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st October 2006, 10:47
  5. Dealy in turn ON of PIC18F452
    By genesis in forum General
    Replies: 1
    Last Post: - 13th October 2006, 10:40

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