Page 1 of 1

RS485 - Driver Enable/Reciever Enable

Posted: Wed Jun 10, 2020 11:28 am
by Lord Grezington
Hi Guys

I have now moved on in the project to get the RS485 working. Issue I am having is I would like to keep the UART based in hardware rather than software.

As the RS485 IC's use a NOT RE and a DE. I tie these two pins together and just use them as a single write enable pin (I have attached the datasheet).

Now, if I use the hardware to try and toggle the pin low to send data, the pin only drops low for a very short period of time (as we are using hardware UART).

The Modbus RS485 component has this Driver enable feature, but none of the other UART based components do. I cant use Modbus as we need to adapt to a different protocol.

I have throught of just adding a delay for the pin, but this is messy and defeats the object of using the hardware UART.

Does anyone have an idea on how I can get the pin to go low when sending data for just the right period of time using hardware UART?

Thanks

Re: RS485 - Driver Enable/Reciever Enable

Posted: Wed Jun 10, 2020 12:13 pm
by LeighM
Maybe you could set to Tx mode at the start of your data packet, then use an interrupt timer to disable the Tx mode after a given time, the time period for the transmitted data packet.

Re: RS485 - Driver Enable/Reciever Enable

Posted: Wed Jun 10, 2020 12:51 pm
by Lord Grezington
Yeah, I can see that working...

The timer will need to be different every time as I have a different number of data packets, but definitely worth giving a go.

Thanks Leigh

Re: RS485 - Driver Enable/Reciever Enable

Posted: Wed Jun 10, 2020 1:57 pm
by Lord Grezington
Hi Leigh

Yes, it does work. However I still needed to add a 200us delay before re-setting the time and sending the data packet. Still better than software though...

Is it possible to edit the UART hardware component to add this option rather than using the timer?

Thanks