Page 1 of 4

Modbus TCP Slave

Posted: Fri Mar 15, 2024 8:43 am
by seokgi
Hello?

Project : Modbus gateway
MCU : PIC18F67K40(I made a PCB with PIC18F57Q43, but FC10 does not support the Q43 series)
Ethernet : W5500

While working on a project, Modbus TCP slave mode does not work.
I am sending the project file I wrote below. Please point out any mistakes.
Thank you

Re: Modbus TCP Slave

Posted: Fri Mar 15, 2024 10:19 am
by BenR
Hello,

Have you checked that the Wiznet module is configured and working by pinging the IP address 192.168.1.100? If it's not responding then it could be a problem with your pin connections or SPI speed etc. If still having issues then might be worth including a 1 second flasher just to prove that the chip is running and configured correctly.

Re: Modbus TCP Slave

Posted: Fri Mar 15, 2024 11:39 am
by seokgi
Ping to the IP address where W5500 is set works fine. And all other functions work normally.

Re: Modbus TCP Slave

Posted: Fri Mar 15, 2024 2:37 pm
by seokgi
Even if you change the SPI to software ch1 ch2, it does not work.
And even if I change the prescale to Fosc/64 Fosc/16 Fosc/4, it doesn't work.
PING is still works fine.
Thank you.

Re: Modbus TCP Slave

Posted: Mon Mar 18, 2024 5:10 am
by seokgi
I have tried various methods, but modbus tcp still does not work.
When I scanned with a port scan program, port number 502 was not scanned. When I run the Modbus slave program, the PC's port 502 is scanned.

Perhaps port number 502 is not assigned in FC10.
Is there any way to solve this?
Please help me.
Thank you.

Re: Modbus TCP Slave

Posted: Mon Mar 18, 2024 10:32 am
by BenR
Hello,

I'm doing some work with the W5500 at the moment so I'll see if I can replicate the problem and find a solution for you.

Re: Modbus TCP Slave

Posted: Tue Mar 19, 2024 10:55 am
by seokgi
Thank you for your help.
When will the PIC Q43 series be supported?

Re: Modbus TCP Slave

Posted: Fri Mar 22, 2024 7:45 am
by seokgi
I replaced the MCU for this project with PIC24FH512GA606. I tried changing all the options I could. However,

MODBUS TCP Slave does not work.

Ping works well.

I am posting the project I wrote.

Thank you.

Re: Modbus TCP Slave

Posted: Fri Mar 22, 2024 10:09 am
by medelec35
seokgi wrote:
Tue Mar 19, 2024 10:55 am
When will the PIC Q43 series be supported?
Hello to support new devices they have to be available within the compiler, then the fcdx file will need to be manually created.
For the current version of the XC8 compiler, only:
pic18f27q43
pic18f47q43
pic18f57q43
Are available for generating fcdx files.
We will be switching to a newer version of the XC8 compiler.
Then these will all be available to create fcdx files for:
pic18f25q43
pic18f26q43
pic18f27q43
pic18f45q43
pic18f46q43
pic18f47q43
pic18f55q43
pic18f56q43
pic18f57q43

fcdx creation for new targets are very involved and time consuming since there could be new peripherals added.

If you would like to suggest a target device to add, then we can look into adding that first.

Re: Modbus TCP Slave

Posted: Fri Mar 22, 2024 12:42 pm
by seokgi
I thought applying to Q43 would be quick and easy. But looking at what you said, it seems very difficult.
Knowing the above, I purchased 2,000 PIC18F57Q43 last year. I mainly use it for industrial purposes and use serial ports a lot.
So I want to use PIC18F57Q43. I would appreciate your support for this.

And I did a lot of testing like the post above, but MODBUS TCP SLAVE still doesn't work.
Please help me
Thank you.