Why is my PIC18F452 reseting?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    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

  2. #2
    Vincent's Avatar
    Vincent Guest


    Did you find this post helpful? Yes | No

    Thumbs up Thanks to all answers.

    Mots of my problems are solved...
    I should have posted earlier in this Forum.
    That would have saved me some sleepless nights.

    Thanks to all of you.

    I'll be back with better problems or better say tasks...


    good night

    by NVM

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