Jump to content
jsimmon2

Inability To Build Project Using Boostc Compiler

Recommended Posts

Hello,

 

I am having difficulty in building my project using BoostC with the SourceBoost IDE. I have listed a header file of my project that is causing me

errors. Whenever I try to build the project, I always receive a vague error in the output window. I have been writing C for a while and I am certain

that my syntax is correct, however I am open for assistance. Can you please provide me with some insight Thank You?

 

// CPU: PIC 18F4620

// CLOCK RATE: 20 MHZ

// PURPOSE: INITIALIZATION SEQUENCES FOR THE PIC18F4620

#ifndef _KERNEL_H_

#define _KERNEL_H_

#include <system.h>

#include <stdio.h>

 

 

#define BIT_CLOCK_MAX 65535

#pragma DATA _CONFIG1H, _OSC_HS_1H

#pragma DATA _CONFIG2H, _WDT_OFF_2H

#pragma DATA _CONFIG2L, _PWRT_OFF_2L

#pragma DATA _CONFIG2L, _BOREN_OFF_2L

#pragma DATA _CONFIG4L, _LVP_OFF_4L

#pragma DATA _CONFIG3H, _MCLRE_ON_3H

#pragma CLOCK_FREQ 20000000

 

//----------------------------------

//------ TMR0 Declaration ----------

 

INTCON = 0xE0;

T0CON = 0X87;

TMR0H = 0x03;

TMR0L = 0x09;

 

 

// Initializing PORTA3:0 as Outputs

TRISA.3 = 0;

PORTA.3 = 0;

TRISA.2 = 0;

PORTA.2 = 0;

TRISA.1 = 0;

PORTA.1 = 0;

TRISA.0 = 0;

PORTA.0 = 0;

 

//----------------------------------

//----------------------------------

 

 

//----------------------------------

//------ TMR1 Declaration ----------

 

PIR1.0 = 0;

PIE1.0 = 1;

IPR1.0 = 0;

T1CON = 0xF1;

TMR0H = 0x0B;

TMR0L = 0x1D;

 

//----------------------------------

//----------------------------------

 

//----------------------------------

//------ TMR2 Declaration ----------

 

PIR1.1 = 0;

PIE1.1 = 1;

IPR1.1 = 0;

T2CON = 0x7F;

TMR2 = 0x00;

PR2 = 0xFF;

 

//----------------------------------

//----------------------------------

 

//----------------------------------

//------ TMR3 Declaration ----------

 

PIR2.1 = 0;

PIE2.1 = 1;

IPR2.1 = 0;

T3CON = 0x81;

TMR0H = 0xFF;

TMR0L = 0xFE;

 

//----------------------------------

//----------------------------------

 

#endif

 

Output window details:

 

main.c

 

failure

kernel.h(20):error: failure

"C:\Program Files\SourceBoost\boostc.pic18.exe" main.c -t PIC18F4620

Exit code was 1.

Removing target: main.obj

Done

Share this post


Link to post
Share on other sites

In BoostC, registers like INTCON are assigned using lower case (intcon).

 

All upper case (INTCON) is a #define with the register's address.

 

So, change all your variables to be lower case.

 

 

Also, although I'm not sure how true this is, but I tend not to put "#pragma DATA" statements inside of a header file. If the header is included in multiple source files, it could cause errors since you're initializing that register multiple times. I'm not sure how BoostC handles this, though.

 

- Bill

Share this post


Link to post
Share on other sites

Hello,

 

I have changed all of the registers to lowercase, and now the error is the following: #pragma CLOCK_FREQ 20000000 . Is there some declaration

issue with declaring the clock frequency this way? I am sure that I defined my pragma features efficiently, however that is the case since I still experience

errors. Can you please assist me?

 

Thank You

Share this post


Link to post
Share on other sites

You are diong assignments outside of a function block. Put your register assignments inside main() or some initialisation function.

 

void main(void)
{
 intcon = 0xE0;
 t0con = 0X87;
 tmr0h = 0x03;
 tml0l = 0x09;

...
}

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...