Mathematics and remainder for PLL MC145158


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I've been found out. I guess I can take those pins out of my Rhinoceros doll now.

    While the PBPPICxx.RAM declares the system variables, the PBPPICxx.LIB and PBPPICxx.MAC files are where you'll find out how they are used.

    For instance, with the DIV32 command on an 18F part... Open up the PBPPIC18.LIB file and search for DIV32. You'll find this header in front of the code for the DIV32 command.
    Code:
    ;************************************************
    ;* DIV32      : 31 x 15 divide
    ;*                                    
    ;* Input      : R0, R2 = 32 bits 
    ;*            : R1 + 1, W = divisor
    ;* Output     : R0 = quotient    
    ;*            : R2 = remainder      
    ;*                                        
    ;* Notes      : Uses result from MUL. 
    ;************************************************
    From that you can see that R2 is the remainder of a DIV32, even though it's not mentioned anywhere in the manual.

    Most of the PBP macros have a header showing the input and output variables, but not necessarily all the system variables that are used by that routine. For that you have to digest the code and follow subroutine calls.

    As far as I know, there is no list of macro's or the system variables that they use. My guess is that it would create a tech support nightmare for them if they put that kind of stuff in the manual. Can't blame them.

    <br>
    DT

  2. #2
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Smile

    aaaahhh..... it's a dark mysterious art. I shall take your teachings and proceed with caution. As for the pins.... I'll consider it some kind of hazing/right of passage ritual. Seriously... thanks for the info.

Members who have read this thread : 1

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