Difference between revisions of "BoostC from the Fourm"

From OpenCircuits
Jump to navigation Jump to search
Line 190: Line 190:
 
Dave
 
Dave
  
 +
http://forum.sourceboost.com/index.php?showtopic=3669&pid=13792&mode=threaded&start=#entry13792
  
                  08
+
 
 +
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
 +
 
 +
 
 +
 
 +
stopped on the one above

Revision as of 18:44, 13 January 2009

Introduction =

This is the extraction of useful info on BoostC from its forum. Not included

  • Things unresolved
  • Errors made by questioner
  • Compiler issues that should have been fixed by now or soon
  • Most hardware issues
  • Things that i thnik are covered in the manual
  • Documentation of most things you cannot do.
  • Notices of projects, websites.... we should have these in the PIC Links or some other place.

2008

not yet cleaned up

http://forum.sourceboost.com/index.php?showtopic=3909&pid=14605&mode=threaded&start=#entry14605


Sounds like the classic read modify write issue, when ports externally are being dragged down by whatever is connected to them. Remember that when a port is read on a PIC16 the actually logic level on the pins are read, not the last data written. This is not a problem on PIC18 if you use the LAT register as this actually holds the last data written.

Possible solutions: 1) Don't drag down the outputs with excessive load. 2) Use a shadow register to hold the data written to the port.


http://forum.sourceboost.com/index.php?showtopic=3896

Is This Technique Ok?, Implementing an array of function pointers

do not understand well enough to summarize


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.

CODE
char time[] = __TIME__;  // "16:38:53"
char date[] = __DATE__;  // "Nov 30 2008"


http://forum.sourceboost.com/index.php?showtopic=3877&pid=14436&mode=threaded&start=#entry14436

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?? 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.


http://forum.sourceboost.com/index.php?showtopic=3871&pid=14426&mode=threaded&start=#entry14426

I am using the BoostC compiler using the MPLAB environment (to be able to use the ICD2) and am doing a project that uses a number of source files (11 or so C files at the moment) to keep it all nice and modular.

However, I can't seem to find any way of doing a 'make' of the project (i.e. only recompile changed source files).

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

Regards Dave


more =

http://forum.sourceboost.com/index.php?showtopic=3862&pid=14378&mode=threaded&start=#entry14378


Does anyone know how to set the configuration for the PIC16F877A?

In general, how do we know to set the configuration for any specific PIC, let's say PIC18F452?



the 887 has a wizzard, use it.

then use any number of example programs out there.

use a guide for assembler, port.bit = xxx or set_bit clear_bit are easy to translate.

pragma s are used for some settings rtfm

then use the manuals

prepared to be amaized at how many mistakes can be made.

also see:


Gotchas http://www.piclist.com/techref/microchip/gotchas.htm


Tips and pitfalls http://www.voti.nl/swp/index.html


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. Its on the todo list, but we haven't got round to it yet


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.

I think Renard 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

Header files (.h) are not generated automatically. You have to build them yourself.

Open a blank page. Insert you function prototypes as trossin says (char ScanKeyMatrix(void). Save the file as test.h

You now have your .h file to match your .lib file.

Cheers

Reynard

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.


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


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


stopped on the one above