Page 1 of 1
Convert BoostC to XC8
Posted: Thu Jul 06, 2017 2:29 pm
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
Re: Convert BoostC to XC8
Posted: Thu Jul 06, 2017 3:17 pm
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");
Re: Convert BoostC to XC8
Posted: Thu Jul 06, 2017 3:37 pm
by LeighM
Re: Convert BoostC to XC8
Posted: Thu Jul 06, 2017 3:44 pm
by Ferla
Beny / LeighM ....... not even Superman and fast as you when you need it.

Thanks tonight I try to let you know.
Re: Convert BoostC to XC8
Posted: Thu Jul 06, 2017 3:52 pm
by Benj
The assembler command sleep can be replaced with this C command.
The assembler command reset can be replaced with this C command.
Re: Convert BoostC to XC8
Posted: Sat Jul 08, 2017 2:44 pm
by Ferla
Guys I got stuck and I can not understand why the compiler from these mistakes...!!!
Re: Convert BoostC to XC8
Posted: Mon Jul 10, 2017 10:17 am
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.
Re: Convert BoostC to XC8
Posted: Tue Jul 11, 2017 11:15 am
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.
Re: Convert BoostC to XC8
Posted: Tue Jul 11, 2017 12:59 pm
by Benj
Hello,
You can probably replace that code with the following.
asm("BCF _PORTB, 2");
Re: Convert BoostC to XC8
Posted: Wed Jul 12, 2017 7:21 am
by Ferla
Many thanks for your collaboration Benj
Fixed I did not put space between the 2 and the comma.
Greetings