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
RS485 - Driver Enable/Reciever Enable
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: RS485 - Driver Enable/Reciever Enable
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.
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
Re: RS485 - Driver Enable/Reciever Enable
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
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
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
Re: RS485 - Driver Enable/Reciever Enable
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
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