If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Hello Archangel,
I meant if I use the variable in the beginning of my code then I have to put the include before that which will automatically put the whole large piece of code in the beginning of the program memory and my main cycle and interrupt handler will be pushed in further program memory pages which will make them working slower (switching pages) in favor of seldom used subroutine which will be sitting on the first page.
Actually I do not know how long it takes switching pages. If this is just a couple of cycles than probably there is nothing to worry about... What do you think?
Does putting variables in upper banks works same way for RAM (saving cycles on switching pages?) So far I used this option (for RAM bank) only once because of a glitch preventing my program to work normally until I switched a bank for one variable - not sure what was the problem but the problem went away after that.
Best regards,
Alexey
Alexey,
You could just open up the include file and copy/paste the code into your main program and then re-arrange it all you want.
Nothing says you have to keep it in a separate Include file.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Yes, of course this is all possible.
I was just wondering if it is possible to do one simple include in the place where I want to see the code of my library in memory and use the functions without doing any definitions of the variables and the answer is that you may have convenience of use or control of there the code is placed in memory or convenience of pasting library code in a form of one piece "include" but not both if you want to use variables before the "include".
In most cases this is not a big deal - just put all includes on the top, unless you want your main cycle and interrupts work as fast as possible, then you start moving seldom used code down, play with clearwdt and so on and then you have to split includes or just copy pieces of it's content in two separate places.
Again, this is not a big deal, only a matter of some convenience of having own library functions
My guess is the included source is going where it wants, and you have no say about it.
Furthermore, I'll take a stab that the source for individual commands are ordered the same,
no matter what order your program first calls them.
Imagine you can push routines such as SERIN, PULSIN, DTMF.. out of the first page or RAM bank
because you thought your code was more important.
Now all of a sudden, a bunch of PBP's timed routines have to do bank/page switching
and you find out it was you that had to accommodate those routines rather than the other way around.
One trick you can do, is borrow some system variables if you can figure out when they are not being used.
There are variables used only to transport your PBP vars to it's serial routine for example.
Any other time your code is not executing a "serious" instruction, those system variables are sitting around doing nothing.
Bookmarks