Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

RS-485 w/ LPC21xx '550 UART

RS-485 w/ LPC21xx '550 UART

2004-04-29 by MaxStream - Ryan Bedwell

Folks,

Anyone out there who's figured out how to properly time the de-assertion 
of the 485 driver enable when using the LPC21xx UART?  Problem is, the 
driver needs to be tristated as quickly as possible after transmission 
of the last byte (perhaps during the stop bit would be ok?), but the 
LPC21xx UART doesn't really give you an indication of this.  I'm 
sniffing down some rather obscure approaches (i.e. perhaps exploiting 
the published THRE interrupt initialization conditions), but wanted to 
see if anyone has already solved the issue.

Regards,
Ryan

Re: [lpc2000] RS-485 w/ LPC21xx '550 UART

2004-04-29 by Charles Manning

On Thursday 29 April 2004 12:15, MaxStream - Ryan Bedwell wrote:
> Folks,
>
> Anyone out there who's figured out how to properly time the de-assertion
> of the 485 driver enable when using the LPC21xx UART?  Problem is, the
> driver needs to be tristated as quickly as possible after transmission
> of the last byte (perhaps during the stop bit would be ok?), but the
> LPC21xx UART doesn't really give you an indication of this.  I'm
> sniffing down some rather obscure approaches (i.e. perhaps exploiting
> the published THRE interrupt initialization conditions), but wanted to
> see if anyone has already solved the issue.

You really want to be using TEMT as the indicator (ie the holding and shift 
registers are empty). THRE just tells you that the holding resgister is empty 
[plus sone small print], there may still be data in the shift register.

Since the device is supposed to be 16550 compliant, I'd expect the solution 
to be well known and available.

Perhaps, if you have a spare timer, you could time a short period after the 
THRE interrupt. 

Perhaps, if you have a spare UART, you could pipe the one UART back into the 
other. When you see the rx on the second UART you know you're done with the 
tx on the first.


-- CHarles

Re: [lpc2000] RS-485 w/ LPC21xx '550 UART

2004-04-29 by Peter Jakacki

Charles Manning wrote:

>Perhaps, if you have a spare timer, you could time a short period after the 
>THRE interrupt. 
>
>Perhaps, if you have a spare UART, you could pipe the one UART back into the 
>other. When you see the rx on the second UART you know you're done with the 
>tx on the first.
>

Can't help it, the answer lies in the answer. If you leave the RS-485 
receiver enabled during transmission as well as the UART (the same one, 
not a spare) then you can turn off the RS-485 transmit enable straight 
after the last character received, simple!

Peter Jakacki

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.