PIC32MZ2048EFM144 Modbus Problem (Solved)

An area to discuss 32-bit PIC specific problems and examples

Moderator: Benj

Lagoda
Posts: 124
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 57 times
Been thanked: 44 times
Contact:

PIC32MZ2048EFM144 Modbus Problem (Solved)

Postby Lagoda » Wed Dec 06, 2017 8:33 pm

Hi Ben,

Now there is a problem with the Modbus Master component.
It would be good if you could help me.
While the Modbus Master sending a data packet to the Slave, during the DIR-pin switch to receiving.
On the RX pin also shows a 110ns long pulse, but I do not know why. (Probably due it is to switching direction.)
This program runs perfectly on a PIC24FJ256GA110 MCU.

I did not find the cause of the mistake.

Best Regards,

Lagoda
Attachments
PIC32MZ_Modbus_test.fcfx
(18.95 KiB) Downloaded 33 times
Modbus_ReadHoldingRegister_PIC32MZ.jpg
Modbus_ReadHoldingRegister_PIC32MZ.jpg (33.33 KiB) Viewed 995 times
Last edited by Lagoda on Thu Dec 07, 2017 1:36 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 13980
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4244 times
Been thanked: 4006 times
Contact:

Re: PIC32MZ2048EFM144 Modbus Problem

Postby Benj » Thu Dec 07, 2017 1:10 pm

Hi Lagoda,

Thanks for letting us know. I have previously fixed this for 16-bit PICs. Hopefully should also be fixed for PIC32 devices now too.

There's basically a multi-byte UART transmit pipeline so you're not sure when the data has been sent out unless you specifically check for it being empty before switching to RX mode.

Simply copy to your "Flowcode 7/components" folder and restart Flowcode.

Modbus.fcpx
(19.06 KiB) Downloaded 35 times


Let us know how you get on.
These users thanked the author Benj for the post:
Lagoda (Thu Dec 07, 2017 1:35 pm)
Rating: 5.88%
 

Lagoda
Posts: 124
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 57 times
Been thanked: 44 times
Contact:

Re: PIC32MZ2048EFM144 Modbus Problem

Postby Lagoda » Thu Dec 07, 2017 1:33 pm

Hi Ben,

Hurray! :D

The repaired version is works perfectly.

Thanks for your quick help.

Lagoda
These users thanked the author Lagoda for the post:
Benj (Thu Dec 07, 2017 9:15 pm)
Rating: 5.88%