Menu

Error: Program is too large

Help
2018-02-09
2019-03-03
<< < 1 2 (Page 2 of 2)
  • Roger Jönsson

    Roger Jönsson - 2019-03-03

    I'm having the same problem trying to fit a 7KB Table into 16F15376. The data sheet says it has 16KW of Program Flash memory. The program so far is the Table, and three tiny loops.
    GCB still complains there is no room for the program, unless I shrink the table down below around 2000 elements.
    Error: Subroutine TABLE1 is 7086 words, the size limit on the current chip
    is 2048 words
    Error: Program is too large, cannot fit all subroutines into available
    program memory

    The GCB documentations says "a list of numbers (up to 10,000 elements)", not mentioning that it can't hadle the spilt/page limitations etc. If this is true for certain chips, which might these be? -Just curious... :)

    What would be the best solution fro the 16F15376? Split the table into many 255elements tables? or 2048 ?

     

    Last edit: Roger Jönsson 2019-03-03
    • Anobium

      Anobium - 2019-03-03

      What version of Great Cow BASIC? look in the IDE to show the version or the top line of the as file.

       
  • Roger Jönsson

    Roger Jönsson - 2019-03-03

    Great Cow BASIC (0.98.<<>> 2019-02-14 (Windows 32 bit))

     
  • Roger Jönsson

    Roger Jönsson - 2019-03-03

    Example file attached. A test playing audio with PW output, just to see whats possible...

     

    Last edit: Roger Jönsson 2019-03-03
  • Anobium

    Anobium - 2019-03-03

    Thank you. The error is correct. One table (with it headers and footer) cannot exceed the page size on a 16f microcontroller.

    Split the data into mulitple tables or (as I would) I would create a little converter to automatically split the data source with the little converter doing all the hard work in terms of ensure the table in the correct size with a method to manage the dataset.

     
  • Roger Jönsson

    Roger Jönsson - 2019-03-03

    Ok. I can do the workaround, but I was curious.

    I don't know if this is related to the page size limitation
    (data sheet for 16F15376, page 107);
    TABLE 5-1: BOOT BLOCK SIZE BITS
    Actual Boot Block Size User Program Memory Size (words)
    8192

    I can't find any other information in the data sheet (lots of pages and not sucessful searching the content). Searching 2048 in the yeilds nothing useful.
    Is 2048 limitation true for all 16F PICs?

     
  • Anobium

    Anobium - 2019-03-03

    The answer. :-) From my brain.

    Core Size   Page Size
    
    12-bit           512
    14-bit           2048
    16-bit           8192
    

    Where

    This table shows the  microcontroller architecture.
    
    
    12 -  Baseline devices. 12 Bit instruction set
    
    15 -  Mid-range core devices. 14 Bit instruction set with enhanced instruction set class
    
    15 plus familyVariant=1 - Mid-range core devices. 14 Bit instruction set with enhanced instruction set and with large memory capability class
    
    16 - High end core devices. 16 Bit instruction set, memory addressing architecture and an extended instruction set.
    

    It would be possible to resolve the table and page limitation using different strategies but this is not on the list of improvements. :-)

     
  • Roger Jönsson

    Roger Jönsson - 2019-03-03

    I see. :-)

    It seems like 2048 hits the celiling as well, I guess there is some header stored as well, so the storable block size is slightly less?

    Error: Subroutine TABLE1 is 2070 words, the size limit on the current chip
    is 2048 words

     
    • Anobium

      Anobium - 2019-03-03

      Yes, there is a small header and footer to process the lookups.

       
<< < 1 2 (Page 2 of 2)

Log in to post a comment.