C4PIC Exercise 1.1 Problems

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:

C4PIC Exercise 1.1 Problems

Post by DonFL »

I'm using a version 3 Dev board, and starting thru the C$PIC course.

Trying to run exercise 1.1, but cannot build the program as I get errors from interrupt.c:

Code: Select all

 Building...
BoostC Optimizing C Compiler Version 6.57 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to C4PICs User under Single user Standard License for 1 node(s)
Limitations: PIC12,PIC16 max code size:4096 words, max RAM banks:Unlimited, Non commercial use only


interrupt.c
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(22:25): error: unknown identifier 'T0IF'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(22:25): error: invalid operand 'T0IF'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(22:20): error: failed to generate expression
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(22:16): error: invalid operand '~(1 << ( T0IF ))'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(22:13): error: failed to generate expression
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(46:24): error: unknown identifier 'T0IE'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(46:24): error: invalid operand 'T0IE'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(46:19): error: failed to generate expression
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(46:19): error: invalid operand '<<'
C:\Program Files\Matrix Multimedia\C4PICs16\SourceBoost\Samples\C\BoostC\interrupt.c(46:13): error: failed to generate expression

failure
"C:\Program Files\Matrix Multimedia\C4PICs16\sourceboost\boostc.pic16.exe" interrupt.c -t PIC16F88 
Exit code was 1.
Removing target: interrupt.obj
Done
I did some searching within the foum, but could not decipher the fix a it was described. Can't find anything in any of the documentation to help me understand this one. I'm using the 1688 supplied with the board.

Any help to get me moving in the right direction is appreciated.

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: C4PIC Exercise 1.1 Problems

Post by Benj »

Hello

My exercise 1.1 looks like this

Code: Select all

/*  EX1.1 Light a 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

void main()
{
	trisa = 0xfe; /* set bit 0 of PORTA for output     */
	porta = 0x01; /* set bit 0 of PORTA to 1           */
}
Is this the same as yours? Interrupt.c should not be getting called by anything in the code. Have you included it somewhere in the IDE environment?

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

Re: C4PIC Exercise 1.1 Problems

Post by DonFL »

Whenever I open Sourceboost via the C4PIC icon, that is what opens up. That appears to be the issue. I'll see what I can do to close it, or prevent it opening.

I should get a clean IDE with nothing opened when I first open Sourceboost, right?

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

Re: C4PIC Exercise 1.1 Problems

Post by DonFL »

I see what I am doing wrong.

I was clicking on the SourceBoost icon, rather than the link for the exercise under the vpic.

Post Reply