CALL instruction not working


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: CALL instruction not working

    Where is your RETURN statement in the routine "sub_error"?
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default Re: CALL instruction not working

    For the purpose of testing I just had it go into an endless loop in the subroutine.
    I've just added one in after "GOTO $" to rule that out but it's still resetting.

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: CALL instruction not working

    Are you sure, that you set up correct offset?
    Try to add hard coded address instead label.
    As I assume that flash adr 0 is not PC adr 0. Or I missed something?
    I'm also interested in your HW setup.

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default Re: CALL instruction not working

    I've spent a bit of time trying to get the debugger to work. I'm using an ICD3 but the dsPIC33E/PIC24E firmware seems to be quite buggy when using it as a debugger.

    It turns out that there was a bug in my custom compiler that was setting __SP_init and __SPLIM_init to 0. The PIC was correctly erroring because of a stack overflow.
    I've fixed the bug and it's all working now!


    @pedja089
    The main flash and auxiliary flash are both in the same flash space with the auxiliary section starting at 0x7FC000.
    The PC accesses both areas as if they are just 1 big area of flash so PC 0 would always be the start of the main flash.

    For the hardware, I'm using a custom PCB with the PIC24EP512GP806, an ENC28J60 with an RJ45 socket and a bunch of headers.
    It's currently plugged into a breadboard which gives me 2 LEDs that I've been using to "debug" the code

    I've uploaded a picture of the board if you're interested
    Name:  ETM2.jpg
Views: 1041
Size:  335.7 KB
    Last edited by The Master; - 13th February 2021 at 16:12.

  5. #5
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: CALL instruction not working

    I assume that you had PIC18 connected with external flash.
    I totally missed your first sentence in first post. Sorry about that.

Similar Threads

  1. 12F510 CALL subroutine problem ...
    By LakisFM1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th November 2011, 09:21
  2. how to establish data call ??
    By hjahshan in forum GSM
    Replies: 20
    Last Post: - 14th April 2011, 22:28
  3. PWM instruction not working as I expect
    By peu in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th January 2006, 19:39
  4. Replies: 3
    Last Post: - 15th December 2005, 07:31
  5. Missed call
    By Lotondo in forum GSM
    Replies: 1
    Last Post: - 29th September 2005, 15:39

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