Help me save some spacecode...


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120

    Question Help me save some spacecode...

    This is my code.It is used 1697 words of my 2K space code.
    Please help me to increase it.I do not want to change my Pic to bigger.

    I attach my code.It is too big to post it.

    Thanks
    Regards
    Nikos Geronikolos
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    http://www.picbasic.co.uk/forum/showthread.php?t=545

    It's all here somewhere if you did a SEARCH...

  3. #3
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Dear Melanie,

    I have aleady check this link.I tried to add after my variable Bank0 without any sucsses.My codespace is still the same.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Reduced size. Did you erealy meant increse size?? (just joking!)

    Here is your smaller size code.

    Read it to see why.

    Ioannis
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Thanks my friend john,

    I see your changings.My code is much more smaller,now!
    I will program my pic and I will inform you!!!
    If you find anything else please tell me...

    I am from Athens as you may see.
    I have finished my studies in TEI of Thessaloniki.I love your town.
    Any news from PAOK.

    Best regards
    Nikos

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    nikos,

    with some changes to your code you can still save sereral hundred words of codespace.
    (Less than 1200 words should be possible)

    Store the "static" strings in EEPROM

    Do a search for "STRINGS EEPROM" and you'll find many examples.

    Reduce the number of I2CWRITE statements by writing a subroutine "I2COUT"
    Stet the required parameters and call that sub.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Raiph,

    Thanks.I make a subroutine which save my some more code.But I have a problem.
    Have a look:

    Code:
    DISPLAYADDRESSBYTE = $05
    ;GR Γ = RAM15 MAX6953
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DISPLAYADDRESSBYTE, [$CB,%01111111,%00000001,%00000001,%00000001,%00000001]     
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DISPLAYADDRESSBYTE, [$CB,%01111111,%00000001,%00000001,%00000001,%00000001] 
    ;GR Δ = RAM16
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DISPLAYADDRESSBYTE, [$D0,%01111100,%01000010,%01000001,%01000010,%01111100]     
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DISPLAYADDRESSBYTE, [$D0,%01111100,%01000010,%01000001,%01000010,%01111100] 
    ;GR Θ = RAM17
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DISPLAYADDRESSBYTE, [$D5,%00111110,%01001001,%01001001,%01001001,%00111110]     
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DISPLAYADDRESSBYTE, [$D5,%00111110,%01001001,%01001001,%01001001,%00111110]
    I would like to make a subroutine like that:
    Code:
    DISPLAYADDRESSBYTE = $05
    X = $CB,%01111111,%00000001,%00000001,%00000001,%00000001 
    GOSUB I2COUT
    X = $D0,%01111100,%01000010,%01000001,%01000010,%01111100
    GOSUB I2COUT
    X = $D5,%00111110,%01001001,%01001001,%01001001,%00111110
    GOSUB I2COUT
    ....
    I2COUT:
              I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DISPLAYADDRESSBYTE, [X]
              I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DISPLAYADDRESSBYTE, [X]
    RETURN
    ....
    Now what variable is X?Word?
    That is my problem.

    Regards
    Nikos

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    nikos,

    the attached example is based on your inital code with IOANNIS's modifications.

    All I have done was some "cut & paste" and some modding.

    It is supposed to work, but not tested.
    (compiles to 1246 words)

    There is still plenty of room for improvement,
    the example is just ment to give you an idea.
    Attached Files Attached Files
    Last edited by NavMicroSystems; - 10th August 2005 at 23:55.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



Similar Threads

  1. Newbe how to save srtrings
    By MR2010 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th January 2010, 01:16
  2. long countdown timer, how to save power?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 15th November 2008, 05:15
  3. Using serial eeprom to save data ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 8th February 2008, 08:36
  4. Replies: 5
    Last Post: - 29th January 2008, 09:19
  5. save data in pic
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 17th May 2006, 21:17

Members who have read this thread : 0

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