error: too many system variables: 80 available. 84 used.


+ Reply to Thread
Results 1 to 15 of 15
  1. #1
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default error: too many system variables: 80 available. 84 used.

    Hi,
    can someone explain this error for a dummy like me please?
    I have never experienced this error before.
    Where do I have to look at as my code has 4500+ lines.
    Can I increase the number of system variables?
    Thanks in advance.
    Stay safe and healthy!

  2. 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. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,577
    Thumbs Up
    Received: 334
    Given: 160
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    An 18F device only has a limited amount of Access (Bankless) RAM) so if the program has too many variables created with the System or Access directive after them, it will create too many Access RAM variables for the PIC18F to handle, so the compiler gives the error.

    Go through your variable declarations and remove some of the System or Access directives after them. System variables are not normally required in a program, but they are useful when used inside an interrupt because it reduces the Asm mnemonic count and speeds up the code.

  4. 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. #3
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Thank you so much for your quick reply. It is a PIC16F18877.
    I tried to change some variable declarations, but did not have any impact so far. Still the exact same error message

  6. 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. #4
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    None of my variables have a system or access directive after them. Are they added automatically?
    What else could be the problem?

    Where can I see which system variables are being created?
    If I remove a more complex if-else-endif condition, it will compile.
    Last edited by kuhrig; 31st March 2020 at 09:20.

  8. 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. #5
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    You can see a list of system variables in the .LST file. look for COMPILER SYSTEM VARIABLES
    George.

  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.

  11. #6
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Thank you. Found that.
    I have no delared system or access variables. All system variables must been created by the compiler.

    When are system variables being created?
    Are they being used only for 1 condition / equation etc. or being cleared and re-used?
    How to structure a program to minimize the use of system variables?

    Thanks for your help.

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

  13. #7
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,748
    Thumbs Up
    Received: 51
    Given: 96
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Do you have any interrupt routines?
    Tim

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

  15. #8
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    I guess you need to post code.
    George.

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

  17. #9
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Thank you both for your replies.

    @Tim: I have removed the complete interrupt routine. No interrupt routine any more. Same error!! Exactly the same error.

    @Towlerg: If OK I will send you the code in a pm.

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

  19. #10
    Member kuhrig's Avatar
    Join Date
    Aug 2005
    Posts
    108
    Thumbs Up
    Received: 4
    Given: 0
    Total Downloaded
    4.71 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    It seems like I found the problem.
    The compiler is creating a system variable for every byte or word array variable within a comparision. Before the comparison it moves the array variable into a system variable.
    Code:
    F1_001196 equ $ ; IN [BBU_8877_V00T27.BAS] IF AWVOLTS[IBATIN] < MV_IN_LOW THEN
        movlb 0X03
        movf awVOLTS#0,W
        movlb 0X00
        movwf Pbs_Var0
        movlb 0X03
        movf awVOLTS#0H,W
        movlb 0X00
        movwf Pbs_Var0H
        movlw 0X23
        subwf Pbs_Var0H,W
        movlw 0X28
        btfsc STATUS,2
        subwf Pbs_Var0,W
        btfsc STATUS,0
        bra _lbl__108
    For example:
    If wARRAY [0] > 1000 then xxxx. -> this will create a word system variable
    If wTEST > 1000 then xxxx -> this will NOT create a word system variable

    Now the odd thing seems to be, that the compiler creates system variables and does not always re-use them. Even for the same array variable it creates another system variable sometimes??
    In the ASM code I have seen that sometimes the same, sometimes different system variables are being used for the same word array variable.
    For example:

    If wARRAY [0] > 1000 then xxxx. -> this will create a word system variable
    code
    If wARRAY [0] < 500 then xxx -> this will sometimes create another word system variable.

    For the same array variable 2 system variables are being created sometimes.

    It seems not to be documented that if you use an array variable within a comparison a system variable is being created. Then the array variable is being moved into the system variable which seems to increase code and running time.
    Am I correct??
    I have now replaced 4 word array variables with 4 normal word variables and the system variable count decreased from 82 to 72 = 10 bytes (5 words) less. (82 was my last error)
    Last edited by kuhrig; 2nd April 2020 at 11:13. Reason: added asm code

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

  21. #11
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    @kuhrig In my opinion arrays on 16F and to a certain extent all PIC devices are severely complicated by the segmented nature of paged RAM. Personally I would use an intermediary variable, you only need one of each type and made System if you like. Although it looks like more code actually you are only doing what the compiler would have to do anyway.
    George.

  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.

  23. #12
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,177
    Thumbs Up
    Received: 97
    Given: 1
    Total Downloaded
    2.91 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    @Towlerg the 24/33 series have nice linear memory and can easily accommodate arrays. You should try them.
    JohnB

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

  25. #13
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,352
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    @johngb I wish I could unfortunately my brain is far too small, I find even the newer 18F's ie 18F27K42 much to complicated, the ADC alone is enough to cause considerable hair lose.
    George.

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

  27. #14
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,177
    Thumbs Up
    Received: 97
    Given: 1
    Total Downloaded
    2.91 GB

    0 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Where do you think all my hair went. N.B. need to update my avatar
    JohnB

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

  29. #15
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,577
    Thumbs Up
    Received: 334
    Given: 160
    Total Downloaded
    1.99 GB

    1 Not allowed!

    Default Re: error: too many system variables: 80 available. 84 used.

    Thanks to the code I received, I have identified an anomaly when expressions are used in nested If-Then comparisons. The compiler has a memory leak with its system stack variables and does not Pop them until the last Endif in the nesting.

    This has been with the compiler from day 1! Yet I have never noticed it at all, although I try to use temp variables for expressions within comparisons whenever possible so that the compiler's "worse case scenario" mechanism gets the variable type required to save code space and speed up code. Also, I've never had very deeply nested If-Thens... As the witer of the compiler, there is always an element of bias when testing and a subconscious shying away from possible problems, or simply not seeing past the trees in the vast forest of code. LOL That's my excuse anyway. :-)

    I'm busy working on an update and will have it ready ASAP.

  30. 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. System variables
    By towlerg in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 15th May 2017, 12:56
  2. PDS 3.5.5.5 Too many System variables
    By i2tzk in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 11th May 2013, 08:17
  3. System Variables
    By crankshaft in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 19th January 2012, 15:33
  4. Error "Too many SYSTEM variables, 96 avaiable. 129 used"
    By gtv_pic in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 6th October 2010, 10:10
  5. [SOLVED !] How about moving System Variables?
    By Latex in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 14th February 2010, 12:41

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