RS485 - Driver Enable/Reciever Enable

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

RS485 - Driver Enable/Reciever Enable

Post 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
Attachments
sn65hvd485e.pdf
(1.25 MiB) Downloaded 155 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: RS485 - Driver Enable/Reciever Enable

Post 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.

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: RS485 - Driver Enable/Reciever Enable

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: RS485 - Driver Enable/Reciever Enable

Post 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

Post Reply