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. | ||
* Things I do not understand. | * Things I do not understand. | ||
− | == 2008 | + | == 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. | ||
− | |||
− | |||
− | |||
− | |||
* 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 | + | You can use the standard C macros for time and date which will generate text strings. |
− | |||
− | + | 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. |
− | |||
− | |||
− | + | 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? | + | 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 | |
− | |||
− | |||
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 | ||
− | + | 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 | ||
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 === | |
− | == | ||
− | |||
− | + | http://forum.sourceboost.com/index.php?showtopic=3773&pid=14333&mode=threaded&start=#entry14333 | |
− | |||
+ | 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 | |
− | |||
− | + | txsta = 0; | |
− | + | 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 | |
− | |||
− | + | Settings -> Options -> BoostC compiler Options -> Extra linker options. | |
− | + | What you add in the extra linker options is appended to the regular linker command line. | |
+ | === still more === | ||
− | |||
− | |||
− | + | 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? | ||
− | |||
− | |||
− | + | 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 | |
− | |||
− | |||
+ | 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). | |
− | |||
+ | Cheers | ||
− | + | Reynard | |
− | |||
− | + | http://forum.sourceboost.com/index.php?showtopic=3591&pid=13546&mode=threaded&start=#entry13546 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | QUOTE (Ian Smith @ Apr 11 2008, 04:29 AM) | ||
+ | ...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. | ||
− | |||
+ | Regards, | ||
+ | Pavel | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 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. | |
− | + | ||
− | + | http://forum.sourceboost.com/index.php?showtopic=3670&pid=13847&mode=threaded&start=#entry13847 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | toolrocket, | |
− | + | 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 ;-) | ||
− | + | Regards | |
+ | Dave | ||
+ | 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. | |
− | + | Got it now; the above line is just for some future user trying to search for the answer. | |
− | + | 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. |
− | + | 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. | ||
− | + | http://forum.sourceboost.com/index.php?showtopic=3658&pid=13746&mode=threaded&start=#entry13746 | |
− | |||
+ | 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 | |
− | + | Dave | |
− | + | http://forum.sourceboost.com/index.php?showtopic=3644&pid=13713&mode=threaded&start=#entry13713 | |
− | + | 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 | |
− | |||
− | + | 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | 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. | ||
− | + | Regards, | |
+ | Pavel | ||
− | + | http://forum.sourceboost.com/index.php?showtopic=3602&pid=13596&mode=threaded&start=#entry13596 | |
− | + | steve34, | |
− | + | QUOTE (steve34 @ Apr 18 2008, 06:48 PM) | |
− | + | 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. | |
− | + | 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. |
− | |||
− | + | 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. | ||
− | + | Regards | |
− | + | Dave | |
− | |||
+ | 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. | ||
+ | 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 | |
− | + | Dave | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | stopped on the one above |