Some serious errors in proton 3.7.0.3


+ Reply to Thread
Results 1 to 9 of 9

Thread: Some serious errors in proton 3.7.0.3284 days old

  1. #1
    Junior Member atomix's Avatar
    Join Date
    Jul 2012
    Posts
    48
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Some serious errors in proton 3.7.0.3

    Example 1:

    Code:
    Device 18F46K22
    
    Declare Xtal = 64
    Declare Optimiser_Level = 3
    Declare Float_Display_Type = LARGE
    Declare MemWrite_Int_Control = 0
    
    
    '----------------------------------------------------------------
    Declare LCD_DTPin LATB.4
    Declare LCD_RSPin LATB.1
    Declare LCD_ENPin LATB.2
    Declare LCD_Type 0
    Declare LCD_Interface 4
    Declare LCD_Lines 2
    Declare LCD_CommandUs 2000
    Declare LCD_DataUs 50
    
    
    Dim mkS_ALL As SDword
    Dim Temp As SWord
    Dim LEV_SALT As SByte
    Dim tmpW1 As Word
    Dim tmpB1 As Byte
    
    
    Dim Reactor_Volt[9] As Word
    Dim Reactor_Curr[9] As SWord
    
    
    Symbol mkS_Min     = -200000
    Symbol mkS_Max     = 200000
    Symbol mkS_nor     = 200
    
    
    
    
    '----------------------------------------------------------------
    ANSELA = %00101001  :  LATA = %00000000  :  TRISA = %11101001
    ANSELB = %00000000  :  LATB = %00000000  :  TRISB = %00000000
    ANSELC = %00000000  :  LATC = %00000001  :  TRISC = %11000100
    ANSELD = %00000000  :  LATD = %00000000  :  TRISD = %00000000
    ANSELE = %00000010  :  LATE = %00000000  :  TRISE = %00001010
    
    
    CM1CON0 = %10011100  :  CM2CON1 = %00110000  :  CCPTMRS0 = %10001000  :  INTCON.6 = 1  :  SLRCON = 0
    T1CON   = %10000011  :  T5CON   = %10000011  :  T4CON    = %00000111  :  T6CON  = %00000100 
    PR6 = 127  :  CCP3CON = %00001100  :  CCPR3L = 0   : ECCP3AS = %00010000
    CCP2CON = %00001100  :  CCPR2L = 255 : OSCCON = %01111100  :  OSCTUNE.6 = 1 : CCPR2L = 30
    
    
    Clear
    DelayMS 300
    Cls
    
    
    
    
    '----------------------------------------------------------------
    Print At 1,1, "Err: "
    
    
    mkS_ALL = -1000  :  If mkS_ALL > mkS_Max Then Print "1 "
    
    
    mkS_ALL = 1000   :  If mkS_ALL < mkS_Min Then Print "2 "
    
    
    LEV_SALT = -10  :  tmpB1 = 100  :  If LEV_SALT > tmpB1 Then Print "3 "
    
    
    Temp = -10  :  tmpW1 = 100  :  If Temp > tmpW1 Then Print "4 "
    
    
    tmpW1.SWord = -100  :  If tmpW1.SWord > mkS_nor Then Print "5 "
    
    
    
    
    tmpW1 = VarPtr(Reactor_Curr) - VarPtr(Reactor_Volt)
    
    
    Print At 2,1, "Size 18 <> ", Dec tmpW1
    
    
    ' in proton 3.6.2.7 => size = 18
    ' in proton 3.7.0.3  => size = 20

    Example 2

    Code:
    Device 18F46K22
    
    Declare Xtal = 64
    Declare Optimiser_Level = 3
    Declare Float_Display_Type = LARGE
    Declare MemWrite_Int_Control = 0
    
    
    '----------------------------------------------------------------
    Dim TBLPTR  As TBLPTRL.Word
    Dim tmpB1 As Byte
    
    
         
    ' it works correctly in proton 3.6.2.7
    '$define Ajax_Comp(P1,P2)        Ajax___Comp P1 P2
    
    
    ' it works correctly in proton 3.7.0.3  (need to add a second strange "Then")
    $define Ajax_Comp(P1,P2)        Ajax___Comp P1 P2 Then
    
    
    
    
    '----------------------------------------------------------------------------
    Ajax___Comp Macro P1,P2
        #if (Prm_Count > 1)    :   Lfsr 0, (P2)             : #endif
        #if (Prm_1 == Word)    :   Word_Word  P1, TBLPTR    : #endif
        #if (Prm_1 == Char)    :   label_word P1, TBLPTR    : #endif
        #if (Prm_1 == Label)   :   label_word P1, TBLPTR    : #endif
        #if (Prm_1 == Num8)    :   Num_Wreg P1  :  WREG = POSTINC0 - WREG   : #else :   GoSub Ajax__Comp   : #endif
        #if (Ajax___Comp_RETURN == 1)   :   Wreg_Byte Return_Var   : #endif
    Endm
    
    
    
    
    '----------------------------------------------------------------
    If Ajax_Comp("text") = 0 Then
        tmpB1 = 1
    Else
        tmpB1 = 2
    EndIf
    
    
    Stop
    
    
    
    
    '----------------------------------------------------------------------------
    Ajax__Comp:
        EECON1 = 128  :  WREG = 0
        Do
            Tblrd*+  :  If TABLAT = 0 Then Break
        Loop Until TABLAT <> POSTINC0
    Return
    examples.zip

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    557
    Thumbs Up
    Received: 36
    Given: 25
    Total Downloaded
    4.40 GB

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    Hi Atomix, I don't know if it will make any difference to your results, but there is a version 3.7.0.4 available - might be worth a try.

    I also see you have the line....

    Declare Float_Display_Type = LARGE

    I can only find reference to fast or standard in the manual i.e.

    Declare Float_Display_Type = FAST

    It might also be worth temporarily removing the code optimisation declare.


    Regards,


    Bob

    Last edited by Mellbreak; 28th February 2019 at 20:10.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,426
    Thumbs Up
    Received: 296
    Given: 142
    Total Downloaded
    1.68 GB

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    They are not serious errors. :-)

    The code has increased by 2 on that device because it only contains 1 SLRCON SFR. The compiler now alters the SLRCON SFRs to make pins TTL by default, instead of the Slew, when it also turns the pins to digital and disabled comparators etc... On some devices that have the SLRCON for more ports, the code will increase slightly more. This is a very silly thing that Microchip did with devices. It sets the Slew rate on by default, so the pins are no longer fully TTL on power-up. I found this out when I was writing code that did not work when the code was OK, then I found the SLRCON SFRs and found that the voltage to the pin was slightly lower through a resistor divider, but it should have worked for TTL. Then I found out that slew rate was on by default, and disabling it made the code work! So I added it to the compiler's pre-SFR setup so that others don't come stuck with it.

    I've corrected the macro anomaly, and this was due to a single misplaced "else" in the conditions parser. A single else in thousands of lines of code! can cause some weird problems.

    I'll have a patch for App.exe ready to download as soon as I correct the expression anomaly, so it may be tomorrow.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Junior Member Hiddenman37's Avatar
    Join Date
    Jan 2019
    Posts
    3
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    I'm using 18F26K22 and ssd1306. I have the GraphicSSD1306_v1.10 library. The addition process does not work. Never changed DigitPosX value. The following are sample code and asm equivalents.

    Code:
    Setup_Kp:    
        GoSub  Baslik
        DigitString= Str$(Dec4 pKP)
        DigitPosX = fRound((128 - (Len(DigitString)*10))/2)
    _Setup_Kp:    
        SelectFont(System_10)
        Print At 25,17, "K p    S e t u p"
        
        Print At DigitPosX,40, DigitString[0]  
        
        DigitPosX = DigitPosX + 10
        Print At DigitPosX,40, DigitString[1]
        
        DigitPosX = DigitPosX + 10
        Print At DigitPosX,40, DigitString[2]
        
        DigitPosX = DigitPosX + 10
        Print At DigitPosX,40, DigitString[3]
        
        DigitPosX = DigitPosX + 10
        Print At DigitPosX,40, DigitString[4]
        
        RefreshDisplay()
        DelayMS 1000
    
    
    GoTo _Setup_Kp
    Code:
    F1_000851 equ $ ; IN [PID_CONTROL_V4.BAS] PRINT AT 25,17, "K P    S E T U P"    
        movlw 25
        movwf GEN,0
        movlw 17
        call [email protected]
        movlw 11
        movwf GEN4H,0
        movlw 234
        movwf GEN4,0
        call __print_flash_string__
    F1_000853 equ $ ; IN [PID_CONTROL_V4.BAS] PRINT AT DIGITPOSX,40, DIGITSTRING[0]
        movff DigitPosX,GEN
        movlw 40
        call [email protected]
        movlb 5
        movf DigitString#0,W,1
        call Print
    F1_000855 equ $ ; IN [PID_CONTROL_V4.BAS] DIGITPOSX = DIGITPOSX + 10
        movlw 10
        addwf DigitPosX,F,1
    F1_000856 equ $ ; IN [PID_CONTROL_V4.BAS] PRINT AT DIGITPOSX,40, DIGITSTRING[1]
        movff DigitPosX,GEN
        movlw 40
        call [email protected]
        movf DigitString#1,W,1
        call Print
    F1_000858 equ $ ; IN [PID_CONTROL_V4.BAS] DIGITPOSX = DIGITPOSX + 10
        movlw 10
        addwf DigitPosX,F,1
    F1_000859 equ $ ; IN [PID_CONTROL_V4.BAS] PRINT AT DIGITPOSX,40, DIGITSTRING[2]
        movff DigitPosX,GEN
        movlw 40
        call [email protected]
        movf DigitString#2,W,1
        call Print
    F1_000861 equ $ ; IN [PID_CONTROL_V4.BAS] DIGITPOSX = DIGITPOSX + 10
        movlw 10
        addwf DigitPosX,F,1
    also; interesting case

    YPos = YPos + YposAra The location of the command line is very important. Example;

    Worked source

    Code:
                    
                    If Altmenu_i=31 Then                                        
                        YPos = YPos + YposAra       'worked: if Ypos value 5, YposAra value 10 then result YPos value 15
                        If Altmenu_i = MenuInverse Then Print Inverse 1 : Else : Print Inverse 0 : EndIf
                        GotoXY(0,YPos)
                        Print Str MenuBosluk , Str MenuBosluk                    
                        GotoXY(5,YPos)
                        Print "Kp"
                        GotoXY(50,YPos)
                        Print ":  ",Dec4 pKP
                    EndIf
    Not Working code

    Code:
                    If Altmenu_i=31 Then                                                            
                        If Altmenu_i = MenuInverse Then Print Inverse 1 : Else : Print Inverse 0 : EndIf
                        GotoXY(0,YPos)
                        Print Str MenuBosluk , Str MenuBosluk                                        
                        GotoXY(5,YPos)
                        Print "Kp"
                        GotoXY(50,YPos)
                        Print ":  ",Dec4 pKP
                        YPos = YPos + YposAra       'Not working. Ypos Value not change  ????????????????????????????
                    EndIf
    Best Regards.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,338
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    1.01 GB

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    Hi,
    In your yPos issue, surely the issue is that you have the addition after 3 GotoXY() commands in the second example where it is before them in the first so the program jumps over it?.

    Regards,
    Bob

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Junior Member Hiddenman37's Avatar
    Join Date
    Jan 2019
    Posts
    3
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    You're right. But;

    if i write the source code like this, it doesn't work.

    GotoXY(5,YPos)
    Print "Kp"

    instead;

    Print At 5,YPos, "Kp"

    And GotoXY command only change Cursor Position in Library.

    Best regards.
    Last edited by Hiddenman37; 1st March 2019 at 10:27.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,338
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    1.01 GB

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    Hi,
    I am not sure I follow the problem as not all the code is there, what happens in GotoXY(5,YPos)
    Is it possible to post a small example that will run in one of the free VSM's to show the issue.

    Regards,
    Bob



  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #8
    Junior Member Hiddenman37's Avatar
    Join Date
    Jan 2019
    Posts
    3
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    GotoXY only set cursor position in OLed LCD Library. Used instead of "print at" command. I don't think this problem has anything to do with this command.Because the other example does not have this command and addion (+) process does not working but print command is working.
    DigitPos = 5
    DigitPos = DigitPos + 10
    result DigitPos = 5 not 15

    if you want detalied knowledge you can download this library :
    http://www.protonbasic.co.uk/vbdownloads.php?do=download&downloadid=426

    ;----------------------------------------------------------------------------
    ; (Graphic_)GotoXY(P1, P2)
    ;Administrate the Cursor position
    ;Input : bCursorX bCursorY
    ;Output:
    ;Notes : Only $define needed without gosub but for the Debug there is a empty routine
    ; : When removed dont forget to change [email protected] (return instead goto)
    $define Graphic_GotoXY(P1, P2) '
    Graphic_wCursorX = P1 '
    Graphic_wCursorY = P2 '
    GoSub Graphic_GotoXYSub
    $define GotoXY(P1, P2) '
    Graphic_wCursorX = P1 '
    Graphic_wCursorY = P2 '
    GoSub Graphic_GotoXYSub

    Graphic_GotoXYSub:
    Return

    Best regards

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #9
    Junior Member atomix's Avatar
    Join Date
    Jul 2012
    Posts
    48
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Re: Some serious errors in proton 3.7.0.3

    Is it normal that in proton 3.6.0.7 (left) and in proton 3.7.0.5 (right) such differences? After all, as I understand the default flag "a" in the assembler command will be equal to 1 (in proton 3.7.0.5).
    Attached Thumbnails Attached Thumbnails Untitled.jpg‎  

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Errors remained in proton 3.7.0.5
      By atomix in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 4th March 2019, 08:22
    2. Database Errors
      By Sterling101 in forum Website / Forum Issues
      Replies: 1
      Last Post: 28th September 2012, 10:47
    3. [SOLVED !] compiler errors
      By Ruben dela Pena in forum Proton Plus Compiler v3
      Replies: 7
      Last Post: 12th July 2005, 21:55
    4. errors while using REM
      By Frederik in forum Proton Plus Compiler v3
      Replies: 22
      Last Post: 20th April 2005, 10:15

    Members who have read this thread since 7th December 2019, 09:47 : 0

    Actions :  (Set Date)  (Clear Date)

    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