Help with XC compiler problem
-
- Posts: 94
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Help with XC compiler problem
To all,
I have a problem compiling a project that was made in flowcode6 and now trying to compile in flowcode9 and have the following problems any help would be great.
FCM_RS232_Rx()
9803: if ((rcsta & (1 << FERR)) != 0)
^ (192) undefined identifier "rcsta"
9805: dummy = rcreg;
^ (192) undefined identifier "rcreg"
9814: FCV_RX_BUFF[FCV_RX_BUFF_END] = rcreg;
^ (192) undefined identifier "rcreg"
c: main()
12468: pie1.RCIE=1;
^ (192) undefined identifier "pie1"
^ (196) struct/union required
12469: intcon.PEIE = 1;
^ (192) undefined identifier "intcon"
^ (196) struct/union required
12470: rcsta |= (1 << CREN);
^ (192) undefined identifier "rcsta"
12471: intcon.GIE = 1;
^ (196) struct/union required
c: myisr()
13554: if(pir1 & (1 <<RCIF))
^ (192) undefined identifier "pir1"
(908) exit status = 1
(908) exit status = 1
Thanks,
Wayne Millard
I have a problem compiling a project that was made in flowcode6 and now trying to compile in flowcode9 and have the following problems any help would be great.
FCM_RS232_Rx()
9803: if ((rcsta & (1 << FERR)) != 0)
^ (192) undefined identifier "rcsta"
9805: dummy = rcreg;
^ (192) undefined identifier "rcreg"
9814: FCV_RX_BUFF[FCV_RX_BUFF_END] = rcreg;
^ (192) undefined identifier "rcreg"
c: main()
12468: pie1.RCIE=1;
^ (192) undefined identifier "pie1"
^ (196) struct/union required
12469: intcon.PEIE = 1;
^ (192) undefined identifier "intcon"
^ (196) struct/union required
12470: rcsta |= (1 << CREN);
^ (192) undefined identifier "rcsta"
12471: intcon.GIE = 1;
^ (196) struct/union required
c: myisr()
13554: if(pir1 & (1 <<RCIF))
^ (192) undefined identifier "pir1"
(908) exit status = 1
(908) exit status = 1
Thanks,
Wayne Millard
-
- Valued Contributor
- Posts: 180
- Joined: Wed Dec 02, 2020 7:28 pm
- Has thanked: 73 times
- Been thanked: 63 times
Re: Help with XC compiler problem
Take a look at your C code icons. If you need help it would be best to post the code from them as code block on the forum in stead of having us try to distil th8ngs from the compiler errors.
-
- Matrix Staff
- Posts: 1560
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 555 times
- Been thanked: 514 times
Re: Help with XC compiler problem
Hi Wayne.
FC6 uses boost C which uses lower case for register names.
FC7 and above changed to XC8 which uses upper case for register names.
You will also require a different format.
Eg. instead of
Use
For
use
ect.
FC6 uses boost C which uses lower case for register names.
FC7 and above changed to XC8 which uses upper case for register names.
You will also require a different format.
Eg. instead of
Code: Select all
intcon.PEIE = 1;
Code: Select all
st_bit(INTCON,PEIE);
Code: Select all
FCV_RX_BUFF[FCV_RX_BUFF_END] = rcreg;
Code: Select all
FCV_RX_BUFF[FCV_RX_BUFF_END] = RCREG;
Martin
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Re: Help with XC compiler problem
Hi Martin,
Thanks for the feed back i have now changed all that you said and now have this problem.
12468: PIE1.RCIE=1;
^ (196) struct/union required
12469: INTCON.PEIE = 1;
^ (196) struct/union required
12471: INTCON.GIE = 1;
^ (196) struct/union required
(908) exit status = 1
(908) exit status = 1
Thanks for the help.
Wayne Millard
Thanks for the feed back i have now changed all that you said and now have this problem.
12468: PIE1.RCIE=1;
^ (196) struct/union required
12469: INTCON.PEIE = 1;
^ (196) struct/union required
12471: INTCON.GIE = 1;
^ (196) struct/union required
(908) exit status = 1
(908) exit status = 1
Thanks for the help.
Wayne Millard
-
- Matrix Staff
- Posts: 1560
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 555 times
- Been thanked: 514 times
Re: Help with XC compiler problem
You're welcome.
Yes you will have an issue.
Its to do withwill not work.
Best to use the format of
so you will need to use
instead of
Yes you will have an issue.
Its to do with
The format of
Code: Select all
REGISTER . BIT = value;
Best to use the format of
Code: Select all
st_bit(REGISTER, BIT) ;
Code: Select all
st_bit(PIE1,RCIE);
Code: Select all
PIE1.RCIE=1;
Martin
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
-
- Matrix Staff
- Posts: 1560
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 555 times
- Been thanked: 514 times
Re: Help with XC compiler problem
Hi Wayne,
All sorted now?
I have just remembered another way.
I statedwill not work.
However if you place a lower caseafter the register name e.g REGISTERbits.BIT = value;
It will work .
for example, you can use
Other things to note.
You can clear bits with cr_bit instead of st_bit.
If the bit name has a bar above it like this: The you must precede the bit name with a lower case n.
So to enable weak pull-ups on PIC16F1825 for example, you can use or
All sorted now?
I have just remembered another way.
I stated
Code: Select all
REGISTER.BIT = value;
However if you place a lower case
Code: Select all
bits
It will work .
for example, you can use
Code: Select all
PIE1bits.RCIE=1;
You can clear bits with cr_bit instead of st_bit.
If the bit name has a bar above it like this: The you must precede the bit name with a lower case n.
So to enable weak pull-ups on PIC16F1825 for example, you can use
Code: Select all
cr_bit(OPTION_REG,nWPUEN);
Code: Select all
OPTION_REGbits.nWPUEN = 1;
Martin
-
- Posts: 82
- Joined: Thu Dec 17, 2020 3:16 pm
- Has thanked: 20 times
- Been thanked: 12 times
Re: Help with XC compiler problem
This had stumped me some time: how to name a bit called (overbar)WPPU in the data sheet.
Of course: OPTION_REGbits.nWPPU = 1 !
Thanks (again) Martin.
Jan Didden
Of course: OPTION_REGbits.nWPPU = 1 !
Thanks (again) Martin.
Jan Didden
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Help with XC compiler problem
Hello,
If you ever need to know the specifics for a PIC device then the easiest way is to look at the .h file in the compiler pic/include/ directory.
For example for the 16F877A I looked at the pic16F877a.h file.
Then search the file for the register your interested in, here is the section for the OPTION_REG register.
If you ever need to know the specifics for a PIC device then the easiest way is to look at the .h file in the compiler pic/include/ directory.
For example for the 16F877A I looked at the pic16F877a.h file.
Then search the file for the register your interested in, here is the section for the OPTION_REG register.
Code: Select all
#define OPTION_REG OPTION_REG
extern volatile unsigned char OPTION_REG @ 0x081;
#ifndef _LIB_BUILD
asm("OPTION_REG equ 081h");
#endif
// bitfield definitions
typedef union {
struct {
unsigned PS :3;
unsigned PSA :1;
unsigned T0SE :1;
unsigned T0CS :1;
unsigned INTEDG :1;
unsigned nRBPU :1;
};
struct {
unsigned PS0 :1;
unsigned PS1 :1;
unsigned PS2 :1;
};
} OPTION_REGbits_t;
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel