cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with RS485 Communications Using STM32F723ZET6 Microcontroller and ST485ABDR Transceiver

SamBennet
Associate

Hi all,

 

I’m reaching out for assistance with integrating an ST485ABDR transceiver with an STM32F723ZET6 microcontroller. I have encountered issues while trying to control an RS485 stepper motor driver using this setup; however, I am able to communicate successfully with the motor driver using a software called “ModbusView TCP” (program that monitors and simulates Modbus ASCII, RTU, and TCP/IP communications from a PC). The below screenshot summarises each of the test setups.

SamBennet_0-1716259261165.png

The below screenshot illustrates the test setup using our PCB, along with the packets received at various stages:

SamBennet_1-1716259261170.png

The below screenshot illustrates the test setup using the ModbusView TCP software and a USB to RS485 converter, along with the packets received at various stages:

SamBennet_2-1716259261173.png

Below are screenshots illustrating how we have implemented the ST485ABDR transceiver and its interface with the MCU, as well as snippets of relevant code from the STM43CubeIDE.

SamBennet_3-1716259261174.png

 

Net Label:

Where connected to on MCU:

RECEIVER_OUTPUT_ENABLE_ACTUATOR

Port F GPIO 11 (Pin 49)

DRIVER_OUTPUT_ENABLE_ACTUATOR

Port F GPIO 12 (Pin 50)

ACTUATOR_1_RS422_TX

USART2_Tx (Pin 36)

ACTUATOR_1_RS422_RX

USART2_Rx (Pin 37)

 

Below are some screenshots of our code in STM32CubeIDE:

 

SamBennet_4-1716259261174.png

SamBennet_5-1716259261175.png

SamBennet_6-1716259261175.jpeg

SamBennet_7-1716259261176.png

SamBennet_9-1716259261180.pngSamBennet_8-1716259261179.png

SamBennet_10-1716259261181.png

SamBennet_11-1716259261181.png

SamBennet_12-1716259261183.png

 

We have verified with a logic analyser that the correct packet and CRC is being sent out of the MCU, and the ST485ABDR. Additionally, we have verified using a USB to RS485 converter that the packet is correct and when sent through PuTTY from a PC directly to the stepper motor driver we receive the response from the device we were expecting. We suspect that our issues have arisen due to us incorrectly implementing the ST485ABDR into our circuit. Below are some additional screenshots of what we measured using an oscilloscope.

 

SamBennet_13-1716259261188.png

 

SamBennet_14-1716259261193.png

 

SamBennet_15-1716259261197.png

 

SamBennet_16-1716259261201.png

I have been stuck on this for weeks so any assistance would be greatly appreciated :D

 

1 REPLY 1
Techn
Senior III

For simplicity you can connect RE and DE together since they have complimentary logic, when RE is low you should put DE also low else there can be interference.

you seems to be using UART_Transmit as a blocking call, so immediately after the data is send out you can disable the DE and enable RE and wait for receive to complete. Not clear how interrupt is generated. It is beset to try without any interrupt till you are sure of the Hardware setup with stm32.  Do you have terminating resistance for RS485?

STM32->rs485->rs485 to USB ->PC with Putty , you can verify TX and RX path independently.

 

If you feel a post has answered your question, please click "Accept as Solution".