Bug in Proton compiler 3.7.8.2 Not working for pic18f2550


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member davutnacikaya's Avatar
    Join Date
    Mar 2019
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    227.41 MB

    0 Not allowed!

    Default Bug in Proton compiler 3.7.8.2 Not working for pic18f2550

    The following code works with pic18f25k22. But it is compiled for
    pic18f2550 and it does not work.

    Note: The pic18f2550 is intact. Led blink test the mikrobasic compiler
    produced was tested with hex code. 2 Mcu are included in the free use
    list.

    Code:
    'Proton compiler ver: 3.7.2.8 ide ver:2.0.3.3
    'Test platform: Pickat
    Device 18F2550 ' * PIC18F2550 is not working. But code is compile. *
    'Device 18F25K22 '  * Code is compile and working. *
    Declare Xtal=20
    
    TRISA=000000
    TRISB=000000
    TRISC=000000
    PORTA=0
    PORTB=0
    PORTC=0
    
    main:
    PORTC.0=1
    DelayMS 1000
    PORTC.0=0
    DelayMS 1000
    GoTo main
    
    End
    


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
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,309
    Thumbs Up
    Received: 28
    Given: 7
    Total Downloaded
    801.38 MB

    0 Not allowed!

    Default Re: Bug in Proton compiler 3.7.8.2 Not working for pic18f2550

    Hi,
    I notice that there are no config settings in your code, I am pretty sure that it will be a peripheral that you have not set correctly rather than the compiler.

    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.

  • #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,340
    Thumbs Up
    Received: 289
    Given: 138
    Total Downloaded
    1.60 GB

    0 Not allowed!

    Default Re: Bug in Proton compiler 3.7.8.2 Not working for pic18f2550

    With such low level operations such as Low and High etc, the compiler can never be at fault because it creates a few mnemonics that alter SFRs.

    I've just tried the code:

    Code:
        Device = 18F2550
        Declare Xtal = 20
        Do
            High PORTC.0
            DelayMs 1000
            Low PORTC.0
            DelayMs 1000
        Loop
    And it works as it should, however, the USB devices have a complex fuse mechanism because they need a different oscillation speed for the USB transceiver, so the compiler uses as much a defualt setting for the fuses as it can. This will not effect toggling a pin high and low, but it may alter timings for delays and USART operations etc, so it is always best to add fuses for the program's operation using Config_Start/Config_End. For a quick alteration to the fuses, use John's excellent fuse plugin, or open the device's compiler PPI file and you will find the relevant fuses, and the compiler's default fuses, at the bottom of the file.

    The above code produces the Asm code:
    Code:
    F1_000026 equ $ ; IN [TEST.BAS] DO
    _lbl__2
    F1_000027 equ $ ; IN [TEST.BAS] HIGH PORTC.0
        bcf TRISC,0,0
        bsf LATC,0,0
    F1_000028 equ $ ; IN [TEST.BAS] DELAYMS 1000
        movlw 0X03
        movwf PP1H,0
        movlw 0XE8
        rcall __delay_ms_w_
    F1_000029 equ $ ; IN [TEST.BAS] LOW PORTC.0
        bcf TRISC,0,0
        bcf LATC,0,0
    F1_000030 equ $ ; IN [TEST.BAS] DELAYMS 1000
        movlw 0X03
        movwf PP1H,0
        movlw 0XE8
        rcall __delay_ms_w_
    _lbl__4
    F1_000031 equ $ ; IN [TEST.BAS] LOOP
        bra _lbl__2
    And as can be seen, it is simply altering the relevant TRIS and LAT bits, with delays inbetween, then a continous loop.

    The default config fuses are also shown in the Asm file:
    Code:
    __config config1h, FOSC_HSPLL_HS_1
    __config config2l, PWRT_OFF_2 & BOR_ON_2 & BORV_3_2 & VREGEN_ON_2
    __config config2h, WDT_OFF_2 & WDTPS_128_2
    __config config3h, PBADEN_OFF_3
    __config config4l, LVP_OFF_4 & XINST_OFF_4 & DEBUG_OFF_4
    And with PIC microcontroller's the first thing to do if a program is not operating as it should is to examine the fuses and alter what is required. Microchip have made far too many major cock-ups with their config fuse meachanism, where they can actually stop a specific part of a program working if they are not set correctly. At one time it was just the oscillator type and the watchdog that would upset things, but now a slight config fuse not setup just as it should be can make a program operate with very subtle problems, or not work at all!

    Without sounding too cynical, but why is it always classed as an anomaly in the compiler when a user cannot perform a straightforward task on a device, or not bother understanding the device being used by reading its datasheet?

    There are sometimes anomalies within the compiler but this is always on the high level operations of peripherals and that is usually because Microchip keep moving the goal posts with there devices and their more complex peripherals.
    Last edited by top204; 10th October 2019 at 12:22.

  • 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 davutnacikaya's Avatar
    Join Date
    Mar 2019
    Posts
    6
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    227.41 MB

    0 Not allowed!

    Default Re: Bug in Proton compiler 3.7.8.2 Not working for pic18f2550

    The pic18f2550 works fine with the following config settings :-) Thanks.


    Config_Start
    FOSC = HS
    MCLRE = On
    PWRT = On
    FCMEN = Off
    IESO = Off
    BOR = Off
    VREGEN = Off
    WDT = Off
    PBADEN = Off
    CCP2MX = Off
    STVREN = Off
    LVP = Off
    XINST = Off
    Debug = Off
    Cp0 = Off
    Cp1 = Off
    Cp2 = Off
    Cp3 = Off
    CPB = Off
    CPD = Off
    WRT0 = Off
    WRT1 = Off
    WRT2 = Off
    WRT3 = Off
    WRTB = Off
    WRTC = Off
    WRTD = Off
    EBTR0 = Off
    EBTR1 = Off
    EBTR2 = Off
    EBTR3 = Off
    EBTRB = Off
    Config_End

  • 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. Error: Proton BASIC Compiler has stopped working
      By alexterrell in forum Proton Plus Compiler v3
      Replies: 9
      Last Post: 26th September 2015, 16:25
    2. A compiler bug?
      By llimis in forum Proton Plus Compiler v3
      Replies: 7
      Last Post: 18th April 2008, 02:19
    3. STR problem or compiler bug?
      By BeamSystems in forum Proton Plus Compiler v3
      Replies: 11
      Last Post: 11th April 2008, 10:12
    4. Possible Compiler Bug with Proton IDE V1.0.4.6
      By Willi Grundmann in forum Proton Plus Compiler v3
      Replies: 13
      Last Post: 21st February 2008, 20:34
    5. poss compiler bug with complement (~) operator?
      By picyerknows in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 7th November 2007, 21:34

    Members who have read this thread : 34

    Actions :  (Set Date)

    You do not have permission to view the list of names.

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts