PBP and PBPL


Closed Thread
Results 1 to 40 of 46

Thread: PBP and PBPL

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    PBPL has LONG (double-words) as a new data type. You don't need DIV32 when using PBPL. Just define your variables as LONGs and do the division.
    Thanks Charles!

    Yes I had one DIV32, commented it at got a bunch of errors (126) and warnings (220), 4 errors and 16 warnings . The errors:
    Error[126] \PBP\PBPPI18L.LIB 722 : argument out of range (34218 not between 0 and 32767)
    and the warnings (two kinds, for .LIB and .MAC):
    Warning[220]\PBP\PBPPI18L.LIB 788: address exceeds maximum range for this processor.
    Warning[220] c:\pbp\godiam.mac 1414: Address exceeds maximum range for this processor.

    This processor is PIC18F4550.

    So, what should I try next????

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by keymuu View Post

    So, what should I try next????
    Get rid of the DIV32 or do not use PBPL.
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Get rid of the DIV32 or do not use PBPL.
    Ok, that would of course solve the situation

    However, I have routines that need precise calculation where ... well 16 bit is not enough, I would need about 24 bits to calculate what I need to calculate.

    So, if Microchip provides a LONG variable for v2.50 users it should also work... or?

    What is wrong when getting those errors an warnings? Please help!

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by keymuu View Post
    So, if Microchip provides a LONG variable for v2.50 users it should also work... or?

    What is wrong when getting those errors an warnings? Please help!

    IF you use PBPL ...

    May be you should declare your DIV relevant vars as LONG ... no ???

    IF you use DIV32

    May be you've noticed it's ( ONLY ? ) a 31 x 15 bits operation ... Manual $ 4.17.8

    that need precise calculation
    This sentence always make me laugh !!! may we know about those calculations ???


    Alain

    PS:

    So, what should I try next????
    To re-arrange your program not to exceed the 32k limit ... probably some redundant or overkilling calculations ...
    BTW ... I remember Skimask ( Wish you a happy new year ,Ski ! ) wrote an interesting paper about that on this Forum ...
    Last edited by Acetronics2; - 15th January 2009 at 09:42.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    IF you use PBPL ...

    May be you should declare your DIV relevant vars as LONG ... no ???

    IF you use DIV32

    May be you've noticed it's ( ONLY ? ) a 31 x 15 bits operation ... Manual $ 4.17.8
    Yes, I know that and have build hundred of lines to calculate what I need (but have not tested that yet),
    in one place I need:
    '------- ex. L = 349,989/2 = 349989/2 = 174,995 => 174995
    '------- ' (L/2)^2 = (L/2) * (L/2) square it
    That should give 30 623 250 (=01 d3 46 12h)
    and this is not the only one.

    So it would really be nicer to use the LONG variable instead of doing tricks and getting the program longer.
    By tricking I mean something like this:
    lsb = L0.0 : mL0 = L0 >> 1 ' remember lsb, then shift lower 8 bits right
    mL0.7 = L1.0: mL1 = L1 >> 1 ' shift middle
    mL1.7 = L2.0: mL2 = L2 >> 1 ' shift higher 8 bits right

    Or saying it in other words if you can (on the upper level) do the same thing within 10 lines instead of 200 lines, why wouldn't you try to do so then?

    This sentence always make me laugh !!!
    So, you will live longer...

    may we know about those calculations ???
    I will send the formula later...

    To re-arrange your program not to exceed the 32k limit ... probably some redundant or overkilling calculations ...
    There still room for the program to grow. At the moment 28632 bytes used + 1k for the bootloader... so the limit is not close yet, but I think tricking would bring it fast closer

    BTW ... I remember Skimask ( Wish you a happy new year ,Ski ! ) wrote an interesting paper about that on this Forum ...
    What kind of story would that paper tell?

    Still I think, if Microchip provides PBPL then it also should work... you could convert your existing program to using LONG if you have use to it. If you have then remove your DIV32 (possible R0 and R2) and use LONG variables instead. Isn't that neat?

    Or do you not think so???

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    keymuu,

    Have you seen this?
    http://www.melabs.com/resources/articles/longs.pdf

    For what it is worth, I have been going the 18F way just so I can use LONGS and not have to do the "tricks".

    You still have to deal with the decimal point in the usual way, but we have to have a challenge some place
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    keymuu,

    Have you seen this?
    http://www.melabs.com/resources/articles/longs.pdf

    For what it is worth, I have been going the 18F way just so I can use LONGS and not have to do the "tricks".

    You still have to deal with the decimal point in the usual way, but we have to have a challenge some place
    Thanks Mackrackit.

    We do not have floating point variables so we have to deal with the decimal point somehow else. When you have enough bits (32) it is so easy to ... we have ten fingers

    I have not seen that earlier, I will print that article longs.pdf and read it tomorrow or so when I do not have my computer in front of me.

    So, is it really true that nobody can tell what caused the errors and warnings in #3 ...

    Please, if you can give some hints of what might cause those errors and warnings, please let me know

Similar Threads

  1. PbP usable releases ???
    By Acetronics2 in forum General
    Replies: 2
    Last Post: - 15th July 2009, 13:12
  2. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 10:22
  3. IF..AND/OR..THEN and PBPL
    By duncan303 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th January 2008, 16:45
  4. PBP 2.50 pbpw vs pbpl .exe
    By Archangel in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st September 2007, 15:28
  5. MCS+ with PBP 2.50
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st September 2007, 05:52

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