PIC18F26K42 and UART

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

Moderator: Benj

Post Reply
User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

PIC18F26K42 and UART

Post by AbhijitR »

Hello! Team and Friends

For some time i am trying to compile the attached chart but without success. May i request all to point out the mistake i am trying to configure the PIC for MODBUS slave and use that, it is not like i do not know how to use the MODBUS slave as i have used that in the past using few other chips but i really do not understand where am i going wrong to configure with this chip (PIC18F26K42)

If i delete the Modbus component then the chart compile and also work well, but the display works very slow, i have tried to run the display on internal (HFINTOSC with HFFRQ = 64MHz) as well external OSC (16MHz) with PLL, but in both case the display works very very slow, on contrary the same display works very good with other chip (PIC18F26K22) on 64MHz, very puzzling.

Attached is the chart, it is my humble request, kindly correct me.

Thank you.
Abhi
Attachments
Forum_18F26K42_OLED_AI_24-01-2021.fcfx
(22.59 KiB) Downloaded 152 times

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: PIC18F26K42 and UART

Post by AbhijitR »

Hello!

Following my previous post, may i request how to solve the below is the error received after compiling. I tried using Channel1 and 2, changing the port pins but no success.

Also i do not understand why the chip is running the display so slow. kindly try to help.
Microchip MPLAB XC8 C Compiler (Free Mode) V1.45
Build date: Nov 15 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Init_1()
647: INTCONbits.PEIE = 1;
^ (192) undefined identifier "INTCONbits"
^ (196) struct/union required
648: INTCONbits.GIE = 1;
^ (196) struct/union required
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Uninit_1()
922: PIE3bits.RC2IE = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S158
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_UpdateBaud_1()
1631: PIE3bits.RC2IE = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S158
1632: INTCONbits.PEIE = 1;
^ (192) undefined identifier "INTCONbits"
^ (196) struct/union required
1633: INTCONbits.GIE = 1;
^ (196) struct/union required
Forum_18F26K42_OLED_AI_25-01-2021.c: main()
6873: UART1_Init(9600);
^ (361) function declared implicit int (warning)
6876: UART_Set_Active(&UART1_Read, &UART1_Write, &UART1_Data_Ready, &UART1_Tx_Idle);
^ (361) function declared implicit int (warning)
^ (192) undefined identifier "UART1_Read"
^ (192) undefined identifier "UART1_Write"
^ (192) undefined identifier "UART1_Data_Ready"
(192) undefined identifier "UART1_Tx_Idle" ^
Forum_18F26K42_OLED_AI_25-01-2021.c: default_isr()
7051: if ((PIR3bits.RC2IF) && (PIE3bits.RC2IE))
^ (255) not a member of the struct/union ""
^ (255) not a member of the struct/union ""
(199) logical type required ^
(199) logical type required ^
7058: PIR3bits.RC2IF = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S185
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1

Autoclose turned off


FINISHED
Thank you.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PIC18F26K42 and UART

Post by QMESAR »

Abhi

There is an issue with the definition file for the chip ,Ben and the guys need to look at it for you,
from the errors it is clear that the code is looking for structure members that do not exists on this chip

Ask Ben to take care of it for you :D

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: PIC18F26K42 and UART

Post by AbhijitR »

Hello! Peter
good morning

Ah! happy to hear you, yes i am trying to ping Ben and team to look into this problem. I am feeling helpless now, i do not find any answer for the UART nor the speed of this chip, really struggling since couple of days, but hope to receive some answer after the weekend.

There is something i am missing in the settings or may be declaration in the C box for the speed and UART in the beginning of the loop, tried to read on Google, but honestly i do not understand.

Any ways hope to hear from the experts soon.

Abhi

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: PIC18F26K42 and UART

Post by AbhijitR »

Hello! Team

It seems there is no answer for my post for the moment, should I keep the thought alive of using this chip or drop that, kindly help.

Abhi

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 and UART

Post by Benj »

Hi Abhi,

Many apologies for the delay in getting back to you. The K42 devices are known to have taken the rule book and ripped it up and started again. We have already encountered a number of problems with them to do with timers and I2C.

I'll have a look at the UART functionality for you but I can't promise anything and my recommendation would be at this time to use a different micro if possible. The K22 device I beleive work much better with the existing code base and should be pin compatible.

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: PIC18F26K42 and UART

Post by AbhijitR »

Hi! Ben
good afternoon

No no Ben its okay, i know you are a busy person, but i wanted to hear that straight from the "Horses Mouth". Fortunately @Chipfryer27 and his MCP3201 chart helped me a lot with 12bit ADC (honestly Ben, try to launch this ADC component series if possible, it is missing in FC) and to keeping the K22 chip in use, i am using this chip for a long time and it really works very good with I2C, UART, SPI, unfortunately only 10bit ADC.

If you find some free time and check the UART for K42 kindly also check with the oscillator, i found, it did not work, or may be i am wrong with the settings.

Thank you.

Abhi

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PIC18F26K42 and UART

Post by QMESAR »

Hi Abhi.

Just be patient for a few days, I am almost finish with a component for the MCP320x devices ,You can be a test person for the component

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: PIC18F26K42 and UART

Post by AbhijitR »

Hurray! Peter

This is indeed a very good news, i am happy to see this components in FC, i think it was really missing, mean time can you help me, which chips are you planning for, so i will order a couple of each till the time you get ready.

Thank you again, hear you soon.

Abhi

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PIC18F26K42 and UART

Post by QMESAR »

Hi Abhi,

It will be for all chips that has a Hardware SPI Module

:D

Post Reply