Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] Re: RS485 9 Bit Comms on LPC2148

2005-12-13 by Tom Walsh

mhoneywill wrote:

>Thanks Tom, for the quick reply.
>
>  
>
>>I've a 9bit comm running now using an LPC2138 and LPC2106, both 
>>processors are using the internal uarts to do 9bit communications.  You 
>>are correct, you must turn off the fifo for this to work, if you don't 
>>disable the fifo then the wrong bytes get the wrong stick parity.
>>
>>    
>>
>
>I will try what you suggest to transmit the 9th bit. Do you turn the
>FIFO off permanently, or only when you are transmitting the start byte?
>
>  
>
Absolutely, it would be impossible to use the fifo when changing the 
stick parity state.  If the fifo is used, you would be, potentially, 
changing the parity state for the entire stack of chars, not just the 
one you want.

>>BTW,  I am running under full interrupt I/O on those fake 9bit
>>    
>>
>ports...  
>  
>
>>You don't need to poll.
>>
>>    
>>
>
>Are you using RS485 comms for half duplex. Do you have any thoughts on
>how to control the RS485 transmitter. It looks to me that you are only
>safe to turn the RS485 transmitter of when the TEMT bit in UxLSR is
>set. If my reading of the data sheet is correct this bit does not
>cause any interupts. It can only be polled. :-(
>
>  
>
Timers are good... I use ushort buffers, not uchar buffers, to  store 
9bit bytes for TX & RX.    Two special char patterns are fed to the 
serial port software layer.  I use these two chars to modify the 
behavior of the RS485 transciever: RS485_TX_MODE & RS485_RX_MODE.  So, 
using  the serial port becomes:

serial0send(RS485_TX_MODE);
serial0send(Address);
serial0send(data);
serial0send(data);
serial0send(data);
serial0send(RS485_RX_MODE);

As each special char is seen by the serial driver, various responsive 
actions are performed.  e.g.  RS485_TX_MODE switches the transceiver 
into TX mode, delays for a fixed period (line precharge time) and then 
starts putting data out the UART into the RS485 circuit..

TomW




-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Attachments

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.