
Programming Model
11-16
ADSP-BF59x Blackfin Processor Hardware Reference
To prevent any loss of data and misalignments of the serial datastream, the
UART_LSR
register provides two status flags for handshaking—
THRE
and
DR
.
The
THRE
flag is set when
UART_THR
is ready for new data and cleared when
the processor loads new data into
UART_THR
. Writing
UART_THR
when it is
not empty overwrites the register with the new value and the previous
character is never transmitted.
The
DR
flag signals when new data is available in
UART_RBR
. This flag is
cleared automatically when the processor reads from
UART_RBR
. Reading
UART_RBR
when it is not full returns the previously received value. When
UART_RBR
is not read in time, newly received data overwrites
UART_RBR
and
the
OE
flag is set.
With interrupts disabled, these status flags can be polled to determine
when data is ready to move. Note that because polling is processor inten-
sive, it is not typically used in real-time signal processing environments.
Be careful if transmit and receive are served by different software threads,
because read operations on the
UART_LSR
and
UART_IIR
registers are
destructive. Polling the
SIC_ISR
register without enabling the interrupts
by
SIC_MASK
is an alternate method of operation to consider. Software can
write up to two words into the
UART_THR
register before enabling the
UART clock. As soon as the
UCEN
bit is set, those two words are sent.
Alternatively, UART writes and reads can be accomplished by interrupt
service routines. Separate interrupt lines are provided for UART TX,
UART RX, and UART error/status. The independent interrupts can be
enabled individually by the
UART_IER
register.
The ISRs can evaluate the status bit field within the
UART_IIR
register to
determine the signalling interrupt source. If more than one source is sig-
nalling, the status field displays the one with the highest priority.
Interrupts also must be assigned and unmasked by the processor’s inter-
rupt controller. The ISRs must clear the interrupt latches explicitly. See
Figure 11-13 on page 11-29
.
Summary of Contents for ADSP-BF59x Blackfin
Page 64: ...Development Tools 1 22 ADSP BF59x Blackfin Processor Hardware Reference...
Page 74: ...Processor Specific MMRs 2 10 ADSP BF59x Blackfin Processor Hardware Reference...
Page 244: ...Programming Examples 6 40 ADSP BF59x Blackfin Processor Hardware Reference...
Page 700: ...Programming Examples 16 78 ADSP BF59x Blackfin Processor Hardware Reference...
Page 738: ...Boundary Scan Architecture B 8 ADSP BF59x Blackfin Processor Hardware Reference...