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
Printable View
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
http://www.picbasic.co.uk/forum/showthread.php?t=545
It's all here somewhere if you did a SEARCH...
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.
Here is your smaller size code.
Read it to see why.
Ioannis
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
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.
Raiph,
Thanks.I make a subroutine which save my some more code.But I have a problem.
Have a look:
I would like to make a subroutine like that: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]
Now what variable is X?Word?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
....
That is my problem.
Regards
Nikos
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.