PBP and PBPL


Closed Thread
Results 1 to 40 of 46

Thread: PBP and PBPL

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    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 " !!!
    *****************************************

  2. #2


    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???

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

  4. #4


    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

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


    Did you find this post helpful? Yes | No

    Default

    Can we see the code that gave the errors?
    Dave
    Always wear safety glasses while programming.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Can we see the code that gave the errors?
    The code is not ready, not tested, except for i/o-extender, eeprom and rtc, the "big picture" is just written but not tested except for compilation:

    The attached code compiles without errors with PBP,
    but not with PBPL (gives those errors in #3)...

    Really hoping it reveals something
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    To be honest I have not played with USB yet, so I may be full of it as usual... but I may have found a solution.
    Read Steve's note on this post.
    http://www.picbasic.co.uk/forum/show...8&postcount=99
    Dave
    Always wear safety glasses while programming.

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