Projects, Exercises, and SourceBoost

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Projects, Exercises, and SourceBoost

Post by DonFL »

I'm struggling a bit with the actual process of starting a new project in SourceBoost in order to do the exercises...I'm working with C4PIC.

For instance..if I want to start exercise 1.7, I obviously can click on the link, and it shows me the code, I can build/compile/link/program, and it runs.

But how do I start my *own* exercise 1.7 project?

I assume I click on the sourceboost icon above the content tree, but what then? I find myself getting a good grasp of the basics of the code, but can't see to figure out how to start my own program from scratch. I've tried using project->new, but get nowhere.

I've tried all kinds of things, such as saving the project files as a different name, and then re-opening, but with no consistent luck. Ideally, I'd like to have a standard shell project I can use, and then I write the code for each exercise.

I also see a strange thing in that, when I run the exercise programs that are included, clicking B(uild) takes the program all the way thru compile/link/program. Other times, it stops at build, and I need to do it manually. I sense there is a connection between the way I have options set, and my confusion re starting a new project/program, but am truly at a loss right now as to the what I am doing wrong, and the proper way to do things.

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

Ok, so I went back again, and worked thru the example of setting up a project. I then copied an exercise program into this new project file (in the .c file). I called the new project "first". When I build/link/compile/program, I get to the point of programming, and it tells me "failed to spawn (first.hex). check if path to this external application is correct".

I'm really at a loss here, and its not even as it relates to the programming itself... :cry:

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Projects, Exercises, and SourceBoost

Post by Benj »

Hello

Ok here is the route to creating your own project,

Open sourceboost via the C4PICs course and then click on Project and New. Give your project a name and specify the folder it will be located in and click ok. Then Choose a with empty source file and select the BoostC (NOT BoostC++) toolsuite and click ok. Double click on the C code source file located in your workspace and you should now be able to add your own code etc.

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

I did as you instructed, and got two warnings..tried this with several example programs.

"warning-unknown or invalid pragma" (when compiling).

it points to line 10, the config word:

Code: Select all

 /*  Flash one LED          */
/*  David Miles April 2006 */

#include <system.h>

/* Set 8 MHz clock frequency */
#pragma CLOCK_FREQ 8000000

/* Set PIC16 configuration word */
  pragma DATA _CONFIG1, _EXTRC_CLKOUT & _WDT_OFF & _LVP_OFF   //this is the pragma line referred to

void main()
{
	trisa = 0xfe; /* set bit 0 of PORTA for output */
	
	while (1)     /* loop forever                  */
	{
		porta = 0x01;
		porta = 0x00;
	}
}

then when trying to program, it gives me the "failed to spawn" message as noted in a previous post.

I copied the example program right off of the CD, and pasted it into sourceboost. However, when I open an exercise within the course, it works fine..this is the same copied program I'm trying to insert into my own project.

Unfortunately, I don't have a lot of time tonite to dig into it, but it seems I am doing something fundamentally wrong. Is there some other option/setup item I need to set?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Projects, Exercises, and SourceBoost

Post by Benj »

Hello

What if you take out the pragma definitions, these can be completed at a leter stage by the PPP software. Does the program compile then?

Code: Select all

/*  Flash one LED          */
/*  David Miles April 2006 */

#include <system.h>

void main()
{
   trisa = 0xfe; /* set bit 0 of PORTA for output */
   
   while (1)     /* loop forever                  */
   {
      porta = 0x01;
      porta = 0x00;
   }
}
Also which version of C4PICs are you using.

C4PICs V3 uses the C2C toolsuite
C for 16 Series PICmicro uses the BoostC toolsuite

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

Commenting out the pragma allows it to compile.

I still, however, get the "failed to spawn...check if path to this external application is correct" warning.

I don't have that happen if I run one of the exercises. The only thing different is the project.

So if I compare, here is my project file:

Code: Select all

[Settings]
Active Compiler=BoostC
[Files]
File0=ex13_DonTest.c
Count=1
[Plugins]
Speed Tester=6B094201040000004E6F6E65
Led Block=706F727462000000000000000000
Led=706F72746200000000000000000000000000
Button Block=706F72746200000000000000000000000000
Button=00706F727462000000000000000000
Bcd=706F727462000000000000000000
[Bookmarks]
Count=0
[Breakpoints]
Count=0


Here is the course project listing:

Code: Select all

Type=0
Warnings=1
[Files]
File0=Ex13.c
Count=1
[Bookmarks]
Count=0
[Breakpoints]
Count=0
[Plugins]
Bcd=706F727462000000000000000000
Button=00706F727462000000000000000000
Button Block=706F72746200000000000000000000000000
Led=706F72746200000000000000000000000000
Led Block=706F727462000000000000000000
Speed Tester=6B094201040000004E6F6E65
7 Segment LED=00040000007F00000000000000000000000000000000000352413000000000000000000352413100000000000000000352413200000000000000000352413300000000000000000000000000000000000000000000000000000000000000000000000003524230035242310352423203524233035242340352423503524236035242370003526564FF191900
[Compiler]
Extra=
[Linker]
Extra=
[Tools]
Programmer=""C:\Program Files\Matrix Multimedia\Common\PPPv3\PPPv3.exe""
BoostDir=C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost
[Tool State]
compile=1
link=1
program=1
[Debugger]
DebugFromMain=1
So I just copied the second over to the first, changed the Fole) name, and figured, that had the paths correct, I'm good to go. Nope..not the case. It seems to be flagging some boostC options. But this does seem to be where the root of the issue exists.

I've got C for 16 series, version 4. It is using the BoostC suite when I create the project.

I've got to step away from this for the day, but will be back at it tonite...open to any next steps to try.

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

any other thoughts or ideas on this one?..I'm at a loss..:(

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

I have figured out that the problem definitely lies in the _c project file. If I take the project file from an exercise that works, cut and paste, and rename, and then add c files as needed, I'm fine.

That said, there must be an easier way to do this. How do I automatically create that same proj file that the exercises have whenever I create a new project?

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Projects, Exercises, and SourceBoost

Post by Steve »

Do you have read/write privileges for the directory you are saving to? And have you selected the appropriate target device in the "settings..target" menu?

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

It's my own standalone computer, so no r/w issues there. The target device is correct also.

The question is, how do I create a project from scratch that will work as the exercises do? I can essentially clone one by opening a working one in notepad, and then copying and pasting into the new project file, but it is a clunky process to do it, and I find it hard to believe that is the only way. It's obvious the project file is different, and that is the issue, but what do I do to correct that?

I don't think it is a computer issue but rather, something in my setup or sourceboost, or the way the course version of sourceboost behaves.

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Projects, Exercises, and SourceBoost

Post by Steve »

If you are using Vista (or possibly any OS), you will experience read/write issues on a lot of directories. Make sure you work with projects in your own workspace.

I have followed Ben's instructions and could create and compile my own projects without problem. I don't know why you are experiencing these problems.

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

Using XP Pro.

So are you saying I should be able to create a new project, using the sourceboost version I open within the course CD, and not have to add or modify?

If that is the case, I'm curious if any other users are seeing the problem I am seeing.

I'd prefer to not have to go and instal on another machine to test, but it sounds like that may be my next step.

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

So I decided to start over, and completely uninstall and reinstall the course software.

I have other C/C++/PIC IDEs/compilers on my machine..could I have some issue there? There are no links or defaults set up that should cause an issue, and the fact that the exercises already contained in the course work, it makes me think not.

This is frustrating enough to where it makes doing the coursework so cumbersome, the exercises becomes more of an exercise in moving files around than learning the PIC programming concepts...:(

DonFL
Posts: 19
Joined: Mon Sep 29, 2008 3:39 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by DonFL »

I reinstalled, same problems.

I then went into the settings->options->tools in sourceboost, and reset the PPP target path, even though it appears it was correct. That seemed to fix it. I can now create programs from scratch, and they load fine. No clue why that is the case, I honestly don't think the path changed, so wondering if resetting it re-wrote something somewhere else.

I'll definitely trade not knowing exactly what I fixed for being able to start really moving on the course.

keesp
Posts: 17
Joined: Wed Sep 22, 2010 11:53 am
Contact:

Re: Projects, Exercises, and SourceBoost

Post by keesp »

I've experienced the same problems, and tried the same solution (selecting another PPP in the settings -> options -> tools menu, and then selecting the original one again) and everything worked ok again. I think it has to do with certain privileges in windows 7 / Vista , because it worked ok last year, and I have changed nothing in the installation since, except that there have been a few updates.

Post Reply