Shop OBEX P1 Docs P2 Docs Learn Events
End of Program Space — Parallax Forums

End of Program Space

JCeeJCee Posts: 36
edited 2010-10-13 00:00 in Propeller 1
Is there a way to determine, at compile time, the end of program space in RAM. I am working on a GPS data logger and I want to store the GPS data in eeprom AFTER my program. I realize that I can press F8 and find the end of the code space but I dont want to do this everytime I change the code. Any simple solutions?

Comments

  • hover1hover1 Posts: 1,929
    edited 2010-10-10 18:00
    A simple solution would be to use a 64K EEPROM (24c512) instead of a 32K, then you can store all you want in the upper 32K. When a SPIN program is loaded, it loads up the entire lower 32K, but doesn't touch the upper 32K.

    Jim

    Edit: If you're on a Demo or PPDB Board, that may be a problem, as they are SMT components.
  • hover1hover1 Posts: 1,929
    edited 2010-10-10 18:05
    Also, if you are limited to 32K, you could always start writing your data from the top (end address) of the EEPROM down.
  • T ChapT Chap Posts: 4,223
    edited 2010-10-10 18:41
    Or, on boot, write some code to examine the EEPROM and find the beginning of the blank space at the end of the program.
  • AribaAriba Posts: 2,690
    edited 2010-10-10 19:52
    The information you need stays in the init section in the Main RAM (the first 16 bytes).
    The word at addr 8 holds the start of the variable section (the yellow part of the hex viewer in PropTool). This should be the beginning of the usable EEPROM space.
    log_begin := word[8]
    

    Andy
  • JCeeJCee Posts: 36
    edited 2010-10-10 20:29
    Thanks I will try that.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2010-10-11 09:45
    I've always thought a little utility which would dump a set of addresses at compile time would be very helpful. It would show entry and termination points of all objects, memory locations for all vars and RES definitions used by those objects.

    ViewPort comes close and with patience you can figure it out by clicking on each PUB or PASM label to senthizise the data. You can also pump it out at runtime but, man, wouldn't that be handy in the prop tool to just be able to look at a listing?
  • mparkmpark Posts: 1,305
    edited 2010-10-12 09:10
    CannibalRobotics,
    Have you looked at BST or Homespun?
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2010-10-12 09:29
    mpark wrote: »
    CannibalRobotics,
    Have you looked at BST or Homespun?

    Does it do that?
  • JCeeJCee Posts: 36
    edited 2010-10-13 00:00
    Something is not working quite right.

    When I press F8 I can see the first 12 bytes are

    00 B4 C4 04 6F 63 10 00 1C 5E BC 63 2C

    However when I try to read the first 10 bytes this is what I get:
    00 B4 C4 04 6F 91 10 00 14 0E D0 0E 24

    Not the same, espically the word where the vars are supposed to begin.


    here is the code I am using to read RAM
       repeat time from 0 to 12 
        ReadAddr := Byte[time]
        FDS.hex(ReadAddr,2)
        FDS.tx(32)
    
Sign In or Register to comment.