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 | + | 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 | + | * 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. | ||
Line 13: | Line 13: | ||
== 2008 Extracts == | == 2008 Extracts == | ||
− | |||
* 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 29: | Line 28: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3896 | * From: http://forum.sourceboost.com/index.php?showtopic=3896 | ||
Line 37: | Line 35: | ||
− | |||
* 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 | ||
Line 43: | Line 40: | ||
(*Not* the current date and time at run-time). | (*Not* the current date and time at run-time). | ||
− | + | 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 | + | 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?? | Surely the sw stack is used for 'main' and 'interrupt' functions, so local vars so they should be safe while the isr is running?? | ||
Line 60: | Line 56: | ||
− | |||
* 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 72: | Line 67: | ||
− | |||
* 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 92: | Line 86: | ||
− | |||
* From: 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 | ||
Line 99: | Line 92: | ||
− | |||
* 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 | ||
− | + | 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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
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. | 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. | ||
Line 124: | Line 107: | ||
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. | ||
− | |||
− | |||
* From http://forum.sourceboost.com/index.php?showtopic=2704&pid=14026&mode=threaded&start=#entry14026 | * From http://forum.sourceboost.com/index.php?showtopic=2704&pid=14026&mode=threaded&start=#entry14026 | ||
Line 134: | Line 118: | ||
− | |||
* From http://forum.sourceboost.com/index.php?showtopic=3687&pid=13897&mode=threaded&show=&st=0 | * From http://forum.sourceboost.com/index.php?showtopic=3687&pid=13897&mode=threaded&show=&st=0 | ||
Line 141: | Line 124: | ||
− | |||
* From http://forum.sourceboost.com/index.php?showtopic=3689&pid=13901&mode=threaded&start=#entry13901 | * From http://forum.sourceboost.com/index.php?showtopic=3689&pid=13901&mode=threaded&start=#entry13901 | ||
− | This looks like well documented but included as a | + | This looks like well documented but included as a goctgha. |
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). | 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). | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546 | * 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. | ...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. | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3670&pid=13847&mode=threaded&start=#entry13847 | * From: http://forum.sourceboost.com/index.php?showtopic=3670&pid=13847&mode=threaded&start=#entry13847 | ||
Line 160: | Line 141: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3669&pid=13792&mode=threaded&start=#entry13792 | * From: http://forum.sourceboost.com/index.php?showtopic=3669&pid=13792&mode=threaded&start=#entry13792 | ||
Line 166: | Line 146: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3649&pid=13765&mode=threaded&start=#entry13765 | * From: http://forum.sourceboost.com/index.php?showtopic=3649&pid=13765&mode=threaded&start=#entry13765 | ||
Line 173: | Line 152: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3658&pid=13746&mode=threaded&start=#entry13746 | * From: http://forum.sourceboost.com/index.php?showtopic=3658&pid=13746&mode=threaded&start=#entry13746 | ||
Line 180: | Line 158: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3644&pid=13713&mode=threaded&start=#entry13713 | * From: http://forum.sourceboost.com/index.php?showtopic=3644&pid=13713&mode=threaded&start=#entry13713 | ||
Line 186: | Line 163: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3588&pid=13562&mode=threaded&start=#entry13562 | * From: http://forum.sourceboost.com/index.php?showtopic=3588&pid=13562&mode=threaded&start=#entry13562 | ||
Line 192: | Line 168: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3602&pid=13596&mode=threaded&start=#entry13596 | * From: http://forum.sourceboost.com/index.php?showtopic=3602&pid=13596&mode=threaded&start=#entry13596 | ||
Line 198: | Line 173: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3598&pid=13576&mode=threaded&start=#entry13576 | * From: http://forum.sourceboost.com/index.php?showtopic=3598&pid=13576&mode=threaded&start=#entry13576 | ||
Line 204: | Line 178: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3593&pid=13553&mode=threaded&start=#entry13553 | * From: http://forum.sourceboost.com/index.php?showtopic=3593&pid=13553&mode=threaded&start=#entry13553 | ||
− | + | 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? Declare fixed address variables at the locations you want to protect. BoostLink will work around any fixed address variables. | |
− | |||
− | |||
− | 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: | Something like this would fit the bill: | ||
Line 222: | Line 192: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546 | * From: http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546 | ||
Line 229: | Line 198: | ||
The "<<", ">>", "&", and "|" operators. | The "<<", ">>", "&", and "|" operators. | ||
− | |||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3590&pid=13539&mode=threaded&start=#entry13539 | * 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. | 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 | * From: http://forum.sourceboost.com/index.php?showtopic=3587&pid=13523&mode=threaded&start=#entry13523 | ||
Line 257: | Line 222: | ||
− | |||
* From: http://forum.sourceboost.com/index.php?showtopic=3577&pid=13494&mode=threaded&start=#entry13494 | * From: http://forum.sourceboost.com/index.php?showtopic=3577&pid=13494&mode=threaded&start=#entry13494 | ||
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. | 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. | ||
+ | == going on == | ||
− | |||
*From: http://forum.sourceboost.com/index.php?showtopic=3574&pid=13469&mode=threaded&start=#entry13469 | *From: http://forum.sourceboost.com/index.php?showtopic=3574&pid=13469&mode=threaded&start=#entry13469 | ||
Line 278: | Line 242: | ||
− | |||
*From: http://forum.sourceboost.com/index.php?showtopic=3570&pid=13455&mode=threaded&start=#entry13455 | *From: http://forum.sourceboost.com/index.php?showtopic=3570&pid=13455&mode=threaded&start=#entry13455 | ||
Line 286: | Line 249: | ||
− | |||
*From: http://forum.sourceboost.com/index.php?showtopic=3571&pid=13459&mode=threaded&start=#entry13459 | *From: http://forum.sourceboost.com/index.php?showtopic=3571&pid=13459&mode=threaded&start=#entry13459 | ||
− | The | + | The libary code for one wire library use the nop() instruction. They should rewrite this lib becasue 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 |
Not sure about the above, you many want to see the original post | Not sure about the above, you many want to see the original post | ||
− | |||
*From: http://forum.sourceboost.com/index.php?showtopic=3566&pid=13440&mode=threaded&start=#entry13440 | *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? | Using BoostC version 6.85 should I be able to initialize the following structure? | ||
+ | |||
const struct { | const struct { | ||
Line 330: | Line 294: | ||
May want to check the manual to see if this change has been made ( if you find it, why not fix the wiki here? ). | May want to check the manual to see if this change has been made ( if you find it, why not fix the wiki here? ). | ||
+ | == still to format == | ||
− | + | 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. | |
− | |||
− | |||
− | |||
− | |||
+ | Anyway, the asm (MPASM) version is; | ||
+ | Data Memory, 11 bytes | ||
+ | Program memory 231 bytes | ||
− | |||
− | |||
− | + | The sourceboost version; | |
+ | Memory Usage Report | ||
+ | =================== | ||
+ | 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%) | ||
− | + | Keith | |
− | + | Corvette Engineering | |
− | |||
+ | -------------- | ||
− | + | http://forum.sourceboost.com/index.php?showtopic=3496 | |
− | |||
− | + | direct people to read this for usart lib info | |
− | |||
− | + | Pic16f628a Serial Usart | |
− | |||
− | |||
− | + | ------------- | |
− | |||
− | |||
+ | == and more == | ||
+ | 5th February 2008 - 09:06 PM | ||
+ | Last post by: eckertc | ||
+ | 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | stopped on the one above | |
− | + | == 2007 Extract, will I ever get here == |