S
S
Slavka2015-11-25 19:50:40
C++ / C#
Slavka, 2015-11-25 19:50:40

How to set port for rts, for rs485 in freemodbus?

I can’t find the place where the pin number is indicated in this library to enable transmission when modbus works via rs485, please indicate that place

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Ocelot, 2015-11-25
@Ocelot

The file port.h (it is different for each architecture), it has something like

#define RTS_PIN         PD2
#define RTS_DDR         DDRD
#define RTS_PORT        PORTD

K
kosmos_cs, 2015-11-26
@kosmos_cs

If I understood correctly, you need to turn on the RTS pin, so in theory it should be turned on by hardware when data is received in the send buffer, only if your UART module on the MK supports RS-485 mode.
I also somehow used freemodbus only on dsPic33, I had to manually turn on the pin. That is, I checked the buffer for NON-emptiness and turned on the pin. After sending, I turned it off already in the handler, it seems)

L
Luky_Fucky, 2017-06-16
@Luky_Fucky

By chance, no one had modbus libraries for dsPIC33 left, at least examples ...
Otherwise, I downloaded freemodbus-v1.5.0, dragged raw materials from BARE into the project and fell into a stupor ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question