BCM1250/BCM1125/BCM1125H
User Manual
10/21/02
B r o a d c o m C o r p o r a t i o n
Page
322
Section 10: Serial Interfaces
Document
1250_1125-UM100CB-R
O
PERATION
The two channels of the DUART are identical in terms of configuration and operation. They are controlled by
a set of memory mapped registers, in most cases separate registers are provided for channel A and channel
B (the register names are identical with either
_a
or
_b
indicating the channel); in a few cases the two channels
are combined.
Prior to operation a channel must be configured. The
duart_mode_reg_1
is used to set the number of data
bits in a character (either 7 or 8) and whether parity should be added. The parity bit may be set to give either
an even or odd number of ones, or to be fixed as a high (mark) or low (space). The number of stop bits are set
in the
duart_mode_reg_2
. These registers are also used to enable hardware RTS/CTS handshake separately
in each direction. The baud rate should be set in the
duart_clk_sel
register. The mode and clock registers
should only be written while the interface is inactive, changing the parameters while the UART is active results
in UNPREDICTABLE behavior. Once configured the transmitter and receiver are enabled by writing the
duart_cmd
register.
The transmitter indicates that it is able to accept data into the transmit FIFO by setting the duart_tx_rdy bit in
the
duart_status
register. For as long as this bit is set, the CPU can write characters to the
duart_tx_hold
register and they will be inserted in the transmit FIFO. If the transmitter is enabled characters are extracted
from the FIFO, have a (low) start bit prepended, parity and (high) stop bits appended and are serialized (least
significant bit first) and sent to the DOUT pin.
The transmitter may be disabled or reset by issuing a command to the
duart_cmd
register. Disabling
transmission will cause transmission to stop and the line idle (high) when transmission of the current character
is complete, any characters in the FIFO will remain there to be sent when the transmitter is re-enabled. The
break command is similar to disable except when transmission of the current character (including stop bits) is
complete the line is driven low. The break condition is cleared with the stop-break command, which removes
the break synchronously with the transmit bit clock. Resetting the transmitter will cause the current
transmission to be aborted and all characters in the FIFO to be discarded, all transmitter state is cleared and
it is left in the disabled state. Until the FIFO becomes full characters can continue to be inserted into the FIFO
even if the transmitter is disabled (if the disabled state was reached through the reset command any characters
in the FIFO when the reset was issued are lost, after this characters can be inserted into the now empty FIFO).
The receiver will detect the (low) start bit on the DIN line, and use it to synchronize the local bit clock. Data bits
are then sampled in the middle of the bit time until the data and parity bits have been received. One additional
bit is sampled, and an error reported if it is not the expected (high) stop bit. Once a character has been received
it is put in to the FIFO along with the frame and parity error flags. If the FIFO becomes full the character is
discarded and the first character to be received that can be put in to the FIFO will have the overrun status flag
set (thus the overrun flag indicates that characters were lost before the one that is marked).
There are two error conditions may result if the stop bit was not detected. If the data received is all zeros and
a zero is seen in place of the stop bit then the break condition is detected. A zero character is put in the FIFO
along with the break-detected flag, the receiver will not resume operation until the break condition has been
removed by the line being high for two bit times. If the data received is not all zeros but a zero is seen in place
of the stop bit then a frame error is reported, the input data continues to be sampled for half a bit time. During
this period, if the input is sampled high it is considered as a late stop bit and the line is monitored for the next
start bit. If the input remains low for the full half bit time then it is considered to be an early start bit and the
receiver will synchronize at the half bit time point and start assembly of the next character.
Содержание BCM1125
Страница 18: ...BCM1250 BCM1125 BCM1125H User Manual 10 21 02 Broadcom Corporation Page xviii Document 1250_1125 UM100CB R ...
Страница 28: ...BCM1250 BCM1125 BCM1125H User Manual 10 21 02 Broadcom Corporation Page xxviii Document 1250_1125 UM100CB R ...
Страница 515: ...BCM1250 BCM1125 BCM1125H User Manual 10 21 02 Broadcom Corporation Page vii Index Document 1250_1125 UM100CB R ...