MOD-RS485 with A and B flipped on STM32-E407

Started by Me, December 03, 2020, 05:25:23 PM

Previous topic - Next topic

Me

I have a working setup, but I have a problem I would like to resolve.

I'm using a PC with USB dongle to generate half duplex RS485 Modbus ASCII packets, communicating with the STM32-E407 via MOD-RS485 device.

I expect the PC RS485 wire A to MOD-RS485 wire A. However I have to connect A to B and B to A to get the communications to function. My question is, how do I get this to work with wire A connected to wire A as RS485 is typically wired?

I suspect that to get this to work with A to A, I would need to flip the the traces connected to UEXT3 and UEXT4 in the MOD-RS485 connector. AKA TX on the bus, goes to RX on the UEXT connector, and therefor RX of the STM32.

The STM32 is using alternate function 8, which connects USART 6 to the IO. That's per page 59 noted below. This terminology matches with the Olimex schematics TX and RX signals.
https://datasheet.octopart.com/STM32F407ZGT6-STMicroelectronics-datasheet-12357803.pdf

I can not post picture here, so I'll use this text equiv. This is the general signal path as it stands now, and has has several thousand successful messages passed over this configuration.

PC6 -->  pin 3 on UEXT which is USART6_TX --> Driver     Input    (DI)
PC7 -->  pin 4 on UEXT which is USART6_RX --> Receiver Output (RO)
PB10 --> pin 9  UEXT Transmit enable on UEXT3 when high
PG10 --> pin 10 UEXT Receiver enable on UEXT4 when low

PC RS485 line A is connected to UEXT line B
PC RS485 line B is connected to UEXT line A

I think Receiver Output should be connected to pin 3 on UEXT

USB adapter is this one
https://www.digikey.com/en/products/detail/b&b-smartworx,-inc./BB-485USBTB2WLS-A/9463391

PC is win10 64bit, using MODBUS Poll (master) software.
https://www.modbustools.com/modbus_poll.html

RS485 is 9600-8-N-1, wires are short on my desk. It's point to point right now with termination resistors installed. Scope shows clean square 3.3V signals.

STM32 program is using ChibiOS as the operating system.

LubOlimex

QuoteI expect the PC RS485 wire A to MOD-RS485 wire A.

Did you notice that MOD-RS485 wire A is actually the third (#3) terminal?
Technical support and documentation manager at Olimex