PIC18F26K42 compiler error

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
minolta
Posts: 16
Joined: Tue Feb 05, 2013 8:36 pm
Location: Romania
Has thanked: 7 times
Been thanked: 7 times
Contact:

PIC18F26K42 compiler error

Post by minolta »

Hi,

I have an issue with PIC18F26K42 when i try to compile the code.

Error message is:

Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=18F26K42 "PIMF_amplifier_controller_v6.c" --MSGDISABLE=359,1273,1388
(922) chip "18F26K42" not present in chipinfo file "C:\PROGRA~2\FLOWCO~2\COMPIL~1\pic\dat\picc-18.ini"
(908) exit status = 1
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1

Indeed inside the picc-18 file, the 18F26K42 chipinfo are missing and both related files from cfgdata and cfgmap folders
are also missing.

Can somebody help me with these files, or from where to take the data to insert them in the existing files.

Thank you

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: PIC18F26K42 compiler error

Post by Benj »

Hello,

It looks like this might be a bug in the version of the XC8 compiler we ship with Flowcode.

To solve the problem it might be worth downloading and installing the latest version of the XC8 compiler from Microchip and then pointing Flowcode at the new compiler by changing the compiler path in the compiler options window.

Let us know how you get on.

minolta
Posts: 16
Joined: Tue Feb 05, 2013 8:36 pm
Location: Romania
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: PIC18F26K42 compiler error

Post by minolta »

Hi Benj,

I tried your suggestion and the result is below:

http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Microchip\xc8\v1.44\bin\xc8.exe --chip=18F26K42 "PIMF_amplifier_controller_v6.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.44
Build date: Sep 13 2017
Part Support Version: 1.44
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

PIMF_amplifier_controller_v6.c: myisr()
2595: if ((PIR1bits.TMR2IF) && (PIE1bits.TMR2IE))
^ (255) not a member of the struct/union ""
^ (255) not a member of the struct/union ""
(199) logical type required ^
(199) logical type required ^
^ (255) not a member of the struct/union 2598: PIR1bits.TMR2IF = 0;
""
^ (182) illegal conversion between types
int -> volatile union S178
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Microchip\xc8\v1.44\bin\xc8.exe reported error code 1



FINISHED


best regards

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: PIC18F26K42 compiler error

Post by Benj »

Thanks for letting us know. This updated definition file should solve the problem.

Simply copy the file to your "Flowcode 7/FCD/PIC" folder and restart Flowcode.
18F26K42.fcdx
(36.54 KiB) Downloaded 245 times
Let us know how you get on.

minolta
Posts: 16
Joined: Tue Feb 05, 2013 8:36 pm
Location: Romania
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: PIC18F26K42 compiler error

Post by minolta »

Hi Benj,

I copied the file.
Without using the interrupt the code is compiled successfully.
With TMR0 interrupt activated error message is:

Flowcode1.c: main()
102: T0CONbits.T0CS = 0;
^ (192) undefined identifier "T0CONbits"
^ (196) struct/union required
103: T0CONbits.T0SE = 1;
^ (196) struct/union required
104: T0CON = (T0CON & 0xF0) | 0x05;
^ (192) undefined identifier "T0CON"
106: INTCONbits.TMR0IE = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1280
Flowcode1.c: myisr()
135: if ((INTCONbits.TMR0IF) && (INTCONbits.TMR0IE))
^ (255) not a member of the struct/union ""
(255) not a member of the struct/union "" ^
(199) logical type required ^
(199) logical type required ^
138: INTCONbits.TMR0IF = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1280
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1



FINISHED

best regards

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: PIC18F26K42 compiler error

Post by Benj »

OK thanks, I'll have a better pass through the file tomorrow for you and check there aren't more problems lurking.

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: PIC18F26K42 compiler error

Post by Benj »

Right the attached file should hopefully solve the issues for you.
18F26K42.fcdx
(37.04 KiB) Downloaded 230 times
Let us know how you get on.

minolta
Posts: 16
Joined: Tue Feb 05, 2013 8:36 pm
Location: Romania
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: PIC18F26K42 compiler error

Post by minolta »

The error code list is shorter but still there.
If i can help in another way, besides compiling and posting error messages, just let me know.
TMR0 was used for interrupt.


Flowcode1.c: main()
98: T0CONbits.T0CS = 0;
^ (192) undefined identifier "T0CONbits"
^ (196) struct/union required
99: T0CONbits.T0SE = 1;
^ (196) struct/union required
100: T0CON = (T0CON & 0xF0) | 0x05;
^ (192) undefined identifier "T0CON"
101: INTCONbits.GIE = 1;
^ (192) undefined identifier "INTCONbits"
^ (196) struct/union required
102: INTCONbits.PEIE = 1;
^ (196) struct/union required
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Microchip\xc8\v1.44\bin\xc8.exe reported error code 1



FINISHED

best regards
Attachments
Flowcode1.fcfx
test program i used
(7.5 KiB) Downloaded 221 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: PIC18F26K42 compiler error

Post by Benj »

Hello,

These devices are significantly different from other devices in the 8-bit PIC family, the SPI and I2C peripherals amongst other things are basically totally unique. For now I would advise to use a different device if at all possible.

If not possible to use a different device then I've made a start at supporting the I2C and SPI peripherals but without a test chip I don't hold much hope of it working as the peripherals are now extremely complex.

minolta
Posts: 16
Joined: Tue Feb 05, 2013 8:36 pm
Location: Romania
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: PIC18F26K42 compiler error

Post by minolta »

Ok Ben,

I understand were the problem is.
I already found a replacement (18f26K80).
Thank you for explanations.

Tiberiu

Post Reply