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
345
In most applications, the protocol engine will compute and append a CRC. If DMA option append_CRC is not
set, the user can supply a CRC as part of the DMA buffer.
When the number of empty entries in the TxFIFO exceeds a configurable threshold (
ser_tx_wr_thres
), the
DMA engine will begin to write frame data into the TxFIFO. The start and end of the frame are specially marked
for the protocol engine.
Once the number of bytes transferred to the TxFIFO exceeds another configurable threshold (derived from
ser_tx_rd_thres
) or the end of frame has been written to the TxFIFO, processing of the new frame by the
protocol engine can begin.
First the protocol engine ensures that a user-defined number of flags, set in the flag_num field of the
ser_mode
register, have been sent prior to the opening flag of the new frame. A flag_num of 4’b0 indicates that the closing
Flag of one frame can be reused as the opening flag for the next.
The user frame is then read from the TxFIFO into the protocol engine. An opening Flag is automatically
prepended and bit-stuffing is performed on the bytes supplied by the DMA.
If the transmit module empties the TxFIFO but the user frame has not completed, an underrun error is reported
in the tx_underrun bit in the
ser_status
register. When this occurs, the transmit module terminates the current
frame with an Abort sequence. It then begins to send Flag or Idle depending on the setting of flag_en. The
value of
ser_tx_rd_thres
should be adjusted to minimize the likelihood of such underruns.
During frame transmission, the protocol engine always calculates a CRC, either the CRC-CCITT or CRC-32
as determined by the crc_mode bit in the
ser_mode
configuration register. The bit-stuffed CRC is inserted
before the closing flag if the append_CRC option is set in the DMA descriptor. The transmitted CRC is always
compared to the calculated CRC. If the CRC was automatically generated, the two necessarily match. If the
CRC was supplied by the user and it does not match the calculated one, a transmit CRC error is reported in
the tx_crcerrr bit of the
ser_status
register.
In addition, the protocol engine keeps track of the number of bytes that are sent for the current frame. If the
number of bytes provided in the user frame is smaller than
ser_min_frm_sz
and the append_PAD option is
set in the transmit descriptor, the protocol engine automatically adds zero padding to the user frame. When
padding occurs, the protocol engine also appends its calculated CRC.
Finally, a trailing Flag is automatically appended to the bit-stuffed frame. If DMA option abort was set, an Abort
is sent instead of the final Flag.
The serialized bit stream is passed to the line interface as allowed by the transmit gating signals. When output
to that interface is disabled, the serial stream does not advance; no bits are discarded. The output bit stream
is not otherwise aligned or correlated with transitions on pin TIN, whether used directly as the enable signal or
as synchronization for the serial sequencer.
No status is returned upon completion of DMA, but a serial DMA interrupt may be requested by setting the
interrupt or pkt_int option. CRC and underrun errors set the flags tx_crcerr and tx_underrun_error in the
ser_status
register respectively. These flags are cumulative. If the corresponding bit in the
ser_err_mask
register is set, they also trigger a serial device interrupt. Reading the
ser_status
register resets these flags to
0 and clears the interrupt condition.