Menu

Getting Error from GCASM "Symbol [SFR]CCP1M3 has not been defined"

Help
2023-03-09
2023-03-09
  • David Abrames

    David Abrames - 2023-03-09

    Hello,
    This is my first post so please let me know if I placed this in the wrong place.
    I was trying to compile the "hardware_mars_beacon_16f1398" Demo PWM Sample
    I change the chip setting to 16F1455 as that is the PIC Chip I have. Looking at the error I think this has something to do with the CCP configuration difference with my 16F1455 chip verse the original.

    I reviewed the datasheet for the 16f1455 and changed the PORT setting to PORTA.3, PORTA.5 and PORTC.5 which are the three ports available to the 16F1455 for PWM

    My guess is there is some configuration that is not right but I don't know where to look.

    The full errors I am getting are:
    Error: GCASM: Symbol [SFR]CCP1M3 has not been defined. Inspect ASM file to
    determine error at ANDWF CCP1M3, W Hexfile address(see lst file): 00010F
    Error: GCASM: Symbol [SFR]CCP1M2 has not been defined. Inspect ASM file to
    determine error at ANDWF CCP1M2, W Hexfile address(see lst file): 000118
    Error: GCASM: Symbol [SFR]CCP1M1 has not been defined. Inspect ASM file to
    determine error at ANDWF CCP1M1, W Hexfile address(see lst file): 000121
    Error: GCASM: Symbol [SFR]CCP1M0 has not been defined. Inspect ASM file to
    determine error at ANDWF CCP1M0, W Hexfile address(see lst file): 00012A

    Could someone please tell me what I have done incorrectly here please?

    David

     
    • David Abrames

      David Abrames - 2023-03-09

      Hllo,

      OK well never mind I seem to have found my answer but I really don't understand why

      I found in the HELP file a reference to PWM example that included these lines:

      '#define USE_HPWMCCP1 FALSE ' This is not used so optimise
      '#define USE_HPWMCCP2 TRUE ' This is used so include in the compiled code
      '#define USE_HPWMCCP3 FALSE ' This is not used so optimise
      '#define USE_HPWMCCP4 FALSE ' This is not used so optimise

      The 16f1455 has two CCP modules #1 and #2 and I choose CCP2 hence the above #defind
      but I do not understand why the previous sample code that has the 16f1938 did not have these. So I found the answer to my problem but don't understand why.

      If someone could explain this I would be grateful

      David

       
  • Anobium

    Anobium - 2023-03-09

    Hello David,

    Perfect place to post.


    I can help explain if you post the errant program ( so recreate the issue for me).. Attach the GCB program to a post.

     
  • David Abrames

    David Abrames - 2023-03-09

    Dear Anobium
    Thank you for the reply,
    Attached is my program that will reproduce the problem. if you uncomment the #define lines I marked then the problem goes away.

    If you need anything else from me please let me know.
    Thank you

     
  • Anobium

    Anobium - 2023-03-09

    Thank you for sharing.

    The issue is caused because the compiler ( incorrectly) assumed that every chip has CCP/PWM. The 16F154x chips do not. So, when the PWM library tries to set some registers.bit the error happens, because the register.bit(s) do not exist.

    The adding of the constants disables that section of the code hence the error message is removed. Where USE_HPWMCCP1 FALSE disable the CCP1/PWM portion of the library.


    The real fix is to test for the CCP1/PWM. Which I have changed. So, in the future the additional constants will not be required.


    Hope this explains.

     
  • David Abrames

    David Abrames - 2023-03-09

    Very Cool Thank you for the explanation. This is interesting as the Datasheet for this chip does reference "CPP" but I guess it is not the same as the compiler is looking for. Is there a #if Define that I can test to see if I need to manually add the "USE_HPWMCPP FALSE" line?

    David

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.