Convert BoostC to XC8

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

Moderator: Benj

Post Reply
Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times
Contact:

Convert BoostC to XC8

Post by Ferla »

Hello guys
You can help me in converting from FC4 BoostC to FC7 XC8.
I have a project created in FC4 with several icons in C code, now I would like to bring it to FC7 to make some changes.
After several nights of trying to find solutions by reading the XC8 manual and surfing the forum, ideas got confused.
I split by number.16 macro the code C to convert.Some are replicating.

Thank you
Attachments
Macro_icon_converter.txt
(1.61 KiB) Downloaded 255 times

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: Convert BoostC to XC8

Post by Benj »

Hello,

The following conversions should hopefully help.

intcon.GIE = 0; -----> INTCONbits.GIE = 0;
intcon.GIE = 1; -----> INTCONbits.GIE = 1;
intcon.RBIF = 0; -----> INTCONbits.RBIF = 0;
intcon.RBIF = 1; -----> INTCONbits.RBIF = 1;
clear_bit(intcon, RBIF); -----> INTCONbits.RBIF = 0;

INTCON.RBIE = 1; -----> INTCONbits.RBIE = 1;
INTCON2.RBIP = 1; -----> INTCON2bits.RBIP = 1;
INTCON2.RBPU = 1; -----> INTCON2bits.RBPU = 1;
RCON.IPEN = 0; -----> RCONbits.IPEN = 0;

wreg= portb; -----> WREG = PORTB;

These are ok.
PORTB = 0b00001110;
TRISB = 0b11110001;

Assembler statements now should look like this.

asm("CLRF _PORTA");

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Convert BoostC to XC8

Post by LeighM »

Or this ...

Code: Select all

#asm
	CLRF PORTA
	GOTO 0
#endasm

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times
Contact:

Re: Convert BoostC to XC8

Post by Ferla »

Beny / LeighM ....... not even Superman and fast as you when you need it. ;-)
Thanks tonight I try to let you know.

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: Convert BoostC to XC8

Post by Benj »

The assembler command sleep can be replaced with this C command.

Code: Select all

Sleep();
The assembler command reset can be replaced with this C command.

Code: Select all

RESET();

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times
Contact:

Re: Convert BoostC to XC8

Post by Ferla »

Guys I got stuck and I can not understand why the compiler from these mistakes...!!!
Attachments
Error.rar
(65.01 KiB) Downloaded 251 times

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: Convert BoostC to XC8

Post by Benj »

Hello,

Check your configuration settings inside the project options window. The extended CPU configuration setting is active but not supported by the compiler.

The other things seem to be warnings only.

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times
Contact:

Re: Convert BoostC to XC8

Post by Ferla »

Hi Benj
As you rightly advised, it was an active setup within the chip configuration.
Now you can compile perfectly but only if I remove the C code:
asm
{
bcf _porte,2
}

Try the formatting types you advise but nothing.
You can kindly tell me how to convert it correctly for XC8.
Thanks.

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: Convert BoostC to XC8

Post by Benj »

Hello,

You can probably replace that code with the following.

asm("BCF _PORTB, 2");

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times
Contact:

Re: Convert BoostC to XC8

Post by Ferla »

Many thanks for your collaboration Benj
Fixed I did not put space between the 2 and the comma.
Greetings

Post Reply