PIC32MZ2048EFM144 Modbus Problem (Solved)

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

Moderator: Benj

Post Reply
Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

PIC32MZ2048EFM144 Modbus Problem (Solved)

Post by Lagoda »

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 269 times
Modbus_ReadHoldingRegister_PIC32MZ.jpg
Modbus_ReadHoldingRegister_PIC32MZ.jpg (33.33 KiB) Viewed 5371 times
Last edited by Lagoda on Thu Dec 07, 2017 1:36 pm, edited 1 time in total.

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: PIC32MZ2048EFM144 Modbus Problem

Post by Benj »

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 274 times
Let us know how you get on.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: PIC32MZ2048EFM144 Modbus Problem

Post by Lagoda »

Hi Ben,

Hurray! :D

The repaired version is works perfectly.

Thanks for your quick help.

Lagoda

Post Reply