Page 1 of 1

PIC18F26K42 compiler error

Posted: Fri Nov 17, 2017 8:19 pm
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

Re: PIC18F26K42 compiler error

Posted: Wed Dec 06, 2017 11:21 am
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.

Re: PIC18F26K42 compiler error

Posted: Tue Dec 12, 2017 8:46 pm
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

Re: PIC18F26K42 compiler error

Posted: Wed Dec 13, 2017 6:50 pm
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 248 times
Let us know how you get on.

Re: PIC18F26K42 compiler error

Posted: Thu Dec 14, 2017 10:17 pm
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

Re: PIC18F26K42 compiler error

Posted: Thu Dec 14, 2017 11:06 pm
by Benj
OK thanks, I'll have a better pass through the file tomorrow for you and check there aren't more problems lurking.

Re: PIC18F26K42 compiler error

Posted: Mon Dec 18, 2017 12:31 pm
by Benj
Right the attached file should hopefully solve the issues for you.
18F26K42.fcdx
(37.04 KiB) Downloaded 234 times
Let us know how you get on.

Re: PIC18F26K42 compiler error

Posted: Mon Dec 18, 2017 5:00 pm
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

Re: PIC18F26K42 compiler error

Posted: Mon Jan 15, 2018 2:14 pm
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.

Re: PIC18F26K42 compiler error

Posted: Mon Jan 15, 2018 6:35 pm
by minolta
Ok Ben,

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

Tiberiu