Convert BoostC to XC8
Moderator: Benj
-
- Flowcode v5 User
- Posts: 126
- Joined: Sun Jan 06, 2013 8:58 pm
- Location: Italy
- Been thanked: 19 times
- Contact:
Convert BoostC to XC8
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
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
- 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
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");
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");
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Beny / LeighM ....... not even Superman and fast as you when you need it.
Thanks tonight I try to let you know.
Thanks tonight I try to let you know.
- 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
The assembler command sleep can be replaced with this C command.
The assembler command reset can be replaced with this C command.
Code: Select all
Sleep();
Code: Select all
RESET();
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Guys I got stuck and I can not understand why the compiler from these mistakes...!!!
- Attachments
-
- Error.rar
- (65.01 KiB) Downloaded 251 times
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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.
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.
- 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
Hello,
You can probably replace that code with the following.
asm("BCF _PORTB, 2");
You can probably replace that code with the following.
asm("BCF _PORTB, 2");
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Many thanks for your collaboration Benj
Fixed I did not put space between the 2 and the comma.
Greetings
Fixed I did not put space between the 2 and the comma.
Greetings