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


Closed Thread
Results 1 to 24 of 24

Hybrid View

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

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


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

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

  4. #4
    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!

  5. #5
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,046


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

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

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


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

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