I get error using 12f629 and RB0/INT

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
artloya
Posts: 8
Joined: Thu Oct 04, 2007 6:36 pm
Contact:

I get error using 12f629 and RB0/INT

Post by artloya »

I have been trying make a simple application to learn interrupt routine using a 12F629 chip. I get:
=========================
File name: C:\Program Files\Matrix Multimedia\AJL\12c629MacroTMRx.c
Generated by: Flowcode v3.2.1.38
Date: Thursday, October 04, 2007 13:19:31
Licence: Professional
Registered to: Arthur Loya


http://www.matrixmultimedia.com



Launching the compiler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC12F629 "12c629MacroTMRx.c"

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

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


12c629MacroTMRx.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" "C:\Program Files\Matrix Multimedia\AJL\12c629MacroTMRx.c" -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC12F629 -la -c2 -o 12c629MacroTMRx.pp -v -d _BOOSTC -d _PIC16

C:\Program Files\Matrix Multimedia\AJL\12c629MacroTMRx.c(143): error: missing semicolon
12c629MacroTMRx.c failure


failure

....
Return code = 1

Flowcode was unable to compile the flowchart's C code due to the following errors:


If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED
=======================
Using TMR interrupt work fine, but I can't get RB0/INT
I checked the asm code and did see INTCON, 1 for the timer.
but I'm stumped with RB0/INT (GP2/INT)
I hope you can help!

Thanks,
Art

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

Post by Steve »

Can you please post the contents of your "12c629MacroTMRx.c" here - especially the lines around line 143.

If you load the c file in notepad (or click "chip..view c file" from within Flowcode), you can use the "edit..goto" menu item to go to the line with the error (if this notepad menu item is disabled, you may need to turn "word wrap" off).

artloya
Posts: 8
Joined: Thu Oct 04, 2007 6:36 pm
Contact:

Post by artloya »

I created this using the flowcharts, I didn't use C.

this is line 143: void FCM_INTERRUPT_PORTB()


=========================================
.
.
.
//Macro implementations

void FCM_INTERRUPT_TMR0()
{

//Calculation
//Calculation:
// COUNT = COUNT + 1
FCV_COUNT = FCV_COUNT + 1 ;


}

void FCM_INTERRUPT_RB0INT()
{

//Calculation
//Calculation:
// COUNT = COUNT + 1
FCV_COUNT = FCV_COUNT + 1 ;


}

void FCM_INTERRUPT_PORTB()
{

}

void FCM_OutLED()
{
//turns on led1

// 2 COUNTin mac
//Calculation:
// COUNT2 = COUNT2 + 1
FCV_COUNT2 = FCV_COUNT2 + 1 ;


//Decision
//Decision: A2 = 1?
if( FCV_A2 == 1 )
{
//Output
//Output: 0 -> A0
trisio = trisio & 0xfe;
if (0)
gpio = (gpio & 0xfe) | 0x01;
else
gpio = gpio & 0xfe;


} else {
//Output
//Output: 1 -> A0
trisio = trisio & 0xfe;
if (1)
gpio = (gpio & 0xfe) | 0x01;
else
gpio = gpio & 0xfe;


}


}

//Supplementary implementations
.
.
.
================================
also got this today trying a variation of my original program:

opyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


12c629Macro.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" F:\Flowcode\12c629Macro.c -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC12F629 -la -c2 -o 12c629Macro.pp -v -d _BOOSTC -d _PIC16


...

F:\Flowcode\12c629Macro.c(155): error: missing right paren
F:\Flowcode\12c629Macro.c(155): error: missing semicolon
F:\Flowcode\12c629Macro.c(153): error: failure

failure

Return code = 1

Flowcode was unable to compile the flowchart's C code due to the following errors:


If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.

FINISHED

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

Post by Steve »

Please send the FCF and C files to us and we'll have a look.

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:

Post by Benj »

Hello Art

I have found the problem in your code.

The error is occurring on the following line of code.

0x0000000B.4=1;

Now this is because the compiler is trying to write a value of 1 into bit 4 of register 0. The compiler is trying to do this because you entered 0x0000000B into the interrupt register. Obviously this is not correct.

I see that you are trying to get an interrupt to occur when GP2 is pressed.

Now we have taken the work out of this for you so you can use the predefined RB0 interrupt to do the GP2 interrupt.

So if you open up the interrupt enable and change the custom to RB0 then your program should compile and run correctly.

If you wanted to create custom interrupts then you would have to use the register name in lowercase eg intcon and the register bit in upper case eg INTE

Hope that this helps.

artloya
Posts: 8
Joined: Thu Oct 04, 2007 6:36 pm
Contact:

rb0 doesn't work when I select 12f629

Post by artloya »

Hi Ben,
.
.
Now we have taken the work out of this for you so you can use the predefined RB0 interrupt to do the GP2 interrupt.

So if you open up the interrupt enable and change the custom to RB0 then your program should compile and run correctly.


I tried this again, still no luck :(
-Art

Post Reply