RS485 and RTS delay

2 replies [Last post]
bighouse
Offline
Joined: 2012-06-15

Hi,
i'm using the RS485 on lpc1343. I configured the RS485CTRL to use the RTS auto direction control and RS485DLY to have a delay time after the stop bit. My question: is there a way to get a delay between the assertion of RTS and the first start bit? The message should be: RTS_ON -> delay -> message -> delay -> RTS_OFF.
There isn't a registry for my question and i think the only way to do so is to disable the auto direction and set/reset manually the RTS. Any Ideas ?
Thanks

Gianluca

0
Your rating: None

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hparracho
Offline
Joined: 2012-07-31

Hi,

I'm facing the exact same situation here on LPC1788 and so far I haven't found a solution to this problem. The time between the OE/RTS assertion and the first start bit is too short and worse than that, isn't constant, it varies from transmission to transmission.
I'm afraid that there isn't a solution for what we want except disable the automatic RS485CTRL and do it manually.

If someone has a different opinion please let us know.

Regards,
Helder.

DiligentMinds.com
Offline
Joined: 2012-03-13

Wow this is interesting-- it looks like someone didn't think of this when they designed the peripheral in the chip! So, this would mean that the low-level driver has to babysit this signal for the first byte going out? Wow! Not good!

Maybe the sequence is: assert the RTS line (as GPIO) and send the first byte-- this is done at the application level (not the interrupt routine)-- then quickly switch over the GPIO to the RS485CTRL function (and I'm hoping that the RTS line will not "glitch" here), and then let the interrupt routine finish the rest of the message. That way, your interrupt routine is not wasting time delaying before the first byte of the message goes out (which could affect interrupt response for any lower level interrupts).

Could you try this out, and post back if it worked?

feedback