Optimizing memory usage for ARRAYWRITE statement?


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    1,111

    Default Optimizing memory usage for ARRAYWRITE statement?

    Hello.
    In my code I have to store a lot of textual variables inside code memory. For example:

    Code:
    if cvladi=1 then arraywrite botline, ["Rainbow         "] 
    if cvladi=2 then arraywrite botline, ["Sunset          "] 
    if cvladi=3 then arraywrite botline, ["Amsterdam       "]
    if cvladi=4 then arraywrite botline, ["Fire            "] 
    if cvladi=5 then arraywrite botline, ["Jet engine      "]
    Each arraywrite statement here, when writing 16 bytes of data into array, consumes 46 bytes of code memory when compiled.
    I do not have technical capabilities to attach external EEPROM or replace the main IC at this moment. The PIC I'm using is 16F1939 with 16K of program memory. I have to do a lot of arraywrites of 16 bytes of data - 146 times in whole program, so, 6716 bytes are used instead of 2336, is there a way to somehow compact all this, considering existing hardware limitations?

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,562


    Did you find this post helpful? Yes | No

    Default Re: Optimizing memory usage for ARRAYWRITE statement?

    is there a way to somehow compact all this, considering existing hardware limitations?
    as has been pointed out many times, use the flash memory

    https://www.picbasic.co.uk/forum/sho...ithin-PBP-code
    Warning I'm not a teacher

Similar Threads

  1. Replies: 6
    Last Post: - 25th October 2022, 18:49
  2. MPLAB ICD Memory Usage Gauge Issues
    By readitaloud in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st August 2011, 10:04
  3. Optimizing IR range
    By ardhuru in forum Schematics
    Replies: 12
    Last Post: - 12th January 2011, 05:39
  4. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 05:58
  5. MPLAB IDE Memory Gauge usage?
    By gabrielg74 in forum General
    Replies: 4
    Last Post: - 5th December 2005, 19:52

Members who have read this thread : 9

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

Posting Permissions

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