PIC18F26K80 compiler error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

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:

PIC18F26K80 compiler error

Post by minolta »

Hi,

I try to read the state of PortE 3 (input only) but i get the bellow message from the compiler.
I have no issue with the other Ports.

{
Control module v1.0.c:
33: __config("__PROG_CONFIG", "pic18", 0x2, 0x74FE);
^ (1386) unable to determine the semantics of the configuration setting "WDTPS" for register "CONFIG2H" (warning)
Control module v1.0.c: FCM__16bit_Expander_initialization()
2049: break;
^ (345) unreachable code (warning)
Control module v1.0.c: main()
2749: FCV_ACK = (FC_CAL_Port_In_DDR__x((&PORTE), (&TRISE), ((1<<3)), (3)));
(192) undefined identifier "TRISE" ^
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]
}

Thanks

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC18F26K80 compiler error

Post by medelec35 »

Hi minolta,
I admit I'm not an expert on this side of things.
It's usually the compiler that causes these issues rather than Flowcode itself.
For 64 bit windows Just place attached file in C:\Program Files (x86)\Flowcode\Common\Compilers\pic\include\
or 32 bit windows Just place attached file in C:\Program Files\Flowcode\Common\Compilers\pic\include\

I'm not sure if it will work, but if it does then will get you by until an official release.

Martin
Attachments
pic18f26k80.h
(2.31 MiB) Downloaded 201 times
Martin

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

Re: PIC18F26K80 compiler error

Post by minolta »

Hi Martin,

Your solution solved my problem.
I compared the existing header file with your uploaded header file and "trisE" register declarations are missing.
This was the reason for the error.

thank you

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC18F26K80 compiler error

Post by medelec35 »

Hi minolta,
Your welcome.
minolta wrote:I compared the existing header file with your uploaded header file and "trisE" register declarations are missing.
Yes, I manually added register declarations as I thought they must have been missing.


Martin
Martin

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

Re: PIC18F26K80 compiler error

Post by minolta »

Because i want to understand more about this subject, from where did you get the info?
It is useful for future similar issues, maybe i'll be able to solve them faster.

Tiberiu

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC18F26K80 compiler error

Post by medelec35 »

minolta wrote:Because i want to understand more about this subject, from where did you get the info?
As there is an issue with port E for other 18FxxKxx devices, I loaded a older random device e.g 16F883.
As that compiled ok I looked at the header file, copied all of TRISE section.
Paste it on the 18F26K80 header.
Looked at the datasheet for TRISE register address and changed accordingly.


Martin
Martin

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

Re: PIC18F26K80 compiler error

Post by minolta »

I still have a problem, i read only "0" value from RE3 (with hardware pull-up added).
The conclusion regarding RE3 pin of PIC18F26K80 (28-pin) is this:

"Note: PORTE is unavailable on 28-pin devices" quote from data sheet, page 181.
I found an errata where is clearly stated: if MCLR pin is off, input data is not available on RE3, page 7.

This is the reason why PORTE wasn't defined in the header file.
This must be corrected in Flowcode as well, because RE3 can be setup as input, but the read value will be always "0"

Tiberiu
Attachments
PIC18F66K80-Silicon-Errata-Data-Sheet-Clarification-80000519P.pdf
(298.23 KiB) Downloaded 182 times
PIC18F26K80.pdf
(4.59 MiB) Downloaded 185 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PIC18F26K80 compiler error

Post by medelec35 »

Hi Tiberiu,
The datasheet is a bit confusing. :?
The pinout of 28 pin device on page 4 does show there is a portE.
However it does indeed also state that it's not available on 28 pin devices.
I have tested with proteus as as far as that's concerned port E is working as I used it to control an LED.
But I have learned just because it works on proteus does not necessary mean its going to work on hardware.
So if you have disabled MCLR within configuration settings and tested on hardware, then perhaps portE can be removed Form the device within flowcode as that is easy to do.

What is interesting is the defines for TRISE is indeed present with 18F46K80.
That would back up
minolta wrote:"Note: PORTE is unavailable on 28-pin devices" quote from data sheet, page 181.


Martin
Martin

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

Post by Benj »

I've been following along, many thanks for getting to the bottom of things.

I have now removed the E3 pin definition from the 28-pin 18(L)F2xK80 devices. These new definitions are now available via the updates system.

Post Reply