Editing BoostC from the Fourm

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
This is the extraction of useful info on BoostC from its forum.  We hope it is the most useful information as it deals only with issues which lead to conclusions on information that might otherwse have been missed.  Each extract starts with a link to the forum thread, read it in full if you wish.  I have removed names and edited the text in a way that I hope makes it more readable.  It is just a forum, the postings may be outright wrong, or out of date.  The final product is mine ( I am responsible for posting the material ( check page history), I claim no ownership, nor am I responsible for the accuracy of the material or your results using it. )  If you object let me [russ_hensel] know, or fix it yourself.  It is a wiki so others than [russ_hensel] may have added/edited the content. Not included:
+
This is the extraction of useful info on BoostC from its forum.  Each extract starts with a link to the foum thered, read it in full if you wish.  I have removed names and edited the text in a way that I hope makes it more readable.  It is just a forum, the postings may be outright wrong, or out of date.  The final product is mine ( I am responsible for posting the material ( check page history), I claim no ownership, nor am I responsible for the accuracy of the material or your results using it. )  If you object let me [russ_hensel] know, or fix it yourself.  It is a wiki so others than [russ_hensel] may have added/edited the content. Not included:
  
 
* Things unresolved:
 
* Things unresolved:
Line 7: Line 7:
 
* Compiler issues that should have been fixed by now or soon
 
* Compiler issues that should have been fixed by now or soon
 
* Most hardware issues
 
* Most hardware issues
* Things that i think are covered in the manual
+
* Things that i thnik are covered in the manual
 
* Documentation of most things you cannot do.
 
* Documentation of most things you cannot do.
 
* Notices of projects, websites.... we should have these in the [[PIC Links]] or some other place.
 
* Notices of projects, websites.... we should have these in the [[PIC Links]] or some other place.
 
* Things I do not understand.
 
* Things I do not understand.
  
== 2008 Extracts ==
+
== 2008 ==
 
 
  
 
* From: http://forum.sourceboost.com/index.php?showtopic=3909&pid=14605&mode=threaded&start=#entry14605
 
* From: http://forum.sourceboost.com/index.php?showtopic=3909&pid=14605&mode=threaded&start=#entry14605
Line 24: Line 23:
 
1) Don't drag down the outputs with excessive load.
 
1) Don't drag down the outputs with excessive load.
 
2) Use a shadow register to hold the data written to the port.
 
2) Use a shadow register to hold the data written to the port.
3) Use the LAT register, if it is available.
 
 
See [http://techref.massmind.org/techref/readmodwrite.htm "The Read-Modify-Write problem"] for far more details.
 
  
  
-----------
 
 
* From: http://forum.sourceboost.com/index.php?showtopic=3896
 
* From: http://forum.sourceboost.com/index.php?showtopic=3896
  
Line 37: Line 32:
  
  
-----------
 
 
* From: http://forum.sourceboost.com/index.php?showtopic=3895&pid=14515&mode=threaded&start=#entry14515
 
* From: http://forum.sourceboost.com/index.php?showtopic=3895&pid=14515&mode=threaded&start=#entry14515
  
You can use the standard C macros for time and date which will generate text strings for the date and time the code was compiled.
+
You can use the standard C macros for time and date which will generate text strings.
(*Not* the current date and time at run-time).
 
  
  // CODE
+
  CODE
 
  char time[] = __TIME__;  // "16:38:53"
 
  char time[] = __TIME__;  // "16:38:53"
 
  char date[] = __DATE__;  // "Nov 30 2008"
 
  char date[] = __DATE__;  // "Nov 30 2008"
  
  
-----------
 
 
* From: http://forum.sourceboost.com/index.php?showtopic=3877&pid=14436&mode=threaded&start=#entry14436
 
* From: http://forum.sourceboost.com/index.php?showtopic=3877&pid=14436&mode=threaded&start=#entry14436
  
Question:  I can understand that the isr may interrupt the 'main loop' at any point and hence (global) variables may be in a indeterminate state, but why can't functions be used in both isr and main routines.
+
Question:  I can understand that the isr may interrupt the 'main loop' at any point and hence (global) variables may be in a inderterminate state, but why can't functions be used in both isr and main routines.
 
 
Surely the sw stack is used for 'main' and 'interrupt' functions, so local vars so they should be safe while the isr is running??
 
  
A: Most PIC C compilers assign all local variables for a function to a single fixed "global" location (very different from C compilers for other CPUs).
+
Surley the sw stack is used for 'main' and 'interrupt' functions, so local vars so they should be safe while the isr is running??
  
 
Answer:  The software stack (or memory overlay) means that all the memory useage on the "stack" has to be known at the time of linking the program. That makes functions that use the software stack un-interruptible or corruption will occur.
 
Answer:  The software stack (or memory overlay) means that all the memory useage on the "stack" has to be known at the time of linking the program. That makes functions that use the software stack un-interruptible or corruption will occur.
  
  
-----------
 
 
* From: http://forum.sourceboost.com/index.php?showtopic=3871&pid=14426&mode=threaded&start=#entry14426
 
* From: http://forum.sourceboost.com/index.php?showtopic=3871&pid=14426&mode=threaded&start=#entry14426
  
Line 69: Line 58:
 
There only seems to be a 'build' that explicitly deletes all object files and then rebuilds the whole lot!
 
There only seems to be a 'build' that explicitly deletes all object files and then rebuilds the whole lot!
  
Am I missing something? No. Thats the only option under MPLAB  
+
Am I missing something?
 +
No. Thats the only option under MPLAB  
  
 +
Regards
 +
Dave
  
-----------
 
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3862&pid=14378&mode=threaded&start=#entry14378
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3862&pid=14378&mode=threaded&start=#entry14378
  
Line 91: Line 82:
 
** also see:  Gotchas http://www.piclist.com/techref/microchip/gotchas.htm  and Tips and pitfalls http://www.voti.nl/swp/index.html  and LIST OF Most common errors with PICs http://www.micro-examples.com/public/micro...c/205-faqs.html
 
** also see:  Gotchas http://www.piclist.com/techref/microchip/gotchas.htm  and Tips and pitfalls http://www.voti.nl/swp/index.html  and LIST OF Most common errors with PICs http://www.micro-examples.com/public/micro...c/205-faqs.html
  
 
+
http://forum.sourceboost.com/index.php?showtopic=3762&pid=14225&mode=threaded&start=#entry14225
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3762&pid=14225&mode=threaded&start=#entry14225
 
  
 
GPIO is not currently supported by the PIC simulator.
 
GPIO is not currently supported by the PIC simulator.
Line 99: Line 88:
  
  
-----------
 
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3854&pid=14343&mode=threaded&start=#entry14343
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3854&pid=14343&mode=threaded&start=#entry14343
  
=== Using a library ===
+
To build (compile) a library, goto "Settings -> Options...", select Output Type: Library radio button.
  
 
To add a library to your project, goto the Workspace (project) window (left of screen usually), right click and add the .lib file you want to include.
 
To add a library to your project, goto the Workspace (project) window (left of screen usually), right click and add the .lib file you want to include.
  
Also #include the corresponding .h file in your source.
+
I think left out a subtle point in that most libraries need not only a .lib but also a .h which defines the function prototypes that the library contains. Then, the user of the library would also include the .h file in the source that is using it so that the compiler knows what to expect. This is the same as if you have multiple files in a stand-alone compile.
 
 
Remember: If you use #include <test.h> , the compiler expects the .h file to be in the ...\SourceBoost\include directory.
 
Use #include "test.h" if the header is in your local project directory. Or just use the full path name.
 
 
 
=== Building a library ===
 
 
 
To build (compile) a library, goto "Settings -> Options...", select Output Type: Library radio button.
 
 
 
I think left out a subtle point in that most libraries need not only a .lib but also a .h which defines the function prototypes that the library contains. Then, the user of the library would also #include the .h file in the source that is using it so that the compiler knows what to expect. This is the same as if you have multiple files in a stand-alone compile.
 
  
 
KeyLib.h
 
KeyLib.h
Line 125: Line 104:
 
You now have your .h file to match your .lib file.
 
You now have your .h file to match your .lib file.
  
 +
Remember: If you use #include <test.h> , the compiler expects the .h file to be in the ...\SourceBoost\include directory.
 +
Use #include "test.h" if the header is in your local project directory. Or just use the full path name.
  
-----------
+
=== extracted but not yet cleaned up ===
== linker options ==
 
* From http://forum.sourceboost.com/index.php?showtopic=2704&pid=14026&mode=threaded&start=#entry14026
 
  
Settings -> Options -> BoostC compiler Options -> Extra linker options.
+
http://forum.sourceboost.com/index.php?showtopic=3773&pid=14333&mode=threaded&start=#entry14333
What you add in the extra linker options is appended to the regular linker command line. You can append anything you want
 
  
 +
Reynard,
  
-----------
+
Thanks for the suggestion. It helped to find the source of the problem by changing the timing a bit more and it is now working. It turns out that the problem was disabling the UART before the reset. Taking out the statements
* From http://forum.sourceboost.com/index.php?showtopic=3687&pid=13897&mode=threaded&show=&st=0
 
  
It is not be possible to alter configuration words from the bootloader context.
+
txsta = 0;
That is your program should have the same configuration as the bootloader.
+
rcsta = 0;
  
 +
from the reset sequence resolved the problem and I can upload new firmware automatically and wirelessly!
  
-----------
+
http://forum.sourceboost.com/index.php?showtopic=2704&pid=14026&mode=threaded&start=#entry14026
* From http://forum.sourceboost.com/index.php?showtopic=3689&pid=13901&mode=threaded&start=#entry13901
 
  
This looks like well documented but included as a gotcha.
+
Settings -> Options -> BoostC compiler Options -> Extra linker options.
Have you tried reading the GPIO ports before clearing the interrupt flag GPIF?  The port has to be read to end the change mismatch condition otherwise GPIF will just set itself again (page 21 of data sheet).
+
What you add in the extra linker options is appended to the regular linker command line.
  
 +
=== still more ===
  
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546
 
  
...Is it not possible to get quick access to bits in an array?...  No it's not. You have to use good old bitwise operators.
+
It may not be possible to alter configuration words from the bootloader context.
  
 +
Are you sure that your PIC is able to change configuration words while a program is running?
  
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3670&pid=13847&mode=threaded&start=#entry13847
 
  
I had the UART on my USB/Serial thinger configured for 3V. That makes sure it does not work correctly gotcha.
+
In fact i'm sure it's not. I was hoping somebody had a work-around?
  
  
-----------
+
http://forum.sourceboost.com/index.php?showtopic=3689&pid=13901&mode=threaded&start=#entry13901
* From: http://forum.sourceboost.com/index.php?showtopic=3669&pid=13792&mode=threaded&start=#entry13792
 
  
All features supported by SourceBoost IDE built-in simulator are listed in Users Manual.  So anything NOT listed in the Users Manual (such as the Comparator), is NOT supported in the Simulator.
 
  
 +
This looks like well documented but included as a goctgha
  
-----------
+
Have you tried reading the GPIO ports before clearing the interrupt flag GPIF.
* From: http://forum.sourceboost.com/index.php?showtopic=3649&pid=13765&mode=threaded&start=#entry13765
 
  
Well as it turns out, once you come back from interrupt, the ports doesn´t retain the original configuration( analog comparators get turn on when they where off before interrupt). So now, I turn comparators off again, and load values in porta and portb, before coming back from interrupt.
+
The port has to be read to end the change mismatch condition otherwise GPIF will just set itself again (page 21 of data sheet).
Also I put a "while" loop in the interrupt service routine, to compare the value that portb should have with no key pressed, so if the key still pressed I scan the keyboard again BEFORE leaving the interrupt service routine. As soon as I have the time I think I´ll upload a post on dealing with wake up from sleep on interrupts, because I think it might benefit beginners like me.
 
  
 +
Cheers
  
-----------
+
Reynard
* From: http://forum.sourceboost.com/index.php?showtopic=3658&pid=13746&mode=threaded&start=#entry13746
 
  
I have a mystery. After using BoostC for some time all of a sudden there's no *.map file generated
+
http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546
Boostc compiler and linker has never generated a map file. The best option is to look in the *.lst file to find where everything is.
 
 
 
 
 
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3644&pid=13713&mode=threaded&start=#entry13713
 
 
 
The BoostC compiler does not currently support PIC18 Extended instructions.  This may change, rtfm.
 
 
 
 
 
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3588&pid=13562&mode=threaded&start=#entry13562
 
 
 
Post- and pre-build steps are now implemented in our working ide copy and will be available in the next release. It will work like this: when build command is issued IDE first looks in the project directory for a file called prebuild.bat and if found executes it. At the end of a successful build IDE looks in the project directory for a file called postbuild.bat and if found executes it. It's up to a developer to create those files. If such files don't exist build goes how it used to do. -- Should be implemented by the time you read this.
 
 
 
 
 
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3602&pid=13596&mode=threaded&start=#entry13596
 
 
 
BoostC does not have much of a stimulus, but wait: there is the signal generator in the extra plugins. Some devices have full ADC support and so the signal generator can be used on those with the ADC. Also the signal generator can be connected to digital pins to provide other stimulation.  Also highly exact timings can be had with the stopwatch plugin.
 
 
 
 
 
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3598&pid=13576&mode=threaded&start=#entry13576
 
 
 
Boostc doesn't support 12 bit instruction PICs.  See the list of supported devices to see what is supported, it is a lot.
 
 
 
 
 
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3593&pid=13553&mode=threaded&start=#entry13553
 
 
 
Q: The problem is that Debug Express reserves RAM, as well as some program memory, for its own use. e.g. on the 16F887 it reserves 0x070, 0x0f0, 0x165 to 0x170 inclusive and 0x1f0. (These are shown as RR in the MPLAB IDE file registers window). On larger projects requiring more RAM BoostC has no knowledge of these reserved locations and simply overwrites them. Does anyone know the best way, if there is one, of reserving these or any other locations to prevent them being used by BoostC?
 
 
 
A:
 
Declare fixed address variables at the locations you want to protect. BoostLink will work around any fixed address variables.
 
 
 
Something like this would fit the bill:
 
 
 
  char reserved_0x070 @ 0x070;
 
  char reserved_0x0F0 @ 0x0F0;
 
  char reserved_0x165[ 11 ] @ 0x0165;
 
  char reserved_0x1F0 @ 0x1F0;
 
 
 
I extracted the above but do not quite understand it, you may want to refer to the original post.
 
  
 +
QUOTE (Ian Smith @ Apr 11 2008, 04:29 AM)
 +
...Is it not possible to get quick access to bits in an array?...
  
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546
 
  
...Is it not possible to get quick access to bits in an array?...
 
 
No it's not. You have to use good old bitwise operators.
 
No it's not. You have to use good old bitwise operators.
The "<<", ">>", "&", and "|" operators.
 
  
 +
Regards,
 +
Pavel
  
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3590&pid=13539&mode=threaded&start=#entry13539
 
  
When a project contains multiple source files, is there a way to compile a single file?  You can try using "Project -> Quick", then select the source (.c) file you are interested in, and a mini project will be created containing only that single file.  When you are done, just delete the mini project file and go back to the main project.
 
  
  
-----------
 
* From: http://forum.sourceboost.com/index.php?showtopic=3587&pid=13523&mode=threaded&start=#entry13523
 
  
I am going to use the float.h and float.pic18.lib files.
 
Since I am going to calculate floats and I need to represent them on a LCD display, I have only one idea to work-around the missing "%f" in the lprintf format; I multiplicate the float variable by 10 (for example, needing only one decimal digit), convert it into long variable and then calculate the integer part (with sign) and the decimal of that long variable.  That should give me more possibilities to show a float-to-long variable on LCD...
 
Any other ideas?
 
  
This basically does what you suggested. Just format the intPart and fracPart with a decimal point between into a string.
+
Moderator, please close and delete this thread. I had the UART on my USB/Serial thinger configured for 3V. there's 2 weeks of embarrassment and wasted time i wish i had back. thanks again, for all the help.
  
void main(void) {
+
 
    float    myfloat;
+
http://forum.sourceboost.com/index.php?showtopic=3670&pid=13847&mode=threaded&start=#entry13847
    int32    intPart;
 
    int32    fracPart;
 
 
 
    myfloat = 3.14;
 
     
 
    intPart = float32_to_int32(myfloat);
 
    fracPart = float32_to_int32(float32_mul(float32_sub(myfloat, float32_from_int32(intPart)), 10.0));
 
}
 
  
  
-----------
+
toolrocket,
* From: http://forum.sourceboost.com/index.php?showtopic=3577&pid=13494&mode=threaded&start=#entry13494
+
QUOTE (toolrocket @ Jun 16 2008, 11:22 PM)
 +
Moderator, please close and delete this thread. I had the UART on my USB/Serial thinger configured for 3V. there's 2 weeks of embarrassment and wasted time i wish i had back. thanks again, for all the help.
 +
We won't delete this thread, someone else may make the same mistake or a similar mistake and find the information useful ;-)
  
I ran into a 'bug' in the PIC part itself. I found the solution here: http://forum.microchip.com/fb.aspx?m=306403  The 16F88 and a few other chips become unprogrammable if you use MCLR as an IO pin, you use the internal osc, and you set TIMER1 to use the internal osc as a clock source.  If you do all three, you can no longer program the part. The post gives the solution to recovering the chips.
+
Regards
 +
Dave
  
 +
http://forum.sourceboost.com/index.php?showtopic=3669&pid=13792&mode=threaded&start=#entry13792
  
-----------
 
*From:  http://forum.sourceboost.com/index.php?showtopic=3574&pid=13469&mode=threaded&start=#entry13469
 
  
I'm trying to read the tmr0 register using this chunk of code, called on INT interrupt:
+
All features supported by SourceBoost IDE built-in simulator are listed in Users Manual.
  
  ....
 
  pulse_timer1 = TMR0;
 
  ....
 
  
the line "pulse_timer1 = TMR0;" will place a 1 in the (unsigned char) pulse_timer1 register, no matter what the value of TMR0 is.
+
So anything NOT listed in the Users Manual (such as the Comparator), is NOT supported in the Simulator.
mmmm capitals.... It works if I use tmr0, not TMR0. The PIC's include file has TMR0 in upper case, so I'm a bit confused there!
+
Got it now; the above line is just for some future user trying to search for the answer.
  
TMR0 is the address of TMR0 register. tmr0 is a variable that is declared to have address TMR0. So when you access the tmr0 variable you access the registers value, and not its address.  Also note that a convention is that volitle variables ( which can change outside of code ) are always lower case.
+
Thanks,
 +
Jake
  
 +
http://forum.sourceboost.com/index.php?showtopic=3649&pid=13765&mode=threaded&start=#entry13765
  
-----------
+
I think I solve it !!  . As I was getting more and more frustrated, I decided to go for a simpler infrared code format wich doesn´t have separate repeat code, is an old bi-phase, six bit code format from siemens. Wich is simpler, so I could concentrate on getting the wake up on interrupt thing going.
*From:  http://forum.sourceboost.com/index.php?showtopic=3570&pid=13455&mode=threaded&start=#entry13455
+
Well as it turns out, once you come back from interrupt, the ports doesn´t retain the original configuration( analog comparators get turn on when they where off before interrupt). So now, I turn comparators off again, and load values in porta and portb, before coming back from interrupt.
 +
Also I put a "while" loop in the interrupt service routine, to compare the value that portb should have with no key pressed, so if the key still pressed I scan the keyboard again BEFORE leaving the interrupt service routine. As soon as I have the time I think I´ll upload a post on dealing with wake up from sleep on interrupts, because I think it might benefit beginners like me.
  
On the forum to format as code use [code] followed by your code and then ending with the same thing except end with /code in brackets. ( on the wiki have a least one space at the beginning of the line )  It then looks like this:
+
http://forum.sourceboost.com/index.php?showtopic=3658&pid=13746&mode=threaded&start=#entry13746
  
    unsigned char ix;
 
  
 +
QUOTE (Aegis-tec @ May 24 2008, 05:32 PM)
 +
I have a mystery. After using BoostC for some time all of a sudden there's no *.map file generated
 +
Boostc compiler and linker has never generated a map file. The best option is to look in the *.lst file to find where everything is.
  
-----------
+
Regards
*From:  http://forum.sourceboost.com/index.php?showtopic=3571&pid=13459&mode=threaded&start=#entry13459
+
Dave
  
The library code for [[one wire]] library use the nop() instruction. They should rewrite this lib because now it´s not working with different clock frequency. A work around is to run goodies if you have pro licens and change the code your self. Or you can download the lib code from lika.be
+
http://forum.sourceboost.com/index.php?showtopic=3644&pid=13713&mode=threaded&start=#entry13713
  
Not sure about the above, you many want to see the original post
+
The BoostC compiler does not currently support PIC18 Extended instructions.
  
 +
Regards
 +
Dave
  
-----------
+
http://forum.sourceboost.com/index.php?showtopic=3588&pid=13562&mode=threaded&start=#entry13562
*From:  http://forum.sourceboost.com/index.php?showtopic=3566&pid=13440&mode=threaded&start=#entry13440
 
  
Using BoostC version 6.85 should I be able to initialize the following structure?
+
BoostC does this as well trough its -d command line argument (take a look at compiler command line chapter in BoostC help). We also like the idea to have pre/post build scripts launched from IDE. I look at this and will try to have it done by the next release.
  
const struct {
 
    unsigned char NAME[4];
 
    unsigned char DAYS;
 
} MONTH[13] =  {
 
        "  ", 29,
 
        "Jan", 31,
 
        "Feb", 28,
 
        "Mar", 31,
 
        "Apr", 30,
 
        "May", 31,
 
        "Jun", 30,
 
        "Jul", 31,
 
        "Aug", 31,
 
        "Sep", 30,
 
        "Oct", 31,
 
        "Nov", 30,
 
        "Dec", 31
 
    };
 
  
 +
Post- and pre-build steps are now implemented in our working ide copy and will be available in the next release. It will work like this: when build command is issued IDE first looks in the project directory for a file called prebuild.bat and if found executes it. At the end of a successful build IDE looks in the project directory for a file called postbuild.bat and if found executes it. It's up to a developer to create those files. If such files don't exist build goes how it used to do.
  
The above approach results in "error: can't assign string to 'struct' variable."
+
Regards,
 +
Pavel
  
Complex initialisation like the above are not supported in current BoostC release. We plan to add support for it in the coming release. Meanwhile the workaround is to initialise variables outside of declaration like:
+
http://forum.sourceboost.com/index.php?showtopic=3602&pid=13596&mode=threaded&start=#entry13596
  
  ...
+
steve34,
  strcpy( MONTH[1].NAME, "Jan" );
+
QUOTE (steve34 @ Apr 18 2008, 06:48 PM)  
  MONTH[1].DAYS = 31;
+
So what is the signal generator in the extra plugins good for.
  ...
+
Some devices have full ADC support and so the signal generator can be used on those with the ADC. Also the signal generator can be connected to digital pins to provide other stimulation.
  
May want to check the manual to see if this change has been made ( if you find it, why not fix the wiki here? ).
+
Regards
 +
Dave
  
 +
http://forum.sourceboost.com/index.php?showtopic=3598&pid=13576&mode=threaded&start=#entry13576
  
-----------
+
I have some devices that use the 16f57 pic and was planning to write some new code for them - only to find that surprisingly BoostC doesn't support that pic.
* From:  http://forum.sourceboost.com/index.php?showtopic=3556
 
  
I have a small asm program for a 12F675. It's a light sequencer for those that must know ;-) The C version is completely unoptimised, it uses a big ol switch statement that is easy to read. The C version was MUCH easier to write only a few bytes bigger so it will be to version I keep.
+
Is it simply a matter of creating the appropriate include files, or is there something specific about this pic that boostc doesn't support (eg, 12 bit instructions).
 +
Boostc doesn't support 12 bit instruction PICs.
  
  Anyway, the asm (MPASM) version is;
+
Regards
  Data Memory, 11 bytes
+
Dave
  Program memory 231 bytes
 
  
 +
http://forum.sourceboost.com/index.php?showtopic=3593&pid=13553&mode=threaded&start=#entry13553
  
  The sourceboost version;
+
The problem is that Debug Express reserves RAM, as well as some program memory, for its own use. e.g. on the 16F887 it reserves 0x070, 0x0f0, 0x165 to 0x170 inclusive and 0x1f0. (These are shown as RR in the MPLAB IDE file registers window). On larger projects requiring more RAM BoostC has no knowledge of these reserved locations and simply overwrites them.  
  RAM available:64 bytes, used:32 bytes (50.0%), free:32 bytes (50.0%),  
 
  Heap size:32 bytes, Heap max single alloc:31 bytes
 
  ROM available:1024 words, used:277 words (27.1%), free:747 words (72.9%)
 
  
So BoostC does a good job without much fuss.
+
Does anyone know the best way, if there is one, of reserving these or any other locations to prevent them being used by BoostC?
 +
Declare fixed address variables at the locations you want to protect. BoostLink will work around any fixed address variables.
  
 +
Something like this would fit the bill:
 +
CODE
 +
char reserved_0x070 @ 0x070;
 +
char reserved_0x0F0 @ 0x0F0;
 +
char reserved_0x165[ 11 ] @ 0x0165;
 +
char reserved_0x1F0 @ 0x1F0;
  
-----------
+
Regards
* From:  http://forum.sourceboost.com/index.php?showtopic=3496
+
Dave
 
 
for a disucssion of serial comm in software ie: Pic16f628a Serial Usart.  Use the link.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3494&pid=13143&mode=threaded&start=#entry13143
 
 
 
Well, conveniently SourceBoost has a header file called "rs232_driver.h" which will do serial data communication pretty well! Now, unfortunately this is not generalised for any PIC and the 16F628A isn't one of the ones it is configured for. Don't worry. This isn't that bad an issue, but it will involve some research on your part. There is a sample rs232 project that you should look at first at SourceBoost/Samples/BoostC/SerialTest.__c. It is configured for the ... PIC18F452. Now. It looks all confusing at first with the preamble before main, but open up the datasheet for the PIC and reverse-engineer where it got the register locations, and then try to translate that to your own PIC. If you search for rs232 on this site I know someone made it work for the PIC16F627 so you might be able to use that as another reference on how it was translated.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3491&pid=13139&mode=threaded&start=#entry13139
 
 
 
When I link my project in sourceboost it links succesfull with still remaining 3 free bytes for code (.. )  When I link the same thing within the MPLAB it fails:  "Too much code to fit in ROM, overfilled by:27 locations."
 
 
 
I copied the linker options from the sourceboost IDE in MPLAB IDE. When I look at the linker execution lines sourceboost added extra options however which probably causes extra optimization when linking.
 
 
 
Answer:  The final binary is affected by the order the modules are linked together in because that affects their placement in memory, and hence may cause some jumps to cross code page boundaries. The order the modules are linked under MPLAB is different to that under SourceBoost IDE.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3489&pid=13124&mode=threaded&start=#entry13124
 
 
 
How do I unlock the library and goodies files.  I bought the ProVersion especially to get a hold of the library.
 
 
Answer:  Goodies require a separate key. This key is sent free of charge to all BoostC Pro and BoostC++ Pro license holders. Goodies key is generated manually so usually there is a short delay between sending a mail with compiler key and another email with goodies key.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3199
 
 
 
Reference To Volatile Variable  you will need to read this one yourself, extract it here if you get it
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3475&pid=13043&mode=threaded&start=#entry13043
 
 
 
A library is a precompiled binary file that means the compilation of the library code is only required once.
 
 
 
To create a library:
 
1) Create a header file containing function prototypes.
 
2) Create a .c file containing the implementation of the functions.
 
3) Set the Compiler options->Compile options->Output Type to Library.
 
4) Build the code.
 
If successful a .lib file is produce.
 
 
 
To use a library:
 
1) #include the library header file in any source file that will use any of the library functions.
 
2) Add the .lib file to the project.
 
3) Build the code to link in the library.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3484&pid=13085&mode=threaded&start=#entry13085
 
 
 
I like getting hex values when using Hover in the dubug mode, as shown in IDE User's Guide.  I'm getting octal numbers.
 
 
 
Answer:  Settings -> Options -> Debugger -> Default watch format
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3473&pid=13038&mode=threaded&start=#entry13038
 
 
 
I have been caught out recently by not reading the errata sheets, which Microchip have plenty off.  Look at the Rev A1 sheet for the 18F4520 issue #23. It explains problems with fast interrupts which may give random operation.
 
 
 
I should have said before, try using the linker option -isrnoshadow, which uses RAM to save the important registers rather than restore from the shadow registers (fast) for high priority interrupts.  Dave and Pavel have been here before.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3472&pid=13035&mode=threaded&show=&st=#entry13035
 
 
 
Standard practice is when prototypes go to headers and implementation to sources. The only exceptions are inline functions and templates. The reason for this is that for both compiler needs to know their implementation every time such functions get called.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3438
 
 
 
discussion of functions in interrupts, debouncing in various ways, see the post.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3463
 
 
 
I did not get this one, read it your self, perhaps you can summarize here.
 
 
 
 
 
---------
 
* From: 
 
 
 
Is there a way to force a variable to be allocated in a specific bank?
 
Yes, by giving it a specific adress, eg
 
 
 
  char z@0x43;
 
 
 
I can give any arbitrary value and this will not collide with other variables?  I need this in the ISR, so that more efficient code is generated.
 
 
 
I have sometimes seen that the amount of code decreases while I added some code and the other way around. Could this be explained by another distribution of the variables over the banks?
 
 
 
I can give any arbitrary value and this will not collide with other variables?
 
RAM locations that have associated variables with fixed addresses are not used by the compiler for any other use, so they won't collide unless you have another piece of code that uses a fixed address variable at the same address.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=2802&pid=10768&mode=threaded&start=#entry10768
 
 
 
Issue is location of code and jumps to code when using a bootloader.  One answer was:  I use this bootloader - it automatically fixes the short jump to a long jump.  http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm  Other bootloaders may also do this, perhaps the one at PIP Pack.  And/or read the whole post.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3457&pid=12979&mode=threaded&start=#entry12979
 
 
 
soft uart, read it for more info, think may a soft uart in the library support from BoostC.
 
 
 
 
 
-----------
 
* From:  http://forum.sourceboost.com/index.php?showtopic=3455&pid=12946&mode=threaded&start=#entry12946
 
 
 
I want to use the mplab debugger for a project.  Is there a way to convert\integrate existing project file(s) to mplab or do I really have to build separate mplab projects from scratch?
 
 
 
Answer:  Put your source files in a new directory(or not).Open MPLAB, start a new project(project(new)), give it a name, tell it the directory where your files are located. This will create the project. Now add your files. You'll need to make sure you point MPLAB to your compiler and linker(project(add language toolsuite)). Ctrl+F10(build)
 
  
== 2007 Extract ==
 
  
  
[[BoostC Forum Extracts 2007]]
+
stopped on the one above

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)