Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/25/03 09:28
Read: times


 
#44207 - RE: UART Tx unbuffered... Michael
Responding to: ???'s previous message
There is a scheme used by the company B&B Electronics that you may want to consider using. They call it "Send Data Control". In this scheme the transmitter Output Enable pin is controlled by a re-triggerable timing generator. The first TxD start bit triggers the driver on and continues to re-trigger on each transition of the TxD line. After the last character is sent the TxD line becomes quiet and the timer thus times out and the driver becomes disabled.

I have used RS232 to RS422 adapters from B&B Electronics in order to make a multi-dropped interface out of a series of embedded PCs in an industrial application. These adapters used the "send data control" scheme and it worked quite well.

Its only drawback is that there is some tolerance to the timers used because they are controlled by R/C time constants so you need to devise a part of your protocol to delay after the end of the transmit packet.

-----------------

All that said please note that it is not necessary, (and possibly not even desireable) to 3-state the driver after each byte sent by a slave. Instead the 3-state level should only be set after the last character of the whole packet has been sent.

-----------------

There is another scheme I have seen used to solve this problem that you may want to consider as well. In order for this one to work it is necessary for your RS422 bus termination resistors to bias the bus in a way that forces the lines to the STOP BIT level if all drivers are 3-stated. Secondly it is necessary to design your packet interface such that transmission of a byte that has all STOP BIT level data in it is not a normal part of the data sent in any packet. As a matter of fact you can use this byte pattern as a prescribed "end of packet" byte. (This scheme will work well with 8 bits transmission but if you go to a 9th bit such as parity it is mandatory that that bit also be sent at the STOP BIT level too). In the slave transmit interrupt routine you can look for this special byte pattern and at the time you load it into the SBUF for transmit you set a special bit flag. (Normally this flag is off and intialized off at system start up). On the next Tx interrupt you look at this flag being set and if so you know that the special byte has just been handled. Thus you then disable the transmitter at this time and clear the flag. Under all other Tx interrupt handling the flag is cleared and so you do not disable the transmitter but instead you enable it. The Master station that is in the process of receiving the special byte pattern will continue to clock in bits that are at the STOP BIT level because the termination resistors hold the lines to this voltage level even though the slave devices transmitter may have already been off for some number of bit times.

I clarify again that this scheme works as long as you design the protocol properly. It of course will fall apart if you try to send arbitrary binary data byte values within a packet. If you need to send binary data over the link in the packet it can be converted to hex/ascii or decimal/ascii for example.

Hope this helps

Michael Karas



List of 14 messages in thread
TopicAuthorDate
UART Tx unbuffered for common variants?            01/01/70 00:00      
   RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
      RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
         RE: UART Tx unbuffered... Michael            01/01/70 00:00      
            RE: UART Tx unbuffered... Michael            01/01/70 00:00      
               RE: UART Tx unbuffered... Michael            01/01/70 00:00      
                  RE: UART Tx unbuffered... Michael            01/01/70 00:00      
      RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
         RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
         RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
         RE: 'bible'            01/01/70 00:00      
   RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
      RE: UART Tx unbuffered for common variants?            01/01/70 00:00      
         RE: UART Tx unbuffered for common variants?            01/01/70 00:00      

Back to Subject List