Questions about half duplex RS485 Network
I am currently working on the half duplex RS485 Network related
It seems that, the most popular implementation is to use the
9th-Bit (Parity Bit)
as an identifier to identify the Address-bytes and Data-bytes.
For most micro-controllers, they do support such a mechanism, for
According to the AT91SAM7S Series Preliminary:
220.127.116.11 Multidrop Mode
This mode differentiates the data characters and the address
characters. Data is
transmitted with the parity bit at 0 and addresses are transmitted
with the parity bit at 1.
31.6.6 RS485 Mode
The USART features the RS485 mode to enable line driver control. The
behavior of the RTS pin is controlled by the TXEMPTY bit.
# SENDA: Send Address
0: No effect.
1: In Multidrop Mode only, the next character written to the US_THR
is sent with
the address bit set.
# PARE: Parity Error Interrupt Enable
What software needs to do:
1. Set 'Multidrop Mode' on
2. Set SENDA bit
3. Send an Address-byte
4. Send the Data-bytes
General half duplex Receiver
General half duplex Transmitter
1. Interrupted by a 'Parity Error Interrupt', check the
2. If the Address-byte is correct, receive the following
Unfortunately, LPC2xxx does not support such a mechanism;
so I will have to implement it by software:
1. Poll UART Line Status Register to see if 'Transmitter Empty' is
2. Turn off the UART FIFO.
3. Set 'Forced "1" stick parity' and enable it in UART Line Control
4. Send an Address-byte.
5. Poll UART Line Status Register to see if 'Transmitter Empty' is
6. Disable 'parity generation and checking' in UART Line Control
7. Turn on the UART FIFO.
8. Send the Data-bytes.
General half duplex Receiver.
General half duplex Transmitter.
1. Interrupted by every incoming bytes, check if 'Parity Error'
2. If 'Parity Error' happens, check the Address-byte.
3. If the Address-byte is correct, receive the following
In the olden days, the micro-controllers were not very powerful,
so we had to reduce
the communication load. But for now, LPC2xxx is a 32bits
running on 48MHz, I think it is powerful enough. And if my
understanding is correct
(not confident), I don't see any communication load reduction with
LPC2xxx and 9th-Bit
Thus, is it a good idea, to use a packet instead of a byte? maybe
140 bytes or
1524 bytes for a packet, including both address and data. (SMS
message or Ethernet packet)
Though our system requirement is not well defined. I believe the
communication load will
not be heavy, maybe several kilo-bytes a day. If this is a
practicable idea, then how can
I implement it? I am not smart, so it is better to follow a existing
but I almost don't know anything about network protocols, which one
should I choose?
Please correct me and give me some hints. Many thanks in