after all ... PBP is not so bad ...


Closed Thread
Results 1 to 24 of 24
  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615

    Default after all ... PBP is not so bad ...

    Hi,

    I never had the time to make compiler comparisons ...

    but, today a friend of mine leaded me to :

    the Goal : read a voltage and display it as a heading ( boat autopilot app. ) and use a 16F819

    Result is astonishing :

    Another Basiç compiler ... 2504 Words ... The ' 819 is unusable !!!
    its " PRO " version ..... 1722 Words ...

    PicBasicPro ... ahaaaaa ...461 Words.

    Of course I can prove the test is true and honest ...

    Some Comments, chaps ???

    Alain
    Last edited by Acetronics2; - 1st May 2010 at 09:41. Reason: PbP result is 461 Words ... 514 is 16F877A !!!
    ************************************************** ***********************
    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
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Just curious about the hardware (16F819? LCD?), etc? Would like to compare it to my favorite C compiler and assembly language just for fun (grin)...

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mike, K8LH View Post
    Just curious about the hardware (16F819? LCD?), etc? Would like to compare it to my favorite C compiler and assembly language just for fun (grin)...

    Mike
    Hi, Mike

    Let's compare what can be compared ... won't you ???

    those BASIC tested compilers were proud to show on their site a totally subjective " side by side comparison " ... backdraw of Humour, eh !!!

    Now, i also use C ... and sometimes assembler ( under torture only ...) and know what can be obtained ...

    Note also THEIR C compilers @ 90% of examples need lots more room than my favourite PBP Compiler ... @ equal result.

    So, one seems to have to pay " whisles and bells " the price in bytes ... looks to be a question of compiler producer and not of language ...


    Were not here to re-start a Nth Compiler war ( really boring ...) ... but to tell ( and prove ! ) PBP works not so bad ... in the end !!!

    In the end ... you may choose the one you want, Mike ... nobody will criticize you.

    Alain
    Last edited by Acetronics2; - 1st May 2010 at 09:44.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  4. #4
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    I was genuinely interested in the application that you were trying to create. I apologize if it seemed I was embarking on a comparison war.

    Kind regards, Mike

  5. #5
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    What was the "other" compiler? I have PBP, but switched my primary compiler to Proton because I was running out of room on a project. It wouldn't fit with PBP, but it would with Proton. In fact, I saved about 20% with with switch... I had room for feature creep!

  6. #6
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,033


    Did you find this post helpful? Yes | No

    Default

    Hi,
    the Goal : read a voltage and display it as a heading ( boat autopilot app. ) and use a 16F819

    Result is astonishing :

    Another Basiç compiler ... 2504 Words ... The ' 819 is unusable !!!
    its " PRO " version ..... 1722 Words ...

    PicBasicPro ... ahaaaaa ...514 Words.

    Of course I can prove the test is true and honest ...
    Please publish your code example and name the compilers that you used. or your post leaves the reader to rely on innuendo and speculation.

    If your code example is valid and the compilers are genuine versions and have been used correctly, there is nothing to gain by not mentioning the names of the compilers that you tested.

    AS a moderator, you must make the effort to set a good example, when making a post on a subject that is obviously going to stor up some emotive discussion.

    Furter, if your comparisoons are valid, your post could easily become the core of an article in the WIKI or even an article in the catalogue section where we advertise and promote PBPro.

    Come on, you can do better, if the jobs worth doing, do it well. If you're going to promote PBPro in this way, lets see it done openly with transparency.

    Quote:
    Of course I can prove the test is true and honest ...
    Last edited by Acetronics2; - 1st May 2010 at 10:54. Reason: Lester's special request ....

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


    Did you find this post helpful? Yes | No

    Default

    Alain,

    That all is interesting but I have a question.

    Why did you modify someones post to post your test?

    I always hate it when a post has a major edit because there is not any notification of the edit. Doing a major edit to another s post is really out there.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Just for you Dave ...

    As requested ...


    want proof ??? Ok ... let's go !

    1St attempt : Mikrobasic 7.2 ...


    Code:
    program Gouvernail                                                                                                        ' program PiloteAT50
    '************************************************* ****************************
     ' microcontroleur : 16F819 sur EasyPic 5
     '
    ' Projet : PPE 2010
     '
    ' En entree : A0 Up3 = entree analogique
     '
     ' En sortie : portB Affichage des consignes "Babord et Tribord" sur lcd
     '
     '************************************************* ****************************
     'program PiloteAT50
     symbol Up3 = PORTA.0 ' tension analogique (<5V)
    ' déclaration des variables
     dim result  as word
     
     dim tension as longint
     dim angle   as longint
     
     dim text    as string[9]
     dim valeur  as string[11]
     
     const Vref = 5000
     
     '******************************************************************************
     sub Procedure Init ' Initialisation
     
     'CMCON = 7
     
     trisb = %00000000 ' portB en sortie
     trisa = %11111111 ' portA en entrée
     
    Delay_ms(500)
    Lcd_Config(PORTB, 3, 2, 1, 0, PORTB, 4, 6, 5) ' Initialize LCD connected to PORTB
     'LCD_init(PORTB) ' initialisation Lcd sur PortB
     
     Lcd_Cmd(lcd_Clear)
     Lcd_Cmd(lcd_cursor_off)
     
     end sub
     
    '*******************************************************************************
     main: ' ********* Principal *********
    '*******************************************************************************
     Init ' config. et init. du PIC
     
     while true ' début de la boucle
     
         result = adc_read(0)
         tension = result *  Vref /1024  ' en mv !!!
     
         '**************************************************************************
         ' < ou > 4.02 v ???    ( 1024 * 4.02/5 = 823 !!! )
     
         if tension < 4020 then
     
            text = " Tribord "
         else
            Text = "  Babord "
     
         end if
     '*****************************************************************************
     ' Calcul de l'angle
     
            angle = 3133 * Fabs(tension - 4020) / 120000
     '*****************************************************************************
     ' Affichage
     
            LongintTostr(angle,valeur)
     
            Lcd_out(1, 1, text)
     
            Lcd_out(2,1,valeur)
     
             delay_ms(100)
     
     wend
    end.
    1:1 E-0 Linker error: NOT ENOUGH ROM

    NOTA: 2504 Words compiled for a 16F877A

    2nd Attempt : MikroBasic 7.2 ... NOT USING Fabs () ... = PbP ABS()

    Code:
    program Gouvernail                                                                                                        ' program PiloteAT50
    '************************************************* ****************************
     ' microcontroleur : 16F877A sur EasyPic 5
     '
    ' Projet : PPE 2010
     '
    ' En entree : A0 Up3 = entree analogique
     '
     ' En sortie : portB Affichage des consignes "Babord et Tribord" sur lcd
     '
     '************************************************* ****************************
     'program PiloteAT50
     symbol Up3 = PORTA.0 ' tension analogique (<5V)
    ' déclaration des variables
     dim result  as word
     
     dim tension as longint
     dim angle   as longint
     
     dim text    as string[9]
     dim valeur  as string[11]
     
     const Vref = 5000
     
     '******************************************************************************
     sub Procedure Init ' Initialisation
     
    ' CMCON = 7
     
     trisb = %00000000 ' portB en sortie
     trisa = %11111111 ' portA en entrée
     
    Delay_ms(500)
    Lcd_Config(PORTB, 3, 2, 1, 0, PORTB, 4, 6, 5) ' Initialize LCD connected to PORTB
     'LCD_init(PORTB) ' initialisation Lcd sur PortB
     
     Lcd_Cmd(lcd_Clear)
     Lcd_Cmd(lcd_cursor_off)
     
     end sub
     
    '*******************************************************************************
     main: ' ********* Principal *********
    '*******************************************************************************
     Init ' config. et init. du PIC
     
     while true ' début de la boucle
     
         result = adc_read(0)
         tension = result *  Vref /1024  ' en mv !!!
     
         '**************************************************************************
         ' < ou > 4.02 v ???    ( 1024 * 4.02/5 = 823 !!! )
     
         if tension < 4020 then
     
            text = " Tribord "
            angle = 3133 * (4020 - tension ) / 120000
         else
            Text = "  Babord "
            angle = 3133 * (tension - 4020) / 120000
     
         end if
     '*****************************************************************************
     ' Calcul de l'angle
     
    '        angle = 3133 * Fabs(tension - 4020) / 120000
     '*****************************************************************************
     ' Affichage
     
            LongintTostr(angle,valeur)
     
            Lcd_out(1, 1, text)
     
            Lcd_out(2,1,valeur)
     
             delay_ms(100)
     
     wend
    end.
    0:0 S-100 Success (Release build) - Timestamp: 10:15:57
    0:0 W-101 Used ROM: 1774 (86%) Used RAM: 80 (31%)
    0:0 W-102 Free ROM: 273 (14%) Free RAM: 176 (69%)

    a small bit better ...

    3rd attempt : MikroBasic PRO 3.2

    Code:
    program Gouvernail
    ' program PiloteAT50
    '************************************************* ****************************
     ' microcontroleur : 16F819 sur EasyPic 5
     '
    ' Projet : PPE 2010
     '
    ' En entree : A0 Up3 = entree analogique
     '
     ' En sortie : portB Affichage des consignes "Babord et Tribord" sur lcd
     '
     '************************************************* ****************************
     'program PiloteAT50
     
     ' Lcd module connections
     
    dim LCD_RS as sbit  at RB4_bit
        LCD_EN as sbit  at RB5_bit
        LCD_D4 as sbit  at RB0_bit
        LCD_D5 as sbit  at RB1_bit
        LCD_D6 as sbit  at RB2_bit
        LCD_D7 as sbit  at RB3_bit
        LCD_RS_Direction as sbit at TRISB4_bit
        LCD_EN_Direction as sbit at TRISB5_bit
        LCD_D4_Direction as sbit at TRISB0_bit
        LCD_D5_Direction as sbit at TRISB1_bit
        LCD_D6_Direction as sbit at TRISB2_bit
        LCD_D7_Direction as sbit at TRISB3_bit
    ' End Lcd module connections
     
    ' Symbol Up3 = PORTA.0 ' tension analogique (<5V)
    ' déclaration des variables
     dim resulta  as word
     
     dim tension as longint
     dim angle   as longint
     
     dim text    as string[9]
     dim valeur  as string[11]
     
     const Vref = 5000
     
    '*******************************************************************************
    main:
    '*******************************************************************************
    ' Init ' config. et init. du PIC
    ' CMCON = 7
     trisb = %00000000 ' portB en sortie
     trisa = %11111111 ' portA en entrée
    Delay_ms(500)
    'Lcd_Config(PORTB, 3, 2, 1, 0, PORTB, 4, 6, 5) ' Initialize LCD connected to PORTB
     LCD_init() ' initialisation Lcd sur PortB
     Lcd_Cmd(_LCD_CLEAR)
     Lcd_Cmd(_Lcd_Cursor_Off)
     
    while true    ' début de la boucle
           resulta = adc_read(0)
           tension = resulta *  Vref /1024  ' en mv !!!
           '************************************************************************
           ' < ou > 4.02 v ???    ( 1024 * 4.02/5 = 823 !!! )
           if tension < 4020 then
              text = " Tribord "
              '*********************************************************************
               ' Calcul de l'angle
               angle = 3133 * ( 4020 - tension ) / 120000
           else
              Text = "  Babord "
              angle = 3133 * (tension - 4020) / 120000
           end if
       '*****************************************************************************
       ' Affichage
              LongintTostr(angle,valeur)
              Lcd_out(1, 1, text)
              Lcd_out(2,1,valeur)
               delay_ms(100)
    wend
    end.
    0 133 Compiled Successfully C:\Program Files\Mikroelektronika\ProjetsBPro\Gouvernail\Gouv ernail.mbas
    0 1143 Used ROM (program words): 1722 (84%) Free ROM (program words): 326 (16%)
    0 1143 Used RAM (bytes): 44 (18%) Free RAM (bytes): 196 (82%)

    a tiny little bit better ...

    4Th attempt : Our favourite PicBasicPro v 2.60 / MPASM/ MCS ( left MkB lines commented besides PbP lines ...)

    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 30/04/2010                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    'program Gouvernail                                                                                                        ' program PiloteAT50
    '*************************************************   ****************************
     ' microcontroleur : 16F819 sur EasyPic 5
     '
    ' Projet : PPE 2010
     '
    ' En entree : A0 Up3 = entree analogique
     '
     ' En sortie : portB Affichage des consignes "Babord et Tribord" sur lcd
     '
     '*************************************************   ****************************
     'program PiloteAT50
     
    @ ERRORLEVEL -306
    @ __config _HS_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _LVP_OFF & _CP_OFF
     
     entree var PORTA.0 ' tension analogique (<5V)
    ' déclaration des variables
    ' dim result  as word
     
    ' dim tension as longint
    ' dim angle   as longint
     
    ' dim text    as string[9]
    ' dim valeur  as string[10]
     
    ' const Vref = 5000
    result var word
    tension var word
    angle var word
    dummy var word
    vref con 5000
     
     '*************************************************  *****************************
     'sub Procedure Init ' Initialisation
     
     
    DEFINE  OSC 8
     
    CLEAR
    ;----[LCD definitions]------------------------------------------------------
    DEFINE LCD_DREG  PORTB          ' LCD Data port
    DEFINE LCD_DBIT  0              ' starting Data bit (0 or 4)
    DEFINE LCD_EREG  PORTB          ' LCD Enable port
    DEFINE LCD_EBIT  5              ' Enable bit  (on EasyPIC 5 LCD)
    DEFINE LCD_RSREG PORTB          ' LCD Register Select port
    DEFINE LCD_RSBIT 4              ' Register Select bit   (on EasyPIC 5 LCD)
    DEFINE LCD_BITS  4              ' LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2              ' number of lines on LCD
    DEFINE LCD_COMMANDUS 2000       ' Command delay time in us 
    DEFINE LCD_DATAUS 50            ' Data delay time in us 
    ;----[LCD definitions]------------------------------------------------------
    DEFINE ADC_BITS 10 ' set number of bits in result
    DEFINE ADC_CLOCK 3 ' set clock source
    ADCON1 = %10000000  ' right formatted
     
    ' CMCON = 7
     
     trisb = %00000000 ' portB en sortie
     trisa = %11111111 ' portA en entrée
     
    'Delay_ms(500)
    PAUSE 500
    'Lcd_Config(PORTB, 3, 2, 1, 0, PORTB, 4, 6, 5) ' Initialize LCD connected to PORTB
     'LCD_init(PORTB) ' initialisation Lcd sur PortB
     
    ' Lcd_Cmd(lcd_Clear)
    ' Lcd_Cmd(lcd_cursor_off)
    LCDOUT $FE,1
     
    ' end sub
     
    '*************************************************  ******************************
     main: ' ********* Principal *********
    '*************************************************  ******************************
    ' Init ' config. et init. du PIC
     
     'while true ' début de la boucle
     while 1=1
     
    '     result = adc_read(0)
        adcin 0, result
         dummy = result * Vref 
         tension = DIV32 1024  ' en mv !!!
     
         '*************************************************  *************************
         ' < ou > 4.02 v ???    ( 1024 * 4.02/5 = 823 !!! )
     
         if tension < 4020 then
     
            LCDOUT $FE,2, " Tribord "
         else
            LCDOUT $FE,2, "  Babord "
         endif
     '*************************************************  ****************************
     ' Calcul de l'angle
     
    '        angle = 3133 * abs(tension - 4020) / 120 / 1000
            dummy = 3133 * abs(tension - 4020)
            angle = DIV32 12000
            angle = angle /10
     '*************************************************  ****************************
     ' Affichage
     
    '        LongintTostr(angle,valeur)
     
    '        Lcd_out(1, 1, text)
     
    '        Lcd_out(2,1,valeur)
            LCDOUT $FE, $C0, dec3 angle
     
    '         delay_ms(100)
              PAUSE 100
     
     wend
    end
    Success ; 461 Words ...


    Really astonishing for such a simple work !!!, don't you think ???

    Alain

    PS; as we are under the 2K limit EVERYONE can verify it with the Demo available versions of MikroBasic and MikroBasic Pro ...
    Last edited by Acetronics2; - 1st May 2010 at 12:17. Reason: ask Dave !!!
    ************************************************** ***********************
    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 " !!!
    *****************************************

  9. #9
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    That is quite good. PDS only gets it down to 457, with 25 variables used.
    (PBP uses 32 variable bytes.) Where PDS really shines, however, is when the file gets very large, when you use interrupts (it's built in; Darrel's utility is not needed), and with great implementation of mixing words and longs.

  10. #10
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Might be interesting if you would post your findings over at the mikroE forums.

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    Might be interesting if you would post your findings over at the mikroE forums.
    I do think it would be a very bad idea ...

    totally unfair, overall ...

    much too wide a gap !!! , don't you think ???

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

  12. #12
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    It could be an incentive for them to improve their products to be as good as PBP.

  13. #13
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    Thank you for posting the examples. May I impose to ask about the analog signal you're measuring and how it relates to degrees port and starboard? It seems you're sensing the port and starboard switch over at 4.020 volts (adc value 823). I'm just wondering if you couldn't use a different formula to produce the same results and eliminate the step of converting adc values of 0..1023 to voltage 0..4995-mvolts).

    Kind regards, Mike

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    How about using in PBP 2.60 Long variables as in the MkB examples?

    Also the LongintTostr(angle,valeur) function if replaced with a lines of commands like in PBP to do the job, would make any difference? Can you commend this line and see how many bytes is the code from MikroBasic?

    I have a feeling that the comparisson is not exactly 'fair'.

    Ioannis

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Cool

    Quote Originally Posted by Mike, K8LH View Post
    Hi Alain,

    May I impose to ask about the analog signal you're measuring and how it relates to degrees port and starboard? ).

    Kind regards, Mike
    Hi, Mike,

    I'd also had liked a way to find some easier calculations ...

    but the guy who gave me the formulas ( a final project for student ...) gave it in the " ax+b " form ... with a and b being ... floating point numbers with 2 or 3 decimals !!!

    I already have extracted integer ratios to avoid any floating point calculations ... ...

    I wonder it is a voltage given by a pot ( position of a helm ) that is the input value...

    do not bash ... I perfectly know :

    1) the pot has 5% garanteed linearity ...

    2) as the input swings from 3.02v to 5.02 v ... the output value is ... 26 starboard to 26 port ...

    So, I know there's overkilling math here, but it can't be modified or re-studied because of the final projects rush ...

    The HEX just fits into the PIC Flash memory... so, it will be enough here ...


    being serious ... that doesn't rub the 4+ x ratio between compilers ... for same little job !!!

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

  16. #16
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    How about using in PBP 2.60 Long variables as in the MkB examples?

    Also the LongintTostr(angle,valeur) function if replaced with a lines of commands like in PBP to do the job, would make any difference? Can you commend this line and see how many bytes is the code from MikroBasic?

    I have a feeling that the comparisson is not exactly 'fair'.

    Ioannis
    Hi, Ioannis

    Longs with a 16F819 ??? ... you're serious ???

    use of strings to print to lcd is a quasi MUST with MkE compilers ... longint to str is only 221 bytes ... surely less than parsing number and converting into characters.

    ... and we're still far fom the PBP count ...

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

  17. #17
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Thank you Alain,

    Would this work?

    Regards, Mike

    Code:
    while 1=1
        adcin 0, result                      '
        
        if result < 823 then                 ' if < 4.020 volts then
            LCDOUT $FE,2," Tribord "         '
        else                                 ' else
            LCDOUT $FE,2,"  Babord "         '
        endif                                '
    
        angle = 13 * abs(result - 823) / 100 '
    
        LCDOUT $FE, $C0, dec3 angle          '
    
        PAUSE 100                            '
    wend
    Last edited by Mike, K8LH; - 1st May 2010 at 21:07.

  18. #18
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mike, K8LH View Post

    Would this work?
    Hi, Mike

    Of course it can be convenient ...

    just for the fun ... the initial query was :

    If tension < 4.02 v , angle=(-77/2.8952)*tension+(100.5/0.94) ...

    so, we were really far from your " simplified " formula ( that fits perfectly well, with its < .5 degree error !!! )

    ... some comments about our new students ???? ...


    Back to our Compilers ... MkBasic 7.2 now shows ... 1001 Words , MkBasicPro ... 601 Words !!! ( using WORDS ); to answer Ioannis, we loose here 1/2 degree in the result ... so, depending on the resolution required, ( 1 or .1 degree), program size changes a lot with MkE compilers !!!

    PbP " only " 470 Words ... always is the winner.

    Alain
    Last edited by Acetronics2; - 2nd May 2010 at 09:56.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  19. #19
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    It would be nice to see a comparison of some programs that are more simple such as flashing an LED
    with an IF/THEN statement,
    or printing HELLO WORLD to an LCD.

    Then disassembling the hex file to asm and looking at the results.

  20. #20
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Art View Post
    It would be nice to see a comparison of some programs that are more simple such as flashing an LED
    with an IF/THEN statement,
    or printing HELLO WORLD to an LCD.

    Then disassembling the hex file to asm and looking at the results.
    Hi, Art

    Would be a huge work to test and compare the most used functions of a selection of compilers, don't you think ???

    ...

    I think the analyst's work and programmer's way of coding are far away the first reasons for huge or compact programs ...
    we just got the proof here ... some lines ago ...

    add to that, compilers always improve ... ( MkBasic 7.2 to MkBasicPro show a neat difference, CCS did so some months ago, PBP 2.60 enhanced some functions to save Program Words too ... ( WRITE/READ i.e ) ...
    so, the time you write it, it's true ... but few months later, It's changed !!!

    Alain
    Last edited by Acetronics2; - 2nd May 2010 at 11:04.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  21. #21
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    ... MkBasic 7.2 now shows ... 1001 Words , MkBasicPro ... 601 Words !!! ( using WORDS ); to answer Ioannis, we loose here 1/2 degree in the result ... so, depending on the resolution required, ( 1 or .1 degree), program size changes a lot with MkE compilers !!!

    PbP " only " 470 Words ... always is the winner.
    Bravo Alain!!!

  22. #22
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    après quelques tortillages de cerveau ...

    on se rend compte que " angle " passe de 26 tribord à 26 babord pour la tension d'entrée qui passe de 3.02v à 5.02v , ce, de façon linéaire ...

    si l'on y regarde de plus près ... et ,compte tenu de l'affichage en degrés, sans décimales ...

    ça nous fait tout simplement ...

    26 degrés de variation pour 200 points de variation du résultat de conversion ...

    d'où ... la fabuleuse équation devient tout simplement :

    angle = 13 * ABS ( result-823 ) / 100 ...

    Qui a éclaté de rire ???
    Hi Alain,

    Was it too late for the original student to use this new formula considering the time constraints you mentioned?

    Regards, Mike
    Last edited by Mike, K8LH; - 4th May 2010 at 13:32.

  23. #23
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Mike, K8LH View Post
    Hi Alain,

    Was it too late for the original student to use this new formula considering the time constraints you mentioned?

    Regards, Mike
    Halas yes, Mike ... He PMed me he had no time to change his report and explain how to simplify the formula, once having seen the practical result, so he had to use the whole original formula for programming ...

    despite I sent him the reduced program.

    no " magics " allowed in such reports ...

    he's just authorized to mention the soft can be modified and reduced , while presenting his work at the blackboard ... and next year students will make the mod ...

    Alain

    But ... being honest ... you've cheated a bit !!!
    Last edited by Acetronics2; - 4th May 2010 at 16:13.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  24. #24
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    But ... being honest ... you've cheated a bit !!!
    How so? If you mean that I took advantage of all your hard work and careful analysis when I simplified the formula then you are correct (LOL).

    Quote Originally Posted by Acetronics View Post
    2) as the input swings from 3.02v to 5.02 v ... the output value is ... 26 starboard to 26 port ...
    Your summary made it easy to recognize the ralationship of 52° spread across 100 (8-bit) or 400 (10-bit) ADC counts. You really should have spotted this yourself when you wrote it (LOL).

    Anyway, I'm sorry the student could not take advantage of the simplified formula.

    Regards, Mike

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