For an usefull answer you must post a sample of your code.Do you have any programming tips that I can use?
Al.
For an usefull answer you must post a sample of your code.Do you have any programming tips that I can use?
Al.
All progress began with an idea
Have a look here but be very carefull with direct ASM commands.
http://www.rcfaq.com/PIC/optimize.htm#morefornext
Ioannis
************************************************** ***********************
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 " !!!
*****************************************
Change the location of subroutines in the program.
Also, if you are comparing bytes to words (or the other way), just compare the low.byte of the words.
Also, if you are using AND, OR etc in the IF condition, remove them and use separate IF condition for each AND or OR.
Also, if you are using an IF condition similar to the one as follows,
IF a+b = c THEN x=y.
Change it to something like
temp = a+b
IF temp = c THEN x =y
_____________________________
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Tip1.
In your program you will probably have variables that are used often... put those variables in BANK ZERO...
For example, you have a variable called CounterA, you would normally deline it as...
CounterA var Byte Bank0
...all you have to do is change that to...
CounterA var Byte Bank0
I did that in one program and recovered close to 2K... so it's really worth doing.
Eventually, you'll fill up Bank0 and can't fit any more variables into it, so there's a limit here, therefore pick the variables you use MOST OFTEN to go into Bank0.
Come back and tell us how much you saved just by doing this...
Tip2.
Put your SUBROUTINES at the start of your program and your first instruction is a jump over them... eg GOTO START. The more commonly used subroutines and variables that you can stuff into the first Bank of Memory in your PIC the better for the overall compactness of your program when it starts to grow.
Hi,
I will try all of your recomendations and will keep you posted.
My program is 8100 words when compiled, that is closed to 40 pages if you print it out, so posting it in here would be too much.
I am using PBP 2.50, and I don't know if that really makes a difference when compared to PBP 2.60.
I will try Sayzer and Melanie recomendations and will keep you posted.
Any other tips? Thank you,
Robert
Hi, Robert
A simple trick in the Manual ...
disable the watchdog ... see CLRWDT command.
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 " !!!
*****************************************
One thing that will save you a lot of code is replacing repeated segments of code like for example - SEROUT ..... or LCDOUT. So, if you have a LCDOUT "Hello World" maybe 5 times in your code, it would be better to replace 4 of them with a gosub ShowHelloWorld and keep the LCDOUT "Hello World" in that subroutine.
Last edited by Jerson; - 8th November 2009 at 02:34.
Bookmarks