Pbp3.1.1


Closed Thread
Results 1 to 25 of 25

Thread: Pbp3.1.1

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    The K42 has builtin hardware context saving for both the high priority and low priority interrupts, which would make most of what DT-INTS does unnecessary. The list of registers it saves is pretty complete.

    I haven't looked at all the details, but it looks like you might get away with just calling the SavePBP/RestorePBP routines in ReEnterPBP-18.bas/ReEnterPBP-18LP.bas

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    Quote Originally Posted by tumbleweed View Post
    The K42 has builtin hardware context saving for both the high priority and low priority interrupts, which would make most of what DT-INTS does unnecessary. The list of registers it saves is pretty complete...
    But not the PBP system variables I suppose, right?

    These have to be saved and restored by the ISR.

    Ioannis

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    Quote Originally Posted by Ioannis View Post
    But not the PBP system variables I suppose, right?

    These have to be saved and restored by the ISR.

    Ioannis
    I can do a simple INCF _PBP_VAR in the ISR and then display the result on the LCD in PBP to see if it saved. I'll get to that shortly.

  4. #4
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    These have to be saved and restored by the ISR
    Right, like I said you'd have to call the SavePBP/RestorePBP routines in ReEnterPBP-18.bas/ReEnterPBP-18LP.bas like DT-INTS does to save the PBP system variables.

    The rest of what DT-INTS does (and some of SavePBP) would just be repeating what the hardware has already done.

  5. #5
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    I created a couple global variables, incremented in ISR and it worked.

    DispL VAR BYTE BANK0 SYSTEM
    DispH VAR BYTE BANK0 SYSTEM

    ;Vectored ISR for Timer 1
    INFSNZ DispL
    INCF DispH
    RETFIE 1

    In the Main Loop,

    DispVal.HIGHBYTE = DispH
    DispVal.LOWBYTE = DispL
    GOSUB Disp ;Display DispVal on LCD

    Of course, this is just a snippet of the whole code, but it worked. The variable DispL was incremented in the Vectored ISR without any special context saving.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    Since you're using assembly in the ISR there should be no issues as far as system variables goes. But, again, it's a completely different thing if start writing PBP code in the ISR.

    And just to be clear, it's got nothing to do with the variables YOU declare, it's the variables that the compiler declares and uses internally (you never see those) that's the issue and those are the variables that DT-Ints saves/restores for you when you tell it that you're going to use PBP in the ISR.

    The vectored interrupt system takes away the need to save the hardware registers and the need to "manually" poll each enabled interrupts in order to determine which one it was that tripped. It does however not solve the "problem" with PBP system variable being shared between main code and ISR code.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    Great! this is very good.

    Keep us updated please!

    Ioannis

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Pbp3.1.1

    I would be interested to :-
    see how you set the interrupt vector
    see how you determine the interrupt vector address
    know how you partition the memory
    know if pbp uses an ORG that will preserve all int vectors


    and as henrik observed your example would have worked on any chip with auto context save
    Warning I'm not a teacher

Similar Threads

  1. PBP3 Code Does not Compile with PBP3.1
    By RossWaddell in forum PBP3
    Replies: 5
    Last Post: - 2nd July 2017, 09:42
  2. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 17:05
  3. PBP3 and MPLAB 8.83
    By grahamg in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th February 2012, 14:04
  4. Pbp3
    By rcbandwidth in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th September 2011, 15:13
  5. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 18:09

Members who have read this thread : 2

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