Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reliable half duplex RS485 serial comms using 8051 UART

Status
Not open for further replies.

rowan.bradley

Junior Member level 1
Joined
Apr 28, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,446
Some things puzzle me about the serial ports on 8051 family devices (specifically I'm using the Dallas 80C320).
1. When transmitting, as I understand it the TI bit sets at the beginning of the stop bit. What happens if as soon as TI sets, I immediately send another byte? Does this chop off the stop bit, which is likely to cause the receiving device to detect a framing error? Or is the chip smart enough to complete the stop bit before starting to transmit the next byte? If the former, I need to allow one bit time delay before sending the next byte - what's the neatest way of doing this?
2. If I've just transmitted the last byte of a message, if as soon as TI sets I turn off the RS485 driver ready for a receive message, do I again chop off the stop bit? If so, again I presumably need to allow one bit time delay before turning off the driver - what's the neatest way of doing this?
3. When I write a value to SBUF, how quickly does the start bit start - within a few oscillator cycles, or in half or one bit time, or what?
4. When I'm transmitting on a half duplex RS485 bus, presumably the receiver receives all the bytes that I transmit? Presumably I have to make sure that I ignore any received bytes until I've turned off the driver and waited a bit time or two for things to settle, then I need to clear RI and wait for it to set again?
5. If I receive one byte, as I understand it RI sets half way through the stop bit. If another byte immediately follows, how quickly do I need to read the value of SBUF and clear RI to avoid the risk that the following byte corrupts the one I'm trying to read? I.e. do I have to read SBUF before the end of the stop bit (in half a bit-time)? Or do I have the whole of the receive time of the following byte to do this read? Or somewhere in between? Putting it another way, as the next byte comes in, what happens to the value in SBUF?
6. I know this is not really an 8051 question, but what's the correct method of making sure that when nothing is driving a half duplex RS485 bus, that all the listeners see a continuous "mark"? This seems to be necessary, because if they see a "space" they will interpret it as a start bit, followed by a NUL character, followed by no stop bit (i.e. a framing error). I'm using a MAX483 as my driver/receiver.

Thanks for your help!

Rowan
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top