5 Serial Ports
5 – 26
The code might look like this:
TX0 = AX0;
{linear data written to transmit register}
NOP;
{any instruction}
AX1 = TX0;
{compressed data transferred to AX1}
Use the same procedure to expand data, but use RXn instead of TXn.
RX0 = AX0;
{compressed data written to receive register}
NOP;
{any instruction}
AX1 = RX0;
{expanded - linear value transferred to AX1}
5.11
AutoBuffering
In normal operation, a SPORT generates an interrupt when it has received
or has started to transmit a data word. Autobuffering provides a
mechanism for receiving or transmitting an entire block of serial data
before an interrupt is generated. Service routines can operate on the entire
block of data, rather than on a single word, reducing overhead
significantly. Autobuffering is available on both SPORT0 and SPORT1,
except on the ADSP-21msp58/59 which autobuffers only on SPORT0.
Autobuffering uses the circular buffer addressing capability of the DAGs.
With autobuffering enabled, each serial data word is transferred (or if
multichannel operation is enabled, each active word is transferred) to or
from data memory in a single overhead cycle. (Autobuffering to program
memory is not supported.) This overhead cycle occurs independently of
the instructions being executed and effectively suspends execution for one
cycle (or more, if wait states are required) when it happens. No interrupt
is generated for these individual data word transfers.
The autobuffer transfer cannot be duplicated by any instruction. However,
an equivalent assembly language instruction would be:
DM(I,M) = RX0
or
Equivalent Instructions Only
TX0 = DM(I,M)
The I and M registers used in the transfer are selected by fields in the
SPORT’s autobuffer control register.
The processor waits for the current instruction to finish before inserting