User Manual
BCM1250/BCM1125/BCM1125H
10/21/02
B r o a d c o m C o r p o r a t i o n
Document
1250_1125-UM100CB-R
Section 10: Serial Interfaces Page
323
When there is a character in the receive FIFO the duart_rx_rdy bit in the
duart_status
register is set, and the
CPU can read it from the
duart_rx_hold
register. Reading the
duart_rx_hold
register removes the character
from the FIFO. The top four bits of the status register reflect the flags (overrun error, parity error, frame error
and break) associated with the character (since reading the character pops it out of the FIFO the flags should
be read before the character). If the
duart_rx_hold
register is read at a time when the duart_rx_rdy bit is not
set the result is UNPREDICTABLE.
The receiver may be disabled or reset by issuing a command to the
duart_cmd
register. Both of these have
immediate effect, any character in the process of being received is discarded. Reset will also discard all data
in the FIFO, disabling the receiver will retain it and reading from the FIFO can continue. In both cases the
receiver must be enabled by writing the command register.
Handshaking using the RTS/CTS protocol is implemented in hardware. It is enabled separately for the
transmitter (in
duart_mode_reg_2
) and the receiver (in
duart_mode_reg_1
). When enabled the transmitter
will monitor the state of the CTS_TCLKIN pin, and will only start sending a character if the signal is low. Once
transmission of a character has started it will continue until the character has been sent regardless of the state
of CTS_TCLKIN. When enabled the RTS_TSTROBE pin is driven by the receiver. It will be set low if the
receiver is enabled and is able to receive a character. On receiving a start bit that will cause the receiver to
become full the RTS_TSTROBE line will be deasserted (set high), to indicate that no further characters should
be sent.
If hardware handshaking is disabled the RTS_TSTROBE output is controlled from software, and will reflect the
inverse of the op[0] bit for channel A or the op[1] bit for channel B. The op bits can be set by writing to the
duart_set_opr
register and cleared by writing to the
duart_clear_opr
register. For convenience of systems
implementing software flow control the op[0] and op[1] bits (that control RTS_TSTROBE) can also be set and
cleared through the
duart_out_port
register. The CTS_TCLKIN pin can always be read through the
duart_in_port
register.
The baud rate clock that the transmitter is using can be output on the COUT pin, alternatively the pin can be
driven from software as the inverse of op[2] or op[3]. This is set in the output port configuration register
duart_opcr
.
The CIN_RCLKIN, RIN and TIN pins are provided in the
duart_in_port
register for software to use either as
separate handshake lines or as general inputs. The CTS_TCLKIN and CIN_RCLKIN lines have transition
detectors associated with them and the upper four bits of the
duart_inport_chng
register will latch the fact the
line changed since the last time the register was read (the read automatically clears the bits).