Page 1 of 1

18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Fri Jul 07, 2017 12:45 pm
by lordhex
Hello Benj i found a small bug.
i made 4 swicth to input adress of slave in 16F877A and it is working.
Then i tried better mikrochips.
18F25K80 and 18F24K22
Both of them can work in simulation but
IF=i put the slave adress direct real life it is working.
But if i tried to put the adress by switch in simulation it is working but in real life it is not working.

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Wed Jan 23, 2019 7:47 am
by AbhijitR
Hello!

Kindly excuse if I have posted my doubt/problem on a wrong thread, I see no one answered LORDHEX.

May I request someone to point out the mistake I am doing or there is some other problem. I tried using PIC18F25K42 with one I2C display (gLCD_SSD1306_i2c1), one MODBUS slave and three Analog Inputs, the compilation ends up with errors on contrary if I change the chip to PIC18F25K80 the compilation returns with success.

Kindly help me to understand.

Regards
Abhi

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Wed Jan 23, 2019 9:17 am
by QMESAR
Hi
your 18F25K42 compile fine with me in FC 7
see screen printbelow

Did you install the latest updates for FC 7 from here
viewtopic.php?f=63&t=19743

P1.jpg
P1.jpg (135.41 KiB) Viewed 1861 times

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Wed Jan 23, 2019 11:02 am
by AbhijitR
Hi! QMESAR

Many thanks for your quick reply, kindly excuse me I forgot to mention the version, presently I am using FC8.0.0.6, may be FC8 is not compiling well or may be some update is missing.

Regards
Abhi

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Wed Jan 23, 2019 3:10 pm
by QMESAR
HI
Ok you posted in the FC 7 forum please post in the FC8 forum next time around :D .

Your code (FC chart) compile fine for me in FC8 V8.1
Please update to FC V8.1 and try again

P1.jpg
P1.jpg (129.5 KiB) Viewed 1852 times

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Thu Jan 24, 2019 6:00 am
by AbhijitR
Hi! QMESAR

Great I am happy to hear that the flowchart complied well on your machine with FC8, so now I am sure that the problem is because my FC which is not updated.

For your knowledge, I tried updating my FC8 in the past but unfortunately it do not work, bellow is the process I follow,
Under HELP tab there is an option "Check for Updates...", every time I run this option it returns with "no updates available", so either I am doing something wrong or I don't know the correct protocol to check for updates.

May I request you to help me through.

Thank you, hear you soon.

Regards
Abhi

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Thu Jan 24, 2019 7:49 am
by QMESAR
Hi

To update to FC8 V8.1 you have to go an download it from the web page ,FC does not update to 8.1 from the update system and you will not get any notice about updates in the updater as it is blocked so to say. deinstall the old FC download 8,1 and install it and your issue is solved

Good luck

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Sat Jan 26, 2019 2:01 pm
by AbhijitR
Hi! QMESAR

Kindly excuse for the delayed reply, following your previous post, I uninstalled the FC8, downloaded/installed the FC8.1 and again tried to compile but unfortunately the same error, may I request you to check the properties I have set for the Display as well Modbus and Project Option too.

One more thing I observed, when I select the device PIC18F25K42, the I2C and UART, receives additional pins to select from the drop down menu in the properties window, I think something goes wrong over there, but I do not understand where and why.

Thank you, hear you soon.

Regards
Abhi

NOTE: in my previous post (Jan 23rd) the FC for PIC18F25K42, I forgot to change the device to PIC18F25K42 from PIC18F25K80, from the Project Option.

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Sat Jan 26, 2019 5:47 pm
by QMESAR
Hi

I checked your flowchart and to me there is a configuration/definition error for the chip in Flowcode (cal components).
The team will solve this for you or Martin :D

@Team
below the compiler errors with MODBUS not active only LCD then the I2C errors are shown second time around gLCD not Active MODBUS
errors caused some strange reports :D

P1.jpg
P1.jpg (124.24 KiB) Viewed 1804 times



P2.jpg
P2.jpg (69.89 KiB) Viewed 1804 times

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Sat Jan 26, 2019 6:48 pm
by AbhijitR
Voila!

Many many thanks for the efforts my friend, I am sure Ben (team) or Martin for sure will find some answer.

Cheers...

Regards
Abhi

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Sun Jan 27, 2019 7:15 am
by QMESAR
Hi
You are welcome :D

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Tue Jan 29, 2019 12:00 pm
by AbhijitR
Hi! Ben (Team) and Martin

May I request you to shed some light on my above post.

Thank you, hear you soon.

Regards
Abhi

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Wed Jan 30, 2019 5:58 pm
by Benj
Hello,

The topic is a bit strange. It details the k80 devices and K22 devices but reading the text the problem is with a k42 device. Looks like it's maybe a hijacked topic.

Anyway looking at the K42 device datasheet it looks like the registers for I2C/SPI etc have been completely re-done so we will have to spend some time re-working the FCD and CAL to suit. Do the K22 and K80 devices have similar issues?

I'll try and get on with this later this week, for now you might want to use a different device if that is an option.

Re: 18F25K80 AND 18F24K22 MODBUS SLAVE PROBLEM

Posted: Thu Jan 31, 2019 12:22 pm
by AbhijitR
Hi! Ben

Kindly excuse for the hijack, :(

To be honest I tried to learn/read from the forum regarding the PIC18F25K42 and PIC18F25K80 but I did not find any relevant topics with MODBUS and I2C reference.

Regarding the ***K22 device I am not aware, instead ***K42 was the option in front of me, unfortunately ***K42 do not compile well, rather generate an error.

So I tried to check ***K80, no doubt it complied well but the device is not available with my supplier for the moment (MOQ problem) so I insisted to use ***K42 but there is some compilation problem, I hope it will get resolved soon.

Thank you, hear you soon.

Regards
Abhi