
MC68302 Applications
D-18
MC68302 USER’S MANUAL
MOTOROLA
initialization corresponds to the recommended order described in 4.5.7 SCC Initialization.
The second part is a set of loops waiting for data to arrive to be retransmitted out of the
SCC3. The third part is the SCC3 receive interrupt handler. Transmit interrupts are masked
in this example.
D.4.2 Organization of Buffers
In the MC68302, there is no such thing as an receive register (Rx) or transmit register (Tx).
Rather, a flexible structure called a buffer descriptor (BD) is used. In this example, two Rx
BDs and two Tx BDs are used. Each BD is set up to point to a one-byte location for data.
Thus, the receiver and transmitter are double-buffered. The number of Rx or Tx BDs can be
changed simply by changing the number of BDs initialized in the code (and two other lines
documented in the code). However, using at least two BDs has advantages as noted in the
following paragraphs.
The structure of the buffers is shown in Figure D-6.
Figure D-6. Transmit and Receive BD Tables and Buffers
To make the application more general, the data buffers were located in external RAM; how-
ever, internal RAM could have been used. Each BD points to just one byte in memory as
shown. Note that the data buffers do not need to be consecutive as shown.
From one to eight BDs may be used for both the transmit and receive operation. Use of eight
BDs for the transmit side of SCC3 requires that the SCP and SMCs not be used. As data
rates increase substantially beyond the 9600 baud of this example, the use of more BDs and
more data bytes per BD becomes justified. Why were two Rx BDs and two Tx BDs chosen
rather than just one each
BYTE
A2
SCC3 TRANSMIT BD TABLE
TX BD 0
TX BD 1
BYTE
BYTE
BYTE
$30000
$30001
$30002
$30003
A1
A0
RX BD 0
RX BD 1
DATA BUFFERS IN RAM
CPU MOVES
DATA FROM
RX TO TX
BUFFERS IN
THIS CODE.
MC68302
ON-CHIP DMA USES
THESE POINTERS TO KNOW
WHERE TO STORE DATA.
SCC3 RECEIVE BD TABLE
ONLY 2 OF 8 BDS ARE USED.