Memory use - how much do you use?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Talking

    Hi, Dave

    You will laugh, but ...

    I decided long time ago to be ONLY a Computer USER !!! ...

    MUCH better for Health ... lol

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Dave

    You will laugh, but ...

    I decided long time ago to be ONLY a Computer USER !!! ...

    MUCH better for Health ... lol

    Alain
    Yep, got a chuckle hearing that from you
    I think sometimes I should decide as you did.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    I have some code that I have been working on for a PIC12F675. When I try to add another variable to it and then compile, I get - Error: Unable to fit variable y -. I am using the latest pbp, microcode studio, and mpasm v8.15. When I use Mackrackit's LST View program, it shows my successful compile (one less variable) as using about 70 percent of the code space, and 48 percent of the sram space. What would be stopping me from being able to use the other half of my sram? I looked in the 12F675.BAS file, and my memory map is BANK0 $0020, $005F, which is correct in the data sheet. 12F675 is selected in mcs.

    Confused....
    http://www.scalerobotics.com

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Can you post your code?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    My code isn't really this, but I get similar results using this example:

    Code:
    myvar1 var byte
    myvar2 var byte
    myvar3 var byte
    myvar4 var byte
    myvar5 var byte
    myvar6 var byte
    myvar7 var byte
    myvar8 var byte
    myvar9 var byte
    myvar10 var byte
    myvar11 var byte
    myvar12 var byte
    myvar13 var byte
    myvar14 var byte
    myvar15 var byte
    myvar16 var byte
    myvar17 var byte
    myvar18 var byte
    myvar19 var byte
    myvar20 var byte
    myvar21 var byte
    myvar22 var byte
    myvar23 var byte
    myvar24 var byte
    myvar25 var byte
    myvar26 var byte
    myvar27 var byte
    myvar28 var byte
    myvar29 var byte
    myvar30 var byte
    myvar31 var byte
    myvar32 var byte
    myvar33 var byte
    myvar34 var byte
    myvar35 var byte
    myvar36 var byte
    myvar37 var byte
    myvar38 var byte
    myvar39 var byte
    myvar40 var byte
    myvar41 var byte
    I admit this is more than 48.44 percent of the 64 bytes of SRAM. I am not clear how to check SRAM use in any other way than using your program. Perhaps PBP uses the other bytes for itself. But then, your program should account for actual use, since it is using the lst file.

    Let me know what you think.

    Thanks,

    Walter
    Last edited by ScaleRobotics; - 9th June 2009 at 20:43.
    http://www.scalerobotics.com

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I played with this some last night, did some reading and could not find a solution.
    Maybe Darrel or Bruce will chime in...
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I played with this some last night, did some reading and could not find a solution.
    Maybe Darrel or Bruce will chime in...
    DING!

    PBP's system vars use a minimum of 24 bytes.
    Complex formulas can increase that, but it appears you don't have any of those yet.

    So you create 40 additional byte variables and it's full. (24 + 40 = 64)

    As for "LST View" ...

    It apparently just looks for the last occurrence of "RAM_START +" and uses that address to calculate how much RAM was used.

    That address is already referenced to RAM_START, but in the program, this line subtracts the start address again, which leaves the count too low.
    Code:
    ramU = ramF - ramS
    Add 20h (32) to the 31 bytes reported and you get 63, the last address in RAM.

    I think that line should be ...
    Code:
        ramU = ramF + 1
    However, RAM assignments are not always contiguous. You could have a single variable in BANK3 (chip other than 675) and it'll show almost all the RAM has been used, when there's only a few bytes being used. Or the last address may be the beginning of an array, which it won't count either.

    It's a difficult task to count RAM bytes used.
    <br>
    DT

Similar Threads

  1. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  2. Replies: 4
    Last Post: - 2nd March 2007, 06:12
  3. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  4. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 18:38
  5. memory button
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th February 2006, 09:47

Members who have read this thread : 1

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