Menu

Program does not compile for 18f25k20

2020-12-29
2020-12-30
  • Gert vd Walt

    Gert vd Walt - 2020-12-29

    When trying to compile this program for 18f25k20 it gives the following error:

    Error: GCASM: Duplicate, conflicting definition for START

    I compiled / used it for numerous different pic's and it works. (use it to see if hardware serial is working)

    Tried it with 98.06 and 98.07 rc35

    Thank you.

     
  • Gert vd Walt

    Gert vd Walt - 2020-12-29

    More info: If I comment out the "START:" label it compiles

     
  • stan cartwright

    stan cartwright - 2020-12-29

    I changed the pic to 18f25k22 and asm ok

     
    • Anobium

      Anobium - 2020-12-29

      The root cause is as I wrote. There is a register or register.bit with the same name as start.

      On the 18f25k22 the SSPSTAT.3 register.bit is called sspstat_s. This means sspstat start... Microchip do not have a naming convention so the same register.bit on different chips may or may not have the same name.

       
  • stan cartwright

    stan cartwright - 2020-12-29

    I tried original 18f25k20 ,8 and that compiled ok...only much faster -- 1.3s

     

    Last edit: stan cartwright 2020-12-29
    • Anobium

      Anobium - 2020-12-29

      The root cause is as I wrote. There is a register or register.bit with the same name as start.

      On the 18f25k20 the SSPSTAT.3 register.bit is called s. This means sspstat start... Microchip do not have a naming convention so the same register.bit on different chips may or may not have the same name.

       
  • Anobium

    Anobium - 2020-12-29

    And, look Stan. Three chips with the same register.bit logical address of sspstat.3 have three different names.

    A mess but we typically mask all this from the user by aliasing in the libraries but as Gert found out... names do clash.

    I do recommend using a prefix to ensure user code does not clash. Using an underscore as the prefix would resolve. So, using _Start to ensure uniqueness.

     
  • stan cartwright

    stan cartwright - 2020-12-30

    I wouldn't have used start......goto start anyway.
    do....loop is the more modern way.
    The original post used 98.07 rc35 and gave an error but when I used same code
    on 98.07 rc35 I got no error.
    Out of interest , why?

     
    • Anobium

      Anobium - 2020-12-30

      It did error. Check again please with that specific chip.

       
  • stan cartwright

    stan cartwright - 2020-12-30

    I only asmd it. The error shows when you make hex. Sorry.

     

Log in to post a comment.