Memory use - how much do you use?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1

    Default Memory use - how much do you use?

    Hi!

    Using:
    PBP 2.50b
    Microcode Studio 3.0.0.5
    Microchip USB HID bootloader v2.2
    PIC18F4550

    When you compile via Microcode Studio you can see how much space your code will take. I think it would be very informative if you could also see how much there still is space to increase your code before you code memory is full. So, instead of seeing "Success: 22384 bytes used" you would see "Success: 22384/32768 bytes used" or something like that...

    But you use data memory also! It would be technically easy to add the use of it also on the same line where the use of the used code is shown, however, this is not how things are today.

    Where can one see how much you use data space?
    In 4550 there is 2k.
    Where is that data of used memory hidden? In a linker file or where? Tried to search around but could not find it. I know I'm kind of a blind guy

    Thank you in advance...

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If you compile using something like Microchips Assembler (which you would do for things like the 18F series), then looking at the end of the generated .LST file you will find a couple of lines like...

    Program Memory Bytes Used: 15998
    Program Memory Bytes Free: 386

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    If you compile using something like Microchips Assembler (which you would do for things like the 18F series), then looking at the end of the generated .LST file you will find a couple of lines like...

    Program Memory Bytes Used: 15998
    Program Memory Bytes Free: 386
    Thank you Melanie

    But where can I see how much my variables need/consume space? Perhaps the same way as program memory bytes used are showed...

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I don't know if it is valid, but it seems to work for me -

    To figure how much free RAM I have, I create a dummy aray variable and compile.

    dummy var byte (1000)

    If there is no compile error, I figure I have at least 1000 bytes of free memory. I delete the line and go on.


    I use MCLoader often in my programs. It occupies some space in high memory. I used to find that I would compile a program and get no errors, only to find that when I actually loaded the code in the part (that already had MCLoader in it), I got an over-run error. I solved that problem by including the following lines at the very end of my program -

    Code:
    ASM
         ORG 0x1fcee        ; a few bytes below MCLoader when used in a 128K part
         nop
    ENDASM
    You can put any address you want after the ORG statement. If your program gets bigger than that, you will get a compile error. I have found this technique to be useful in lots of ways.
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default

    This might help.
    It is a little program I have been playing with that reads the LST file and pulls some info from it.

    It is a work in progress so it may not be 100% accurate and it seems to work better on 18Fs.
    Some of those LST file can be quite large.

    Click on the link below and save. The is nothing to install. Just click and run.
    http://www.mac.mf3x3.com/downloads/lst/LST_V.exe

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3098&stc=1&d=123165757 1">
    Attached Images Attached Images  
    Dave
    Always wear safety glasses while programming.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    This might help.
    It is a little program I have been playing with that reads the LST file and pulls some info from it.

    It is a work in progress so it may not be 100% accurate and it seems to work better on 18Fs.
    Some of those LST file can be quite large.

    Click on the link below and save. There is nothing to install. Just click and run.
    http://www.mac.mf3x3.com/downloads/lst/LST_V.exe
    Thank you Charles and Dave!

    The List View seems to work just perfectly ...
    I just don't understand why not PBP do show more info especially when it would be quite easy to incorporate all that info into the compilation output... Perhaps the time is not ready yet?

    Thank you all for the help on this matter

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