MC68302 Applications
D-66
MC68302 USER’S MANUAL
MOTOROLA
using transparent mode with the EXSYN bit set in SCM2.
DSR2 = $7E7E
6. Setting SCCE2 to $FF clears out any current status in the event register. SCCE2 =
$FF
7. You must indicate in the SCCM2 register which (if any) transparent events you wish
to cause interrupts. Bit 5 should be set to zero. Bit 3 is only valid in BISYNC mode and
has no meaning in transparent mode. All other bits are valid. For this example, we will
disable interrupts, but all events will still be set in SCCE2.
SCCM2 = $00
8. Setting IMR to $0400 allows interrupts from SCC2 to be enabled in the interrupt con-
troller; however, since SCCM2 = $00, any SCC2 interrupt requests are prevented
from reaching the interrupt controller, and this step has no effect.
IMR = $0400
9. Initialize the receive and transmit function codes to 000, and set the receive buffer size
to 10 (hex) bytes. These are the general-purpose parameter RAM values forSCC2.
RFCR = $00
TFCR = $00
MRBLR = $0010
10.Initialize the BISYNC parameters. These parameters do not involve transparent mode;
however, it is a good idea to initialize them in case BISYNC mode is ever accidental-
ly entered by clearing the NTSYN bit in SCM2. The values for BSYNC and BDLE are
arbitrary and were chosen so that the two registers have different values. The control
characters table is disabled for good measure, although this too is not used in trans-
parent mode.
PRCRC = $0000
PTCRC = $0000
PAREC = $0000
BSYNC = $0033
BDLE = $0044
CHARACTER1 = $8000
11.The Tx BD buffer starts at address $30000. It is 18 (hex) bytes long. (Notice that the
MRBLR value equal to $0010 does not restrict the transmit buffer size.) The status
$D800 says that the buffer is ready and in external RAM. Since the I bit is set, the TX
bit in the SCCE2 register will be set upon completion, and this is the “l(fā)ast” buffer in
this transmission. The next Tx BD is set up so that it is not ready; transmission will
halt after one Tx BD.
Tx BD = $D800 $0018 $0003 $0000
Tx BD = $5800 $xxxx $xxxx $xxxx (This Tx BD is not yet ready.)
12.Two empty Rx BDs are needed to receive the transmit frame. Both are currently emp-
ty, and data is to be stored in external RAM buffers. Since the I bits are set, the RX bit
in the SCCE2 register will be set when each buffer is filled with data. The third Rx BD
is not ready yet. If it was ready, it would be filled with all $FFs (idles) after the first two
buffers were filled.
Rx BD = $D000 $0000 $0004 $0000
Rx BD = $D000 $0000 $0004 $0010